Просмотр исходного кода

feat: bind H to toggle the display of terminal buffers

Signed-off-by: jsvisa <delweng@gmail.com>
jsvisa 1 год назад
Родитель
Сommit
ef33533f96
1 измененных файлов с 9 добавлено и 0 удалено
  1. 9 0
      plugin/bufexplorer.vim

+ 9 - 0
plugin/bufexplorer.vim

@@ -537,6 +537,8 @@ function! s:MapKeys()
     nnoremap <script> <silent> <nowait> <buffer> u             :call <SID>ToggleShowUnlisted()<CR>
     nnoremap <script> <silent> <nowait> <buffer> v             :call <SID>SelectBuffer("split", "vr")<CR>
     nnoremap <script> <silent> <nowait> <buffer> V             :call <SID>SelectBuffer("split", "vl")<CR>
+    nnoremap <script> <silent> <nowait> <buffer> H             :call <SID>ToggleShowTerminal()<CR>
+
 
     for k in ["G", "n", "N", "L", "M", "H"]
         execute "nnoremap <buffer> <silent>" k ":keepjumps normal!" k."<CR>"
@@ -1073,6 +1075,13 @@ function! s:Close()
     echo
 endfunction
 
+" ToggleShowTerminal {{{2
+function! s:ToggleShowTerminal()
+    let g:bufExplorerShowTerminal = !g:bufExplorerShowTerminal
+    call s:RebuildBufferList()
+    call s:UpdateHelpStatus()
+endfunction
+
 " ToggleSplitOutPathName {{{2
 function! s:ToggleSplitOutPathName()
     let g:bufExplorerSplitOutPathName = !g:bufExplorerSplitOutPathName