Skip to content

Vim for-each-buffer tool: do (horrible) things to (deserving) buffers

License

Notifications You must be signed in to change notification settings

kstr0k/vim-bufcond

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

vim-bufcond

Do things to buffers depending on their status

Copyright

Copyright 2020 Alin Mr. <almr.oss@outlook.com>. MIT license.

Examples

  • :call bufcond#BufDo( 'bw', { v -> !len( v.windows ) && !v.changed }, #{} ) wipes out unmodified buffers which are not active in any tab/window. First argument is a command or a lambda, second is a lambda to filter getbufinfo() results, third is a dictionary passed to getbufinfo().
  • same as above, but merely unload (if loaded): call bufcond#BufDo( { b -> execute( 'bunload ' .. b ) }, { v -> !len( v.windows ) && !v.changed && v.loaded }, #{} )
  • get comprehensive info on loaded buffers, using Bufferize: Bufferize echo join( bufcond#BufDo( { v -> v->bufinfo()[0] }, { v -> v.loaded }, #{} ), "\n" )

See bufcond.vim

Installation

With vim 8+, just drop in packpath (I personally use minpac which is almost the same thing). Autoloadable functions for now.

About

Vim for-each-buffer tool: do (horrible) things to (deserving) buffers

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published