Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add :Breset

  • Loading branch information...
commit e3d22f52ed322d90e4e132d71b25ddf00e039434 1 parent 445cb76
@Soares authored
Showing with 21 additions and 3 deletions.
  1. +11 −0 autoload/butane.vim
  2. +7 −1 doc/butane.txt
  3. +3 −2 plugin/butane.vim
View
11 autoload/butane.vim
@@ -44,3 +44,14 @@ function! butane#bclose(bang, buffer)
execute 'bdelete'.a:bang.' '.l:target
execute wcurrent.'wincmd w'
endfunction
+
+
+" Delete all open buffers.
+function! butane#reset(bang)
+ exe 'bufdo bdelete'.a:bang
+ " If there were multiple buffers, the last is still loaded.
+ exe 'bdelete'.a:bang
+ " Clear extraneous echos & messages
+ echo ''
+ redraw
+endfunction
View
8 doc/butane.txt
@@ -34,7 +34,13 @@ COMMANDS *butane-commands*
:Bclose[!] *:Bclose*
|:bdelete| without changing the window layout.
- [!] works like the [!] in |:bd|.
+ [!] works like the [!] in |:bdelete|.
+
+:Breset[!] *:Breset*
+ Runs |:bdelete| on all buffers. Useful to reset vim to a clean state
+ if you want to switch projects without reloading vim.
+
+ [!] is passed to each |:bdelete| command.
=============================================================================
MAPPINGS *butane-mappings*
View
5 plugin/butane.vim
@@ -16,8 +16,9 @@ if !exists('g:butane_automap')
endif
-command! -bang -complete=buffer -nargs=? Bclose
- \ call butane#bclose('<bang>', '<args>')
+command -bang Breset call butane#reset('<bang>')
+command -bang -complete=buffer -nargs=? Bclose
+ \ call butane#bclose('<bang>', '<args>')
if !empty(g:butane_automap)
Please sign in to comment.
Something went wrong with that request. Please try again.