PracticalVim Tip36 - yszheda/wiki GitHub Wiki

Table of Contents

Tip 36: Track Open Files with the Buffer List

Return to the top: <>

Understand the Distinction Between Files and Buffers

  • buffer: in-memory representation of a file
  • Most Vim commands operate on buffers, but a few operate on files, including the `:write`, `:update` and `:saveas` commands.

Meet the Buffer List

References:

  • ``: toggle between the current and alternate files

Use the Buffer List

  • `:bprev`: move backward
  • `:bnext`: move forward
  • `:bfirst`/`:blast`: jump to the start/end of the list
  • `:buffer N`

References:

  • `:buffer {bufname}`
  • `:bufdo`: execute an Ex command in all of the buffers

References:

Create Mappings to Quickly Traverse Vim's Lists

Deleting Buffers

  • `:bd[elete]`
⚠️ **GitHub.com Fallback** ⚠️