pyratelog

personal blog
git clone git://git.pyratebeard.net/pyratelog.git
Log | Files | Refs | README

commit f369ff49e5f79c10b8e74578b51f8834b15bb85a
parent 7923d09e3f8177e176567e90f16c80db374a9eaa
Author: pyratebeard <root@pyratebeard.net>
Date:   Mon, 10 Apr 2023 21:54:08 +0100

vim_-_buffer_me_up

Diffstat:
Mentry/vim_-_buffer_me_up.md | 14++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/entry/vim_-_buffer_me_up.md b/entry/vim_-_buffer_me_up.md @@ -1,12 +1,12 @@ -This is the first entry in a three part series on everyones favourite text editor, [Vim](TK){target="_blank" rel="noreferrer"}. There are plenty of Vim guides and tutorials on the internet already, from first steps to hardcore power user tips. My entries are going to be somewhat of a middle ground. +This is the first entry in a three part series on everyone's favourite text editor, [Vim](TK){target="_blank" rel="noreferrer"}. There are plenty of Vim guides and tutorials on the internet already, from first steps to hardcore power user tips. My entries are going to be somewhat of a middle ground. -I have been using Vim as my main (read _only_) text editor for many years. Over this time I have continuously learnt new ways of working and using Vim's functions properly. +I have been using Vim as my main (read "_only_") text editor for many years. Over this time I have continuously learnt new ways of working and using Vim's functions properly. -The latter is what I am going to cover in three parts. In the past couple of years I have been working of enhancing my Vim workflow and the first step was to master [buffers](TK){target="_blank" rel="noreferrer"}. +In the past couple of years I have been working on enhancing my Vim workflow and the first step was to master [buffers](TK){target="_blank" rel="noreferrer"}. When I switched to Vim from [Sublime](https://www.sublimetext.com/){target="_blank" rel="noreferrer"} I had trouble getting over the use of tabs for open files. Sublime, like a lot of GUI text editors, would open files in tabs at the top of the window. Vim does have tabs but they are not used in the same way (more on this later TK). -Opening a file in Vim creates a buffer. By default this buffer will fill the window. If you then open another file then the new buffer will fill the window. To view your buffers incant +Opening a file in Vim creates a buffer, by default filling the window. If you open another file the new buffer will fill the window, replacing the original buffer. To view your buffers incant ``` :buffers ``` @@ -16,7 +16,7 @@ or :ls ``` -This will list all open buffers with a unique number, one or more indicators, the file in the buffer, and the line the cursor is on. For example +This will list all open buffers displaying them each with a unique number, one or more indicators, the file in the buffer, and the line the cursor is on ``` 1 a "entry/vim_-_buffer_me_up.md" line 9 5 #h "pyratelog.sh" line 1 @@ -42,4 +42,6 @@ In my ~/.vimrc I set the following keymap nnoremap <leader>b :ls<CR>:b ``` -With this I type `\b` (backslash is the default 'leader' key) to view my buffers and the prompt will wait for me to type a number and hit enter. It has made using buffers quite easy. +With this I type `\b` (backslash is the default 'leader' key) to view my buffers and the prompt will wait for me to type a number and hit enter. It has made managing a large number of buffers quite easy. Vim also has a built in auto-complete. By entering `:b <TAB>` Vim will cycle through the buffers, or start typing part of the filename or filepath and it will auto-complete. + +