Live data from Hacker News

Ask HN: How to become good at Emacs/Vim?

news.ycombinator.com

11–20 of 84 posts

Re: Ask HN: How to become good at Emacs/Vim?

#11
I think it was just sheer repetition. I had to switch back to VSCode a few times a week to be productive on a time crunch but other than that I just had the mouse enabled and scrolling and tried to not use the mouse as much as possible. I would often tweak my config to find more intuitive key bindings that I could remember.

My view is that it’s just like learning a language (albeit easier) and you just need to give yourself space and time. Structure is good, but can also be overwhelming in the sense that you try to min max like vim pros from youtube. I just found that I would take it in digestible pieces and build on that. First it was jumping lines, then changing inside or around, and so on and so on.

Re: Ask HN: How to become good at Emacs/Vim?

#12
I use emacs with evil and been using it for over a decade now. However, I use VSCode for web development and Rider for game development as the integrations are superior with vim extensions for those IDEs. What you are looking for is a set of principles that make theses editors better. You can take baby steps towards it and 1 - 2 weeks is very limited time if you want to change your editing style (It's like learning a new language).

1. Modal editing (VIM / Evil): Install vim extension pack[1][2][3] for VSCode. This should give a good starter pack.

2. Practice:

   - Disable the arrow keys using keymapping in VSCode or with a keyboard customization (s/w or h/w).
   - Disconnect the mouse
   - Practice long writing / code editing sessions where your productivity doesn't matter. You are learning.
   - Start with simple navigation (hjkl, go to line)
   - Use numeric prefixes
   - Begin using text manipulation commands (yi" or di> for  example)
   - Use normal mode keys for window navigation (spc + w + h for example)

   Once you get comfortable with this you should already see a decent leap in comfort/experience and almost zero mouse usage.
3. Next install emacs with a configuration repository[4]. Most of your practice in VSCode vim should apply almost directly.

4. With emacs, you have a vast operating surface. You can choose to use it just as your editor or you can use it as an operating system: email, calendering, note taking, calculations, twitter, rss, text based browser, file manager, http request playground etc. Org mode is essential emacs experience. You can add the rest of them very slowly

[1]: vscodevim.vim: https://marketplace.visualstudio.com/items?itemName=vscodevi...

[2]: vspacecode.vspacecode: https://marketplace.visualstudio.com/items?itemName=VSpaceCo...

[3]: vspacecode.whichkey: https://marketplace.visualstudio.com/items?itemName=VSpaceCo...

[4]: doom emacs: https://github.com/doomemacs/doomemacs

Re: Ask HN: How to become good at Emacs/Vim?

#13
What converted me to vim was understanding that the commands are composable. For instance: the d key is used to delete, and de deletes to the end of word. But it doesn't end there. Typing t followed by a character goes to the next instance of the character in the current line, so if you type dt followed by that character it will delete everything just before it. If you play around with different commands, and practise navigating through a file this way, it's only one step to editing a file in the same way you navigate through it.

Re: Ask HN: How to become good at Emacs/Vim?

#14
If you merely want to internalize the vi movement keys, play a round of hunt (part of the bsdgames package on Linux systems) with some friends or colleagues on your local network.

Vscode also has vim keybindings available.

Re: Ask HN: How to become good at Emacs/Vim?

#15
A couple of suggestions (in no particular order, and from an ex-Emacs/Xcode/Jetbrains/VSCode and current nvim user):

1. Don't. There's no need to 'switch'. There are marvellously 'productive' developers using every editor under the sun, and neither the quality nor quantity of their work is strongly related to their choice of editor. There are world-class developers who do everything in a vanilla Sublime Text. Others who have a fully tricked-out emacs who dream in org mode. Some use a mouse in one hand and do keyboard shortcuts in the other. None of it matters much. Ignore antiempirical self-attestations to the contrary - they're entertaining but informationally worthless. If self-attestations were relevant, then everything (from quack medicines to cult healing methods to levitation) would be true, because everything has more utterly self-convinced dataless self-attestations than you could absorb in all a bodhisattva's recalled lifetimes. [all scare quotes intended].

2. Do. Emacs and vim/nvim are great and will serve you well if one matches your preferences. Pick one using your preferred criteria, and commit to it for a period. Your 1-2 weeks just isn't enough - I'd say 2 months at least. Put that commitment in your calendar. If it slows you down too much for practicality to start with, limit its use (to an an hour a day, or to a side project), but stick with it for the full period regardless. In the first week or two, go through enough basic tutorials to be able to do essential editing with their basic keybindings without plugins. With reasonable fluency established, just keep a note in which to jot down what's missing compared to your IDE, and pick them off, one-by-one, over time. Sort the list once a week to keep it fresh, and just pick the next item to configure/learn. Get fluent with each new item before moving on to the next.

Re: Ask HN: How to become good at Emacs/Vim?

#18
>How did you become good at using these editors? Just using them doesn't really work because by myself I'd never discover most of the features and keybindings.

I used Vim (GVim to be specific) as part of my job in a semiconductor industry. Everybody in our team used it and we'd help each other. My recollection is not 100% sure, but I think nobody knew how awesome user manuals were (start with vimtutor and then go through `:h usr_toc.txt` https://vimhelp.org/usr_toc.txt.html a few times).

I've also collected a list of Vim resources here: https://learnbyexample.github.io/curated_resources/vim.html

For Emacs, check out https://www.emacswiki.org/emacs/SiteMap

Re: Ask HN: How to become good at Emacs/Vim?

#19
Read the book Practical Vim. It’s not worth using Vim without it. Don’t trust Vim users who haven’t read it, unless they’re Tim Pope.

At least 75% of Vim users I’ve encountered don’t know Vim well enough to justify their using it. Most users stop at vimtutor and are left without the knowledge of the terrible nightmare of Vim knowledge you need to get close to useful editing.

Also keep in mind Vim is a text editor, not a code editor. IDEs are incredibly more powerful than Vim for code editing.

Post reply on HN