Vim Anti-Patterns
11–20 of 249 posts
Re: Vim Anti-Patterns
#12Useful stuff. I'd add typing J to move the next line to the end of the current line. A move I normally do by being on the next line and then type 0dwiBackspace. Only just figured that one out by mistakingly having the capslock on when moving around.
Re: Vim Anti-Patterns
#13> "If you have to move more than a couple of lines, moving one line at a time by holding down j or k is inefficient." This very point is actually why I moved from Vim to Emacs years ago. After mastering Vim, I realized that Vim strongly encourages you to think a little too much about exactly how to get there or do that thing in the fewest keystrokes, and that it's incompatible with muscle memory. Even years later, I…
I feel like with every editor, it involves repeatedly hitting J, Ctrl+N or down arrow, which is inefficient. Do you have a way to get to a particular line that does not force you to think too much about how to get there ?
Re: Vim Anti-Patterns
#14I have a programmable keyboard, so I just map escape to be right above tab, where tilde usually is.
I use Karabiner + Seil to make my Macbook Pro's Caps Lock be Escape when hit by itself and Control when hit with another key. Unfortunately this doesn't work on Sierra yet so still on El Cap.
This is built-into my Lenovo Carbon X1 (gen2) keyboard, drives me bananas as I use tilde quite a bit (being home on linux): http://www.lenovo.com/images/gallery/1060x596/lenovo-laptop-...
What kills me more though is that "Shift" is now caps-lock if you double hit it (because home/end are where capslock normally is). The standard way I wake up a machine when it's locked/asleep/blanked? Tapping the left shift key a few times. ergh.
Should get a gen3, they reverted to a more sane keyboard layout.
Re: Vim Anti-Patterns
#15I have a programmable keyboard, so I just map escape to be right above tab, where tilde usually is.
Re: Vim Anti-Patterns
#16> "If you have to move more than a couple of lines, moving one line at a time by holding down j or k is inefficient." This very point is actually why I moved from Vim to Emacs years ago. After mastering Vim, I realized that Vim strongly encourages you to think a little too much about exactly how to get there or do that thing in the fewest keystrokes, and that it's incompatible with muscle memory. Even years later, I…
Just a question of practice, I found. I was a regular vim user in the past, and this was my criticism of in when first starting out - but after a while I found myself unthinkingly coming up with surprisingly complicated sequences of keypresses. It's possible to get very good at subconsciously sizing up editing operations. These days I use emacs, and I pretty much always move the cursor using the mouse.
Re: Vim Anti-Patterns
#17This is a great resource, but the article is pretty strict on the arrow keys. I would recommend `nnoremap`, over `noremap`, because it only disabled the arrow keys in Normal Mode. The author's explains his rationale in the next section, it's to prevent users from living in Insert Mode. Fair enough. But, when making several relatively close edits, the ability to tap a few arrow keys in Insert Mode is far easier and le…
I'd also add that if you remap Esc to something more manageable, leaving insert mode for a second to move around starts feeling a lot more natural. I still do get where you're coming from, the arrow keys do have a time and place. But since I do all of my moving around in normal mode, leaving insert mode to do it just 'makes sense' now and I really don't even have to think about it.
Re: Vim Anti-Patterns
#18Re: Vim Anti-Patterns
#19Re: Vim Anti-Patterns
#20I can easily without leaving home row move a few letter to the right or back with hl or f and F. but things started to get a lot more fun when you realize that Vim is a programming editing language and it's beauty is in the commands. This leads to amazing things that I hated before, such as deleting 2 words back from my current position would simple be d3b. instead of shift+ctrl+left arrow x 2 + delete.
Overall it's been about 2 months since I've started using EVIL mode for Emacs and I love it. I'll stand by the saying that Emacs is a great OS and vim is a great for editing text in it's modal editing.
lastly modal mode really felt powerful only after I had re-mapped my CAPS key to ESC. I mean throughout the past decade I don't think I've even used Caps for anything. so I've remapped the machines I work on the have caps as esc.
- for those that think it's not reasonable to do so and the whole point of using vim is so that you can edit machines via ssh then use vim on that machine, my suggestion is to use tramp in Emacs with ssh or plink to get to the server and edit (you will still have the local caps to esc key mapped)
TL;DR - Vim modal editing is amazing and feels has straining than other editing layouts - IMO.