Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Buffer, quickfix windows, :Ack - does this work together?

Buffer, quickfix windows, :Ack - does this work together?

Gave this talk on the 5th @vimberlin meetup @LAUNCH/CO on the 27th of September 2012.


Matthias Günther

September 27, 2012


  1. http://www.flickr.com/photos/pastorfuture/2829852159/

  2. Buffers vs. Tabs (And Windows?)

  3. A buffer is the in-memory text of a file. A

    window is a viewport on a buffer. A tab page is a collection of windows.
  4. http://www.flickr.com/photos/oberazzi/318947873/

  5. - Buffers opens multiple files - Windows are for the

    purpose of splitting the workspace and displaying multiple files - Tabs are a different layout of windows of ALL of your existing buffers
  6. http://www.flickr.com/photos/37prime/3836700346/

  7. ✔ :buffers (:ls) – show all opened buffers ✔ :bd

    N – delete buffer with number N ✔ :ball – display all buffers in windows ✔ :b <name-of-buffer><TAB> - try it out ✔ :bn :bp :bf :bl next previous first last
  8. http://www.flickr.com/photos/mariplus/6750780529/

  9. ✔ % - buffer in the current window ✔ #

    - the alternate buffer (the file you edited last) ✔ :b# - to jump between active and previous ✔ a - active buffer (loaded and visible in the current window ✔ u - unlisted buffer (e.g. help file) ✔ h - hidden buffer
  10. Buffer options (change the behavior of a buffer)

  11. ✔ bufhidden: what happens when the buffer is no longer

    displayed in a window hide => hide the buffer (like minimizing window) unload => clear everything delete => closes the tab wipe => clear and delete from buffer list
  12. ✔ buftype: what kind of a buffer this window is

    nofile => not related to a file (tmp register) nowrite => buffer will not be written (used for error window) acwrite => buffer will always be written with BufWriteCmd quickfix => contains list of errors help => useful help command
  13. ✔ swapfile: alternative to buffers (good for great files) ✔

    buflisted: buffer shows up in the buffer list
  14. Example: directory buffer :setlocal buftype=nowrite :setlocal bufhidden=delete :setlocal noswapfile

  15. http://www.flickr.com/photos/mariplus/6750780529/

  16. http://en.wikipedia.org/wiki/Aztec_C Idea came from Manx's Aztec C compiler Save the

    error message from the compiler in a file and use Vim to jump to the errors by one
  17. ✔ :ccl - close the quickfix window ✔ :lcl -

    close the window showing the "location list" for the current window
  18. :Ack (just uses :quickfix buffer)