From a485f2da80fef186711bcff9b1bffedcb9ac5b8c Mon Sep 17 00:00:00 2001 From: jbranchaud Date: Sat, 14 Nov 2015 13:06:27 -0600 Subject: [PATCH] Add Unloading A Buffer as a vim til. --- README.md | 1 + vim/unloading-a-buffer.md | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 vim/unloading-a-buffer.md diff --git a/README.md b/README.md index 5c72b41..e201856 100644 --- a/README.md +++ b/README.md @@ -298,6 +298,7 @@ smart people at [Hashrocket](http://hashrocket.com/). - [Swapping Split Windows](vim/swapping-split-windows.md) - [Tabs To Spaces](vim/tabs-to-spaces.md) - [The Vim Info File](vim/the-vim-info-file.md) +- [Unloading A Buffer](vim/unloading-a-buffer.md) - [Verbose Commits With Fugitive](vim/verbose-commits-with-fugitive.md) - [View Commit History of a File](vim/view-commit-history-of-a-file.md) - [Viewing Man Pages with man.vim](vim/viewing-man-pages-with-man-vim.md) diff --git a/vim/unloading-a-buffer.md b/vim/unloading-a-buffer.md new file mode 100644 index 0000000..612b4b3 --- /dev/null +++ b/vim/unloading-a-buffer.md @@ -0,0 +1,28 @@ +# Unloading A Buffer + +My preferred workflow with vim involves working across as many buffers as I +need in a single window. I open files in new buffers as needed and navigate +between existing ones with a number of built-in vim features and plugin +shortcuts. Eventually though, my list of buffers gets a bit crowded making +it difficult to move around and keep everything straight. One method for +dealing with this is occasionally unloading the buffers you no longer need. +This can be accomplished with `:bd`. + +To unload the current buffer: + +``` +:bd +``` + +To unload some other buffer by buffer number, say buffer 10: + +``` +:10bd +``` + +Caveat: unloading a buffer marks it as *unlisted* in the buffer list, +meaning it won't appear in your normal view of the buffer list. It should +also be noted that it does not remove it from the jump list or the global +mark list. + +See `:h :bd` for more details.