DEV Community

Cover image for Exploring Vim: The 10 or So Things You Need To Know To Go Through The Dip

Exploring Vim: The 10 or So Things You Need To Know To Go Through The Dip

Jaime González García on November 22, 2018

This article was originally posted in barbarianmeetscoding.com. 😊 The videos should autoplay, but it looks like I can't add a video tag linked to m...
Collapse
 
vonheikemen profile image
Heiker

Thank you. This was very informative, especially the abbreviations part.

The snippets were one of the last pieces that was missing in my workflow with Vim. I refused to install a snippet plugin because I don't need that many. Now that I know about abbreviations I've created a couple for if statements and one for function definitions.

One thing I'm still missing is the "Go to definition" feature. I know that I can use ctags to make that happen but I'll have to find a way to keep them updated.

Collapse
 
vintharas profile image
Jaime González García • Edited

Thank you! Glad that you enjoyed it! :D

There's different ways in which to get that Go To Definition working:

  1. The "native" way to do that in vim is through the use of tags as you say. There's a great article in this years' vim advent calendar that gives some great pointers
  2. The alternative way to do it is through plugins that support LSP (Language Server Protocol) or something similar, and can understand your code at some level, many of these plugins double as autocompletion and code navigation tools. Some examples: ALE, CoC, some sources of Deoplete, etc. I don't yet have a favorite and I'm still investigating this area.
Collapse
 
vonheikemen profile image
Heiker

Thanks. Now my workflow is complete.

I will go with the file watch approach to update the tag file. It will give me a good excuse to use this utility. It will be enough 90% of the time, for the other 10% I'll jump back to Sublime text.

Collapse
 
antonrich profile image
Anton
Collapse
 
vintharas profile image
Jaime González García

:O

Collapse
 
antonrich profile image
Anton

I guess my dip is dvorak (note that only used vim to a point where learn the four keys to move around and that was in a game). I love dvorak so much that I don't want to switch to anything else (tried recently colemak).

I feel like this will make things harder for me.
Do you have any recommendations on that?

Collapse
 
vintharas profile image
Jaime González García

Hi Anton! _^

TBH I don't know :)

If you take a look at the vim keybindings it does look like some of them were placed where they are with QWERTY in mind, particularly the basic motion keys under the right hand on the home row. There's also keys that are somewhat associated with each other and are colocated within QWERTY. F.i. ; and , or f and t or d and c, w and e. Other than that there's motions and operators spread all over the keyboard.

I think that you should be able to get accustomed to using vim regardless of where they are located within a keyboard as long as your hands rest in the home row where they can reach all the keys. The most important thing is to spend some time practicing so that moving around, using operators, etc becomes natural and you no longer need to think consciously about it. Try starting with a small set of motions and commands and see if you can get comfy with them and then decide :D

This is just an opinion though, I think we need to find a vim dvorak user to enlighten both of us :D

Collapse
 
eleftrick6 profile image
eLefTrick6

I've used vim for years and it was great to learn some new things I wish I knew earlier. Thanks!

Collapse
 
siatwe profile image
Simon Weis • Edited

Informative article, I've been using Neovim for about a year now and have just learned a lot again.

Collapse
 
vintharas profile image
Jaime González García

Awesome! Stoked that you found it useful! 😀

Collapse
 
qm3ster profile image
Mihail Malo

@vintharas ? More like @vimtharas

Collapse
 
vintharas profile image
Jaime González García

🤭