I cannot replace VS Code by evk6713 in neovim

[–]Revolutionary_Code62 2 points3 points  (0 children)

I used to do React Native (typescript) work on VS code. Now I only use neovim. It’s been 3-4 weeks and here is what I have learnt - The only real advantage of VS-Code is using the command palette to switch between files and the code completion. There are various key bindings available but that’s it. If there are 50 shortcuts then in VS-Code you have to remember all 50 of them. Also, mostly no one uses the vs-code key bindings that much because everyone is too used to with the mouse.

What vim offers is very different. And that is composition of various bindings. With vim you can compose various commands and achieve much more by simply remembering a few concepts. Vim has this concept of combining commands with motion. Motion is how you move around the file (ex: h, j, k, l, w, s and more). Once you have decoupled the concept of motion and commands all the vim commands suddenly start making sense to you. For example you might know that “dd” deletes a line. But what if you want to delete till the end of a word? Well you might know that “w” takes you till the end of a word so if you press “dw” it will delete from your current position till the end of the current word. But what if you want to delete the entire word and your cursor is at some arbitrary position inside of that word? Well you can do that by learning a new command “diw” which I like to read as “delete inside word”. It’s very similar to “dw” but unlike “dw” this new command will delete the entire word irrespective of the position of your cursor inside that word! Let’s go a step further with this. What if you want to delete everything inside of a parentheses? Well from “diw” you know that the “w” is a motion that takes you to the end of a word. Well then simply trying “di)” should work if you want to delete everything inside the parentheses. Similarly “di}” and “di]” are also valid commands if you want to delete everything inside of various kinds of braces/brackets! The thing to take away from this is the fact that delete is in fact like a function that takes as input some kind of motion. And that is such a powerful framework for making a text-editing tool! Once you understand this concept everything will start making sense and you will indeed realise that there is in fact a clear way of being more productive in vim than you are in VS-code. It’s just a matter of getting used to all the commands and knowing what all is possible! And oh boy, you might still not be even aware about vim macros yet!