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