News for hackers. Stuff that matters.
Re:How Did Vim Become So Popular? by throwaway8941 on Wednesday July 01, 2020 @12:58AM (#23697886)
Ctrl+arrow is almost as bad as going to the mouse. The thing with vim is you rarely have to leave the home row.

Some other random things I use constantly (I am not the person you're replying to):

C — replace to the end of the line

xp — swap two characters (which I have to use more frequently than I'm willing to admit.)

ci( — replace everything in brackets (like the arguments of a function, this also works with " or ' for strings, { for blocks of code, and so on). The cursor doesn't have to be inside the brackets, it'll jump to the nearest match.

:earlier 10m — time traveling, which comes in handy between commits or with config files, especially if you configure vim to write persistent change history. What did this file look like a month ago? Oh yeah, :earlier 30d

. — repeat the previous command (this is much bigger than it sounds, as it allows you to repeat the same complex manipulation on different data in situations where you can't use multi-cursor, but which don't warrant building a whole macro.)

A ton of custom filetype- and mode-dependent <leader>-based bindings (which is the spacebar in my case). space-space to jump to definition, space-f to reformat the file, that sort of stuff. This can probably be done in vscode.

If you're really interested, there are tons of vim videos on youtube made by real vim pros. I am very far from being one. The best for me are live coding sessions where vim usage is demonstrated by doing the real work, not on some toy examples.

Re:How Did Vim Become So Popular? by RMPR on Wednesday July 01, 2020 @02:20AM (#23698349)
> :earlier 10m — time traveling, which comes in handy between commits or with config files, especially if you configure vim to write persistent change history. What did this file look like a month ago? Oh yeah, :earlier 30d

Another trick to my bag, that's why I absolutely love these threads about Vim.

Re:How Did Vim Become So Popular? by lordgrenville on Wednesday July 01, 2020 @06:05AM (#23699809)
:later also works (hence the joke that you can just hit :later 8h and go home...)
Re:How Did Vim Become So Popular? by jcampbell1 on Wednesday July 01, 2020 @03:15AM (#23698680)
On a Mac at least, ctrl+n/p/b/f/a/e all navigate text without reaching for the arrows, with the added benefit they work in every application. I quit vim because I prefer using a smaller but universal set of navigation that works everywhere from Xcode to VS code to the terminal or typing in Chrome.