diff options
Diffstat (limited to 'vim/init')
-rw-r--r-- | vim/init/basic.vim | 4 | ||||
-rw-r--r-- | vim/init/config.vim | 7 | ||||
-rw-r--r-- | vim/init/keymaps.vim | 12 |
3 files changed, 13 insertions, 10 deletions
diff --git a/vim/init/basic.vim b/vim/init/basic.vim index b74f988..945c134 100644 --- a/vim/init/basic.vim +++ b/vim/init/basic.vim | |||
@@ -113,10 +113,6 @@ nnoremap gl :call ToggleQuit()<CR> | |||
113 | " Simply exit when closing the last buffer | 113 | " Simply exit when closing the last buffer |
114 | 114 | ||
115 | function! Bye() | 115 | function! Bye() |
116 | let specialFileTypes = ['help', 'netrw', 'vim-plug', 'nerdtree'] | ||
117 | let bufIsSpecial = index(specialFileTypes, &filetype) != -1 | ||
118 | let bufInMultipleWindow = len(getbufinfo(bufnr())[0].windows) > 1 | ||
119 | |||
120 | if len(getbufinfo({'buflisted': 1})) == 1 && len(getwininfo()) == 1 | 116 | if len(getbufinfo({'buflisted': 1})) == 1 && len(getwininfo()) == 1 |
121 | if g:quitVimWhenPressingCtrlC | 117 | if g:quitVimWhenPressingCtrlC |
122 | :silent! quit | 118 | :silent! quit |
diff --git a/vim/init/config.vim b/vim/init/config.vim index f15c5a8..39f1c12 100644 --- a/vim/init/config.vim +++ b/vim/init/config.vim | |||
@@ -7,6 +7,13 @@ | |||
7 | " | 7 | " |
8 | "====================================================================== | 8 | "====================================================================== |
9 | 9 | ||
10 | "---------------------------------------------------------------------- | ||
11 | " | ||
12 | "---------------------------------------------------------------------- | ||
13 | augroup LeavingBuffer! | ||
14 | au BufLeave {} if getline(1, '$') == [''] | setlocal bufhidden=wipe | endif | ||
15 | augroup END | ||
16 | |||
10 | 17 | ||
11 | "---------------------------------------------------------------------- | 18 | "---------------------------------------------------------------------- |
12 | " 有 tmux 何没有的功能键超时(毫秒) | 19 | " 有 tmux 何没有的功能键超时(毫秒) |
diff --git a/vim/init/keymaps.vim b/vim/init/keymaps.vim index e4bdfd4..504d071 100644 --- a/vim/init/keymaps.vim +++ b/vim/init/keymaps.vim | |||
@@ -289,11 +289,11 @@ vnoremap Q <ESC>`<i「<ESC>`>la」<ESC> | |||
289 | " :Redir !ls -al ........ show the full output of command ':!ls -al' in a scratch window | 289 | " :Redir !ls -al ........ show the full output of command ':!ls -al' in a scratch window |
290 | " | 290 | " |
291 | function! Redir(cmd) | 291 | function! Redir(cmd) |
292 | for win in range(1, winnr('$')) | 292 | " for win in range(1, winnr('$')) |
293 | if getwinvar(win, 'scratch') | 293 | " if getwinvar(win, 'scratch') |
294 | execute win . 'windo close' | 294 | " execute win . 'windo close' |
295 | endif | 295 | " endif |
296 | endfor | 296 | " endfor |
297 | if a:cmd =~ '^!' | 297 | if a:cmd =~ '^!' |
298 | let output = system(matchstr(a:cmd, '^!\zs.*')) | 298 | let output = system(matchstr(a:cmd, '^!\zs.*')) |
299 | else | 299 | else |
@@ -308,7 +308,7 @@ function! Redir(cmd) | |||
308 | endfunction | 308 | endfunction |
309 | 309 | ||
310 | command! -nargs=1 -complete=command Redir silent call Redir(<q-args>) | 310 | command! -nargs=1 -complete=command Redir silent call Redir(<q-args>) |
311 | nnoremap <leader>rr :Redir | 311 | nnoremap <leader>rr :Redir<space> |
312 | 312 | ||
313 | 313 | ||
314 | "---------------------------------------------------------------------- | 314 | "---------------------------------------------------------------------- |