this post was submitted on 21 Jul 2023
20 points (95.5% liked)

Neovim

2091 readers
95 users here now

founded 1 year ago
MODERATORS
 

I'm thinking of switching from VSC to VIM because VSC is too heavy in term of ressources usage.

Currently, I use the VSC + VIM extension and I'm pretty happy.

But nowadays, I avoid to open some monorepo projects because it takes too much time and I use the Github explorer instead. Also, I use the mouse too much.

So I finally took the decision to give a try to Neovim.

I initially started with SpaceVIM and it was a good experience. But there is too much magic for me. Also, I have the feeling to not learn VIM.

So I setup CoC with VIM-plug + NerdTree. It looks promising.

Do you have any tips for me?

you are viewing a single comment's thread
view the rest of the comments
[–] madeindjs@lemmy.ml 0 points 1 year ago (1 children)

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

[–] zygo_histo_morpheus@programming.dev 2 points 1 year ago* (last edited 1 year ago) (1 children)

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 buffers

" switch between buffers
nnoremap <leader>b :ls<cr>:b<space>

If 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) or C-W V (vertically). You can also close the current window with C-W Q. One common way to move between windows is C-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 or C-W T. You can navigate between tabs with :tabnext or gt and :tabprev or gT. 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 with C-I.

[–] madeindjs@lemmy.ml 1 points 1 year ago

Thank you very much. I already checked some blog post about it but it's still very useful to hear iy in different words