diff --git a/.vimrc b/.vimrc index efba530..67cf96a 100644 --- a/.vimrc +++ b/.vimrc @@ -11,6 +11,19 @@ filetype plugin on call pathogen#infect() call pathogen#helptags() +" Set auto read so a file is updated if externally changed +set autoread + +" Turn on mouse Interaction +set mouse=a + +" Set default split to be right or bottom +set splitright +set splitbelow + +" Tell vim it's a fast terminal +set ttyfast + " set relative ruler with current line as real line number set relativenumber set number @@ -53,7 +66,7 @@ let g:airline_powerline_fonts = 1 let g:airline_theme='dark' " Make vim default to the plus register (system clipboard) when yanking etc. -set clipboard=unnamedplus +"set clipboard=unnamedplus " Shows the command I am typing. I really wish this could be in airline but don't think it can set showcmd @@ -62,9 +75,33 @@ set showcmd :map :map +" Make Ctrl C and Ctrl V work on system buffer +nnoremap "+y +vnoremap "+y +"nnoremap "+p +"nnoremap "+P +inoremap "+pa + +nnoremap :tabnew +nnoremap :tabnext +nnoremap :tabprevious + +" map gV to select previously pasted +nnoremap gV "`[".getregtype(v:register)[0]."`]" " Set :w!! to save with sudo cmap w!! w !sudo tee % + +"Run current line as command +nnoremap Q !!$SHELL + +" Do Shebang line +inoremap :sil exe ".!which " s/^/#!/ filetype detectYpDi + +" DO bullet points +inoremap :exe "norm Ypf lDB\"A + + fun! Start() " Don't run if: we have commandline arguments, we don't have an empty " buffer, if we've not invoked as vim or gvim, or if we'e start in insert mode @@ -107,4 +144,14 @@ endfun " Folding +nnoremap :tabn +nnoremap :tabn +nnoremap :tabn +nnoremap :tabn +nnoremap :tabn au FileType html,css,less,javascript,php setl foldmethod=indent foldenable + +"set es6 files to javascript +augroup filetypedetect + autocmd BufNew,BufNewFile,BufRead *.es6 :setfiletype javascript +augroup END