1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-01-23 20:10:05 +08:00

Add SpaceVim#mapping#clearBuffers func

This commit is contained in:
wsdjeg 2017-02-20 19:27:19 +08:00
parent b1b33d47f0
commit 8d20e83af7
2 changed files with 14 additions and 0 deletions

View File

@ -64,3 +64,14 @@ function! SpaceVim#mapping#gd() abort
normal! gd
endif
endfunction
function! SpaceVim#mapping#clearBuffers() abort
for i in range(1,bufnr('$'))
if i != bufnr('%')
try
exe 'bw ' . i
catch
endtry
endif
endfor
endfunction

View File

@ -86,6 +86,9 @@ function! SpaceVim#mapping#leader#defindWindowsLeader(key) abort
\'Empty current buffer','call zvim#util#BufferEmpty()')
call zvim#util#defineMap('nnoremap <silent>', '[Window]\', ':<C-u>b#<CR>', 'Switch to the last buffer','b#')
call zvim#util#defineMap('nnoremap <silent>', '[Window]q', ':<C-u>close<CR>', 'Close current windows','close')
call zvim#util#defineMap('nnoremap <silent>', '[Window]Q', ':<C-u>bdelete<CR>', 'delete current windows','bdelete')
call zvim#util#defineMap('nnoremap <silent>', '[Window]c', ':<C-u>call SpaceVim#mapping#clearBuffers()<CR>',
\'Clear all the buffers','call SpaceVim#mapping#clearBuffers()')
endif
endfunction