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:
parent
b1b33d47f0
commit
8d20e83af7
@ -64,3 +64,14 @@ function! SpaceVim#mapping#gd() abort
|
|||||||
normal! gd
|
normal! gd
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! SpaceVim#mapping#clearBuffers() abort
|
||||||
|
for i in range(1,bufnr('$'))
|
||||||
|
if i != bufnr('%')
|
||||||
|
try
|
||||||
|
exe 'bw ' . i
|
||||||
|
catch
|
||||||
|
endtry
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
endfunction
|
||||||
|
@ -86,6 +86,9 @@ function! SpaceVim#mapping#leader#defindWindowsLeader(key) abort
|
|||||||
\'Empty current buffer','call zvim#util#BufferEmpty()')
|
\'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]\', ':<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>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
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user