diff options
Diffstat (limited to 'vim/init/basic.vim')
-rw-r--r-- | vim/init/basic.vim | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/vim/init/basic.vim b/vim/init/basic.vim index 09ed985..eb895e2 100644 --- a/vim/init/basic.vim +++ b/vim/init/basic.vim | |||
@@ -109,19 +109,19 @@ nnoremap gl :call ToggleQuit()<CR> | |||
109 | " Simply exit when closing the last buffer | 109 | " Simply exit when closing the last buffer |
110 | 110 | ||
111 | function! Bye() | 111 | function! Bye() |
112 | " Delete current buffer if working on special filetype | 112 | let specialFileTypes = ['help', 'netrw', 'vim-plug', 'nerdtree'] |
113 | let specialFileTypes = ['help', 'netrw', 'vim-plug', 'nerdtree'] | 113 | let bufIsSpecial = index(specialFileTypes, &filetype) != -1 |
114 | if index(specialFileTypes, &filetype) != -1 | 114 | let bufInMultipleWindow = len(getbufinfo(bufnr())[0].windows) > 1 |
115 | :bdelete | 115 | |
116 | " Delete current buffer if more than one buffers | 116 | if len(getbufinfo({'buflisted': 1})) == 1 && len(getwininfo()) == 1 |
117 | elseif len(getbufinfo(bufnr())[0].windows) == 1 && len(getwininfo()) > 1 | 117 | if g:quitVimWhenPressingCtrlC |
118 | :bdelete | 118 | :silent! quit |
119 | elseif g:quitVimWhenPressingCtrlC | ||
120 | " Otherwise, quit vim | ||
121 | :silent! quit | ||
122 | else | 119 | else |
123 | :echo "Press gl to allow quit with <C-c>" | 120 | :echo "Press gl to allow quit with <C-c>" |
124 | endif | 121 | endif |
122 | else | ||
123 | :bdelete | ||
124 | endif | ||
125 | endfunction | 125 | endfunction |
126 | 126 | ||
127 | " Ctrl-C rules!!! | 127 | " Ctrl-C rules!!! |