Hacker News new | ask | show | jobs
by worksonmine 1171 days ago
If that's your motivation it could still be useful. Almost every live coding interview I've had so far has a part where I'm explaining the magic tricks I'm performing in vim. I have to remember to slow down and explain my thoughts as I zip through the code or they will just see code moving around the screen.

For me it's mastery of my toolbox. Understanding vim pushed me further down the rabbit hole and now my computer works for me. If I help anyone my palms get sweaty as they scroll scroll scroll through the code, but I keep it to myself and remember to breath. Maybe I could do some leetcode (whatever that is) while waiting?

1 comments

That's something I can do with vim emularion too right?

Part of motivation of the switch was getting a lean environment that doesn't hog resources.

No not really. Granted I've never used any of the emulators (outside of firefox) but vim is so much more than handy keybindings for editing text. It's difficult to explain and has to be experienced. And even if the integration is 1:1 it won't help with resources so I don't see the point.

Resources was my only motivation when I made the switch, had to because everything was electron and my laptop couldn't handle it. Now I'm a few years in and whenever I get tired of doing something repetitive I create a keybinding to perform that action.

A recent example is take the current filename (%) remove the extension (:r) and run it with valgrind to monitor memory usage. Bind it to <leader>vg and it looks like this:

  nnoremap <leader>vg :!valgrind ./%:r<CR>
When I hit it in the file 'my-program.c' it runs 'valgrind ./my-program' and I get the output in the built-in terminal. Very simple example but shows how easy it is to add any command-line tool you want without reaching for plugins, and integrate into your workflow instead of inheriting someone else's. Any command and combination of keypresses can be turned into a keybinding.

I understand it's not for everyone, but comparing it to vscode and judging from that perspective is missing the point entirely. I don't type letters when I edit code, I execute and compose commands, it's a different mindset.