this post was submitted on 21 Jul 2023
23 points (100.0% liked)
Neovim
2171 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
How familiar are you with vim? You've been using it with vscode for a while so I figure you're somewhat familiar with vim shortcuts? If you haven't already, you should run through
vimtutor
. The built in help is very good in vim, it's good to develop a habit of using:help
and:helpgrep
before googling. When in help pages you can useC-]
to go to references in the documentation.Some resources that I found useful when getting in to vim:
Articles: Oil and vinegar, Death by a thousand files
Talks: Let vim do the typing, How to do 90% of what plugins do with just vim
Speaking of plugins, tpope has an excellent repo of very good plugins that feel like they fit in very naturally with vim. I can especially recommend fugitive, commentary and surround
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