mirror of
https://github.com/jbranchaud/til
synced 2026-01-03 23:28:02 +00:00
Add Unloading A Buffer as a vim til.
This commit is contained in:
@@ -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)
|
||||
|
||||
28
vim/unloading-a-buffer.md
Normal file
28
vim/unloading-a-buffer.md
Normal file
@@ -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.
|
||||
Reference in New Issue
Block a user