Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add :Breset

  • Loading branch information...
commit f552fab5bcfa9c284ef52bc864814b06b32c568d 1 parent 445cb76
@Soares authored
Showing with 16 additions and 3 deletions.
  1. +6 −0 autoload/butane.vim
  2. +7 −1 doc/butane.txt
  3. +3 −2 plugin/butane.vim
View
6 autoload/butane.vim
@@ -44,3 +44,9 @@ function! butane#bclose(bang, buffer)
execute 'bdelete'.a:bang.' '.l:target
execute wcurrent.'wincmd w'
endfunction
+
+
+" Delete all open buffers.
+function! butane#clear(bang)
+ exe 'bufdo bdelete'.a:bang
+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#breset('<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.