Vim buffers

@vim @buffers

Made some notes on paper. Put them here later.

See:

  • https://stackoverflow.com/questions/16082991/vim-switching-between-files-rapidly-using-vanilla-vim-no-plugins
  • https://stackoverflow.com/questions/26708822/why-do-vim-experts-prefer-buffers-over-tabs/26745051#26745051

Is vim-unimpaired meant for this? Also bindings for buffers. Look up.

  • https://github.com/tpope/vim-unimpaired

  • :ls or :files or :buffers show buffer list

  • :b or :buffer is overloaded, accepts both a buffer number (see :ls) or a (partial) buffer name
    • autocompletion works and partial buffer names suffice if they are unique

You can also navigate buffers (alternative mappings from vimunimpaired)

  • :bprevious or [b
  • :bnext or ]b
  • :bd for deleting buffers from the buffer list ls

Go to next or previous file in directory:

  • [f
  • ]f

You can also search the buffers with fuzzy file finders such as CtrlP or fzf.

:CtrlPBuffer

And other operations, such as searching on tags specifically in files opened in the buffer:

:CtrlPBufferTag

About fzf and vim:

  • https://dmerej.info/blog/post/fzf-for-the-win/

Okay not about buffers per se, but still:

  • https://moolenaar.net/habits.html