diff --git a/vim/.vimrc b/vim/.vimrc index b03b4f5..2cdd1ef 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -62,9 +62,10 @@ set lbr " Smart line breaking set tw=500 set t_Co=256 set hidden +set scrolloff=1000 +set shortmess+=I syntax enable "Syntax highlighting colorscheme madtheme "Colorscheme - " Backups in different folder set backup set writebackup @@ -112,6 +113,11 @@ function! ModeColor(mode) endif endfunction +" Remove current buffer +function! BufferClose() + +endfunction + au InsertEnter * call ModeColor(v:insertmode) au InsertChange * call ModeColor(v:insertmode) au InsertLeave * call ModeColor('n') @@ -119,15 +125,16 @@ call ModeColor('n') " --- Bindings let mapleader = "," +" word movement with tab +nnoremap W +nnoremap B " Close and write buffers -nnoremap q :bd +nnoremap q :b#bd# nnoremap w :w " Insert empty line before and after nnoremap okO " Fuzzy Finder nnoremap f :FufFile -" Goto next emptyline -nnoremap /^$ " nnoremap <> ?^$ " evil spaces nnoremap c m':%s/\s\+$//e`' @@ -141,6 +148,8 @@ vnoremap a :'<,'>Tabularize / " VimRC nnoremap oc :e ~/.vimrc nnoremap sc :so ~/.vimrc +" Toggle invisble chars +nnoremap i :set list! " Vimux nnoremap rr :call RunCmdVimux() nnoremap rq :call VimuxCloseRunner() @@ -149,22 +158,23 @@ nnoremap todo :g/TODO/ " 0 should find first non blank nmap 0 ^ " Easy buffer switching -nnoremap m :bnext -nnoremap n :bprev +nnoremap :bnext +nnoremap :bprev " Moving through windows nnoremap l nnoremap h nnoremap j nnoremap k - " Quick macroing nnoremap + @wj - " --- Don't need a help inoremap nnoremap vnoremap +" Sudo to write +cnoremap w!! w !sudo tee % >/dev/null + " --- Just a nuisance nnoremap q: @@ -174,6 +184,7 @@ ino ino ino + " --- Different use of undo nnoremap U @@ -196,17 +207,16 @@ hi IncSearch cterm=underline ctermbg=none ctermfg=green let g:SuperTabNoCompleteAfter = ['^',',','\s'] " --- NERDTree tabs -autocmd bufenter * if (winnr("$") == 1 && bufnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif nmap e :NERDTreeToggle autocmd StdinReadPre * let s:std_in=1 autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif -" autocmd BufLeave * if (exists("b:NERDTreeType") && b:NERDTreeType == "primary") | normal :bd | endif let NERDTreeWinSize = 30 let NERDChristmasTree = 0 let NERDTreeChDirMode = 2 let NERDTreeIgnore=['\~$','\.pyc$','\.swp$'] let NERDTreeWinPos="left" let NERDTreeMinimalUI = 1 +let NERDTreeQuitOnOpen = 1 " --- EasyMotion map / (easymotion-sn)