this post was submitted on 21 Jul 2023
21 points (95.7% liked)
Neovim
2157 readers
3 users here now
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Yeah, I'm familiar with shortcurts to move the cursor and text manipulation. But I'm not familiar with buffers, tabs and splitting window (i used VSC GUI to handle this part).
I'll have a look to your links, thank you very much
The help pages for buffers, tabs and manipulating windows (
:help CTRL-W
) are always a good place to start!Some basic pointers:
Buffers
A buffer is some text that vim has in memory, usually linked to a file, but not necessarily.
You might want to
:set hidden
to allow for buffers to exist without being open in any window.I have this mapping in my
.vimrc
for moving between buffersIf you hit the leader key (backslash by default) you can see all open buffers. You can then type one of the numbers preceding the buffers, or start typing the name of one of the buffers and then tab complete.
Windows
A window is a particular view into a buffer. You can have windows that point to the same buffer but are scrolled to different places which can be convenient if you want to look at different parts of the same file side by side for example. You can split the current window with
C-W S
(horizontally) orC-W V
(vertically). You can also close the current window withC-W Q
. One common way to move between windows isC-W
+ one of hjkl, but there are a ton of other ways that can sometimes be more convenient listed under:help CTRL-W
.Tabs
A tab is a collection of windows. You can create a new tab with
:tabnew
orC-W T
. You can navigate between tabs with:tabnext
orgt
and:tabprev
orgT
. Tabs are usually a bit counter-intuitive when coming from other editors since they work differently in vim, but they're very convenient once you get used to them imo.Jumps
Jumps are also worth checking out, the short version is that you can go to your previous position with
C-O
and then back withC-I
.Thank you very much. I already checked some blog post about it but it's still very useful to hear iy in different words