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…
Learn Vim (the Smart Way): a book to learn the good parts of Vim
121–130 of 134 posts
Re: Learn Vim (the Smart Way): a book to learn the good parts of Vim
#122I recommend swapping your left CTRL and ALT keys when using vim, as well as CAPS and ESC to avoid RSI. Also, the dot operator is king.
Re: Learn Vim (the Smart Way): a book to learn the good parts of Vim
#123I partially learnt Vim some 20 years ago, but at some point stopped taking in new commands (possibly for lack of repetitive use), and am stuck in a sort of 'good enough' zone, but still awkward for certain things; the ctrl-c/v thing always throws me as I use windows primarily, gvim makes it easy to cheat using the GUI, so I do. Macros are amazing, but I feel there are probably easier ways of achieving most of the thi…
You get over it if you use it enough. For me its now the opposite. For a while I keep accidentally trying to do Ctrl+C/Ctrl+V, but now I find myself trying to go into Visual mode or Normal mode in programs that dont support that. I started off with a bunch of mappings, then you can remove them as you get comfortable. Now I only really have mapped "nmap H :nohlsearch " and "xmap S :sort ". Whats really tricky is using…
H and L are just about OK for left and right, but up and down being another left/right positioned key combo, nestled in between, just doesn't work with the way my brain's wired, at all.
Conversely, on my MacBook Air keyboard, the arrow keys are nicely grouped together in an inverted T formation at bottom right corner of the keyboard, with some space around them. Piss-easy to find and piss-easy to feel which one points in which direction, without even looking at the keyboard.
Strange that almost every tutorial on Vim I've ever read begins with "Don't be tempted to use the arrow keys instead of HJKL.." which, in my opinion is just about the "worst advice evarrr!", especially given the rest of the learning curve which awaits you.
*YMMV --depending on your own particular keyboard layout.
Re: Learn Vim (the Smart Way): a book to learn the good parts of Vim
#124But, any time I'm working on something more than a single doc [eg. a website, or a coding project] I reach for something else. I've just never been able to find a way to use Vim comfortably in a multi-document project, without feeling like I'm being a lot less productive than I would be using a GUI, such as TextMate with its built-in project file browser and excellent project wide find/replace.
I'm learning Flutter at the moment and just got into using IntelliJ [in its Android Studio guise] and, at first I installed the IdeaVim plugin, thinking this would give me the best of both worlds; the speed of moving about within single documents of Vim, combined with the project management & code completion capabilities of a dedicated IDE. I ended up disabling it after a couple of days. The mental context switching caused by jumping back and forward between keyboard driven and menu driven operation was just slowing me down, rather than speeding me up.
As an aside: I don't really get why the "Vim saves you having to hunt for menu items" mantra is still so prevalent in this day and age anyway. Maybe in the past when people had to reach for their mouse to find a menu item, it was a valid point in Vim's favour. But a lot of us are working on laptops these days and, frankly, accessing a menu item by tapping on a trackpad right under your fingers is hardly more hassle than recalling some arcane keyboard incantation to do the same in Vim. Plus, most regularly used menu items have keyboard shortcuts which pretty soon become muscle memory anyway. I've not needed to use a menu to access an Open / Close / Save / Save As / Print / Copy / Cut / Paste / Find / Replace / Undo / Redo / Quit... etc. etc. command in decades.
Re: Learn Vim (the Smart Way): a book to learn the good parts of Vim
#125I'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.
Re: Learn Vim (the Smart Way): a book to learn the good parts of Vim
#126Two 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…
Re: Learn Vim (the Smart Way): a book to learn the good parts of Vim
#127Earlier quoted context omitted.
You get over it if you use it enough. For me its now the opposite. For a while I keep accidentally trying to do Ctrl+C/Ctrl+V, but now I find myself trying to go into Visual mode or Normal mode in programs that dont support that. I started off with a bunch of mappings, then you can remove them as you get comfortable. Now I only really have mapped "nmap H :nohlsearch " and "xmap S :sort ". Whats really tricky is using…
HJKL makes no sense for me at all. It reminds me of the annoyingly designed computer games I used to play on my Oric as a kid, where the various direction keys to control my 'character' often bore no relation to their relative positions on the keyboard. H and L are just about OK for left and right, but up and down being another left/right positioned key combo, nestled in between, just doesn't work with the way my bra…
I guess the thinking is, if you open up some existing document, youre already at the top, so the more important key is going down, which the "J" sits right under your index finger.
I totally agree that its awkward, but I also feel that if you can get good with it, youll be way faster than using the arrow keys. Think about it like this: with the arrow keys, you must move your hand. With HJKL, you dont have to move your hand from the home row.
Re: Learn Vim (the Smart Way): a book to learn the good parts of Vim
#128Earlier quoted context omitted.
I'm personally a fan of remapping jk or jj to esc, there barely any instances in the english language where you would use those two letters together, and it means you can leave insert mode whilst barely moving your hands :D
I tried mapping both jk and kj to Esc for a while (so I could just mash them in any order), but the slight delay it added to the letters always threw me off my loop.
Re: Learn Vim (the Smart Way): a book to learn the good parts of Vim
#129Earlier quoted context omitted.
HJKL makes no sense for me at all. It reminds me of the annoyingly designed computer games I used to play on my Oric as a kid, where the various direction keys to control my 'character' often bore no relation to their relative positions on the keyboard. H and L are just about OK for left and right, but up and down being another left/right positioned key combo, nestled in between, just doesn't work with the way my bra…
I agree that HJKL is really uncomfortable for a new user. I still reverse J and K sometime, as my brain thinks "the first key should be Up". I guess the thinking is, if you open up some existing document, youre already at the top, so the more important key is going down, which the "J" sits right under your index finger. I totally agree that its awkward, but I also feel that if you can get good with it, youll be way f…
I can type pretty fast, though I've never actually measured my WPM speed. But I'm not a touch typist --I still have to look at the keys-- and I don't type 'properly' using all my fingers. I seem to get by with the first three on each hand. So there's no real advantage for me in having my fingers resting on the home row. In pauses for thought [my equivalent of resting on the home row] I usually find I'm waiting with the heels of my hands on the empty space below the keyboard, either side of the trackpad and my fingers just kind of very lightly touching the keys, wherever they happen to fall.
From that position, it really is far more convenient for me to just curl in the fingers of my right hand , which puts the inverted T of the cursor keys right under my finger tips and which I can do without looking, than it is for me to look down at the keys to find HJKL.
Re: Learn Vim (the Smart Way): a book to learn the good parts of Vim
#130FZF(and its vim plugins) really leveled up the game for Vim.
As well as neovim and LSP.