Recently, I've realized that I don't really master any editing shortcuts. I'm able to navigate char by char, word by word, end and beginning of the line, as well as selecting text. But nothing more complex.
For any complex file editing, I resort to mouse. I know that JetBrains have tons of shortcuts to help with text editing, Vim has its own as well as Emacs.
Few years ago, I've switched to 60% keyboard (so my arrow keys are on CapsLock+ijkl) and I feel like my typing speed did increase. I'm looking to make a similar improvement in regards to text editing and I'm wondering what should I invest it.
I know that Emacs shortcuts are pretty much universally supported. You can get them in MacOS and JetBrains, you get the in the terminal, and obviously in Emacs (which I used 2 maybe 3 times in my life).
Vim gets more love (from what I see) compared to Emacs, and you can get IdeaVim or even terminal navigation with Vim.
And I feel like mastering JetBrains shortcuts will help with text editing, but only in JetBrains tools.
I'm leaning towards trying to master Vim, but wondering if Emacs might be more useful, since I also write non code related text and use mainly MacOS (which as far as I know, honors most Emacs shortcuts). Mastering JetBrains shortcuts feel the least appealing to me, since I can't transfer that knowledge to other programs.
What are your opinions?
Edit: just to clarify, I'm not looking to switch to 100% Vim/Emacs. I'm instead wondering, mastering which shortcuts, will yield the most benefits for my (code)writing skills. I'm not in the mood to setup vim for code editing, and very much happy with JetBrains tools.
Emacs' hotkeys are like airplane controls, in my imagination. There are lots of them, and they're way less composable than Vim's. And since letters are used for typing, all those keys use various modifiers and their combinations.
Meanwhile, outside of Emacs basically all its keys that you want to know are Ctrl-A and Ctrl-E. Plus Ctrl-W is mostly universally supported, including Vim iirc. I don't even think that these keys are from Emacs originally—maybe readline was before?
I use Emacs for the versatility and the sane scripting language, but in it I use Evil for the Vim keybindings. Plus the Doom configuration maps many functions to sequences of keys instead of hotkeys with modifiers, via the spacebar prefix/menu.
As for the IDE, you will sure want to learn the keys for jumping over the code structure—like going to definitions, hopping to particular functions, maybe a couple basic refactorings. Though IIRC Idea had the ‘shift shift’ thing—a launcher of all kinds of functionally via quick text commands, which makes both some hotkeys and most menus unnecessary, in the style of all-purpose launchers like Alfred.
First step is to not use arrows any more, especially while in insert mode. Put this in your .vimrc (or jet brains equiv):
inoremap nop
inoremap nop
inoremap nop
inoremap nop
Insert mode arrows destroy vim brain.Then, once rid of these broken "training"-wheels learn some of the more advanced motions and operators. https://vim-adventures.com is fun.
The emacs/readline shortcuts are nice in MacOS text fields and in the command line, but there are only a handful I use regularly (^A, ^E, ^K, ^U, ^L). I would use vim-bindings in the shell, but I haven't found a good way to indicate my current mode, so I get confused & don't like it.
Some tips for using vim shortkeys:
* You can install the hardmode plugin of vim, https://vimawesome.com/plugin/hardmode. This will disable the arrow keys, page up/down, and hjkl. This way you can only use the "advanced" vim short keys.
* Vimium is a plugin for firefox and chrome which allows you to browse on the internet using (some of) the vim short keys.
* All insert-mode short keys of vim also work in most terminals. Few people realize the equivalents: ctrl+m <-> enter, ctrl+h <-> backspace, ctrl+i <-> tab, ctrl+[ <-> escape. Control can easily be hit with your left palm. These two things combined saves a significant part of moving your hands. Since I program between 6 to 10 hours a day, these small changes are the difference between RSI and no RSI.
Good luck!
I would specifically define different generic levels of mastery (for example by using examples of your common editing cases) and then start to chip away at the lower levels in each editor. Track your progress. Your studies will be more resilient to adaptation this way.
You may also be able to create bridging-shortcuts that you define in JetBrains and also set up in other editors, or vice versa. Or snippets, maybe you use Espanso in all three for example.
It's always worth diving into this. You already have the forward-looking planning and contingency mindset which you demonstrate for us in your post. Add the execution-experimentation-analysis mindset now. You'll get immediate benefits. The contingency side will still be there when you need it later. Otherwise by giving too much contingency attention too early you can get stuck in a foresee-withhold loop without making any progress or learning anything new.
Good luck and share your results when you can.
The only safest investment in tech is touch typing.
If you regularly log into fresh *nix installs from the terminal that’s a plausible reason to learn Vim.
If you want to live in an editor, that’s a plausible reason to learn emacs…it supports just about every language, email, task management, git, etc.
Emacs key stroke support is more directly supported by other applications, probably because most applications don’t use modal keyboard input by default…don’t have vim like if this then that then that keyboard logic.