Last active
December 16, 2015 11:49
-
-
Save amiorin/5430157 to your computer and use it in GitHub Desktop.
My .gvimrc with vim-smartclose.
<D-w> to close "help", "quickfix", "nerdtree" and for last you files.
For MacVim.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" My .gvimrc with https://github.com/szw/vim-smartclose | |
" <D-w> to close "help", "quickfix", "nerdtree" and for last you files. | |
" For MacVim | |
macmenu File.Close key=<Nop> | |
" tabclose like chrome {{{1 | |
noremap <silent> <D-w> :if tabpagenr() != tabpagenr('$') && winnr('$') == 1<CR>:tabclose<CR>:if tabpagenr() > 1<CR>:tabprev<CR>:endif<CR>:else<CR>:SmartClose<CR>:endif<CR> | |
" tabs {{{1 | |
let s:windowmapnr = 0 | |
let s:wins='1234567890!@#$%^&*()' | |
while (s:windowmapnr < strlen(s:wins)) | |
exe 'noremap <silent> <D-' . s:wins[s:windowmapnr] . '> ' . (s:windowmapnr + 1) . 'gt' | |
exe 'inoremap <silent> <D-' . s:wins[s:windowmapnr] . '> <C-O>' . (s:windowmapnr + 1) . 'gt' | |
exe 'cnoremap <silent> <D-' . s:wins[s:windowmapnr] . '> <C-C>' . (s:windowmapnr + 1) . 'gt' | |
exe 'vnoremap <silent> <D-' . s:wins[s:windowmapnr] . '> <C-C>' . (s:windowmapnr + 1) . 'gt' | |
let s:windowmapnr += 1 | |
endwhile | |
unlet s:windowmapnr s:wins |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://github.com/szw/vim-smartclose