Two things that helped me more than anything with "learning" vim and or ever wanting to use it: 1. Remap your "capslock" key to "escape." Vi was written using an ADM-3A terminal and its keyboard, which you can see here: https://catonmat.net/why-vim-uses-hjkl-as-arrow-keys has the escape-key in a sane place. On modern keyboards, if you can, remap "capslock" to "escape" when pressed alone, and "ctrl" when pressed with…
> Remap your "capslock" key to "escape." I hear this recommendation a lot. You can do that, but much better is to get a keyboard with a proper thumb cluster like a kinesis[1], maltron[2], dactyl[3], ... Much better to put such a common key on the thumb than stress out a pinky. I have a kinesis, and have esc mapped to the 'end' key there; similar positioning is possible on other keyboards. The keyboards I linked are a…
Learn Vim (the Smart Way): a book to learn the good parts of Vim
101–110 of 134 posts
Re: Learn Vim (the Smart Way): a book to learn the good parts of Vim
#102Earlier quoted context omitted.
No, I use them with the f and F keys. They repeat the previous character search in forward and backward directions.
I find rhysd/clever-f [1] to be more DWIM than Vim's default f/F. " 0: F is backward search, and repeating f after F searches in the same direction " 1: F is backward search, and repeating F after F searches in the same direction let g:clever_f_fix_key_direction = 1 [1] https://github.com/rhysd/clever-f.vim
I think a lot of people who use vim end up with a ton of unnecessary plugins and they aren’t even aware of half the functionality of plain vi. I might just be a weird minimalist though.
Re: Learn Vim (the Smart Way): a book to learn the good parts of Vim
#103Earlier quoted context omitted.
On Linux and Mac it’s possible to have caps be escape when pressed alone or control when pressed with another key. On Linux the software is called xcape. :)
On Mac, there is Karabiner-Elements. https://karabiner-elements.pqrs.org/
Re: Learn Vim (the Smart Way): a book to learn the good parts of Vim
#104I'm not trying to be contrarian here, but why would someone continue to use Vim and Emacs when all of its lovely features have been integrated into products like VCode? It just reminds me of serious men with beards working on mainframes and AIX power systems when I started my career.
Sure, I use VSCode and Intellij and all the beautiful modern IDEs. But I use them with Vim keybindings turned on. Because extremely common things that you do while programming are extremely quick for me to do with vim commands. ci" == delete everything within these quotes, and put me in insert mode. vi{:%s/old_var_name/new_var_name/g == rename a variable within a block qaI" A", jq == make a new macro to quote a line…
Re: Learn Vim (the Smart Way): a book to learn the good parts of Vim
#105Earlier quoted context omitted.
That's interesting. I'm a bit spoiled by primarily using Vim to write code and prosé in American English. Vim's digraph feature (Ctrl-K by default) has handled unicode char input nicely enough for me, but I wonder if the compose key could be of use when writing text in Japanese for example.
I actually meant to do it systemwide, for when you're writing or googling things not in English, or when you want to write a fancy ⅝. The day I have to start putting diacritics into computer code is the day I quit programming:) I think it's no good for Japanese, but I know very little about Japanese input. Romanji is still Japanese, right?
Re: Learn Vim (the Smart Way): a book to learn the good parts of Vim
#106Two things that helped me more than anything with "learning" vim and or ever wanting to use it: 1. Remap your "capslock" key to "escape." Vi was written using an ADM-3A terminal and its keyboard, which you can see here: https://catonmat.net/why-vim-uses-hjkl-as-arrow-keys has the escape-key in a sane place. On modern keyboards, if you can, remap "capslock" to "escape" when pressed alone, and "ctrl" when pressed with…
I think this is a bad idea because remapping keys has significant consequences with compatibility as you develop across more platforms. A good vi user is trying to build universal muscle memory, and making personal exceptions kinda ruins the efficacy of the editor. For example: I switch between dozens of computers, some are transient VMs or cloud instances, and I cannot afford the time (or simply cannot alter the sys…
Re: Learn Vim (the Smart Way): a book to learn the good parts of Vim
#107For the vim enthusiasts reading, I'd like to bring to your attention some other resources released in the last few months — ThePrimeagen (YouTube): https://www.youtube.com/channel/UC8ENHE5xdFSwx71u3fDH5Xw — Vim Tricks (newsletter/Twitter): https://vimtricks.com/ — and humbly, myself, Semicolon&Sons: https://www.youtube.com/watch?v=futay9NjOac&list=PLpkoC9yJXD...
Re: Learn Vim (the Smart Way): a book to learn the good parts of Vim
#108I started Vim when the internet went out once and, bored, I finally tried `vimtutor` on the debian command line. It just opens vim to a txt file that incrementally explains how to make basic edits. I was instantly hooked when I realized how much time "o" and "O" alone would save me over. I almost never use Vim these days because I was too lazy to port my .vimrc + Vundle plugins to a new laptop at some point, but I us…
Re: Learn Vim (the Smart Way): a book to learn the good parts of Vim
#109Two things that helped me more than anything with "learning" vim and or ever wanting to use it: 1. Remap your "capslock" key to "escape." Vi was written using an ADM-3A terminal and its keyboard, which you can see here: https://catonmat.net/why-vim-uses-hjkl-as-arrow-keys has the escape-key in a sane place. On modern keyboards, if you can, remap "capslock" to "escape" when pressed alone, and "ctrl" when pressed with…
ctrl-[ is escape in terminals by default.
It’s often easier to map caps to ctrl than escape when pressed and ctrl when held. Most OSs support that without extra software.
Even in Vim it’s still very useful to have a convenient ctrl key. A lot of useful features make use of Ctrl in Vim.
On remapping leader:
Remapping to spacebar means your thumbs are dedicated to that operation. That’s more balanced left-right for touch typing.
Also you get to keep the default behaviour.
Re: Learn Vim (the Smart Way): a book to learn the good parts of Vim
#110Two things that helped me more than anything with "learning" vim and or ever wanting to use it: 1. Remap your "capslock" key to "escape." Vi was written using an ADM-3A terminal and its keyboard, which you can see here: https://catonmat.net/why-vim-uses-hjkl-as-arrow-keys has the escape-key in a sane place. On modern keyboards, if you can, remap "capslock" to "escape" when pressed alone, and "ctrl" when pressed with…
Die hard vimeleon here. IMHO chording the 'j' and 'k' keys simultaneously [1] is a severely underutilized solution for escape. Try it. You'll love it. If you're going to rebind capslock to something — and this is particularly true if you're on macOS — rebind it to backspace. Capslock escape isn't useful outside of Vim. Backspace is useful everywhere, including inside Vim. [1] https://github.com/kana/vim-arpeggio
Also ctrl-h is backspace so mapping caps to ctrl gives you a convenient escape and backspace shortcut.
(It also gives you a heap more terminal shortcuts but that’s another story).