Earlier quoted context omitted.
Plug for Karabiner on OS X, which lets you use capslock as a control if you press it with another key, and escape if its released on its own. It has ruined me for other computers that don't have this set up. There's also a way to do it under Linux, but I can't remember what the package is that lets you do that.
You're thinking about xcape: https://github.com/alols/xcape . FYI, Karabiner is incompatible with MacOS Sierra. There's a project (Karabiner-Elements) to replace its (and Seil's) functionality, but I don't believe it has feature parity yet: https://github.com/tekezo/Karabiner-Elements
Vim Anti-Patterns
241–249 of 249 posts
Re: Vim Anti-Patterns
#242Earlier quoted context omitted.
Pretty funny. I found myself asking "What does C-x do when autocompleting?" I took the 'x' literally, instead of realizing you meant C-n, C-p. xD
x is literal. For context aware auto complete of a word try C-x C-n/p. For a line try C-x C-l. For a directory do C-x C-f. And remember that this is context aware, you can hammer C-x C-n C-x C-n or C-x C-l C-x C-l. Stuff is really powerful. Changed the way I program and I never see enough articles mention it.
CTRL-X Subtract [count] from the number or alphabetic character at or after the cursor. {not in Vi}
After trying again today, I could not find any thing on context-aware completion no matter what help commands I tried. And I can usually find what I'm looking for there.
When I tried C-x in insert mode a couple of days ago, I'm not sure how I missed the: "-- ^X mode (^]^D^E^F^I^K^L^N^O^Ps^U^V^Y)" string that appears in the mode line. Perhaps I saw it and didn't grasp what it was.
I'm always amazed after so many years of using vim how many new things there are to learn about it.
Re: Vim Anti-Patterns
#243Earlier quoted context omitted.
Pretty funny. I found myself asking "What does C-x do when autocompleting?" I took the 'x' literally, instead of realizing you meant C-n, C-p. xD
In insert mode, C-x actually lists the different completion methods, so it's actually accurate. ^X mode (^]^D^E^F^I^K^L^N^O^Ps^U^V^Y) I really like having C-x C-f, which autocompletes file names.
Re: Vim Anti-Patterns
#244"Hitting Escape is usually unnecessary; Ctrl+[ is a lot closer, and more comfortable." I agree with a lot of the things in this article, but wow, I could not possibly disagree with this quote more. Ctrl+[ is WAY more uncomfortable than using the Escape key. Granted, I have many years of vim usage that have made hitting Escape a habit, and that probably plays a big part in it, but Ctrl+[ is downright painful for me (a…
> I could not possibly disagree with this quote more. Ctrl+[ is WAY more uncomfortable than using the Escape key. Did you try it with one hand or two. I do it by using my left pinky on the ctrl key and my right pinky on the [ key. In general, I've always tried to stick with the touch typing convention where you use the modifier key on the opposite side of the keyboard relative to the key you press. For example, I wil…
^^ was this supposed to be a joke? (I laughed at first when I thought you meant stretching the left hand between the left CTRL key and the [ :-D ).
I guess I could see someone trying to type it one-handed with their right hand, but I would have never even have thought to do that (and I don't know that I ever use the right CTRL key anyway).
Outside of the CTRL keys, I touch type pretty much everything normally, with very few exceptions (like using my ring finger on Escape). I find moving my right pinky to the right CTRL key to be very uncomfortable, so I just always use the left CTRL key.
Re: Vim Anti-Patterns
#245"Hitting Escape is usually unnecessary; Ctrl+[ is a lot closer, and more comfortable." I agree with a lot of the things in this article, but wow, I could not possibly disagree with this quote more. Ctrl+[ is WAY more uncomfortable than using the Escape key. Granted, I have many years of vim usage that have made hitting Escape a habit, and that probably plays a big part in it, but Ctrl+[ is downright painful for me (a…
ctrl+[ is closer but with an already over-used right pinky it is a bad idea. i much prefer jk as .
xD
Re: Vim Anti-Patterns
#246Earlier quoted context omitted.
Ahg, no I couldn't do that, I need to keep J as Join lines. That's pretty useful to me. Kinda the inverse of gq.
Ah, I bound join lines to :join since I don't use it that often. I still encourage you to try binding something to 7j (or whatever number of j's feels right). One of the best shortcuts of my life.
The advantage of using J and K is that they're very vim movements, but if can't because of :join, another workaround would be to use and since they're redundantly bounded to and :
nnoremap 7j
nnoremap 7k
vnoremap 7j
vnoremap 7kRe: Vim Anti-Patterns
#247Earlier quoted context omitted.
> I could not possibly disagree with this quote more. Ctrl+[ is WAY more uncomfortable than using the Escape key. Did you try it with one hand or two. I do it by using my left pinky on the ctrl key and my right pinky on the [ key. In general, I've always tried to stick with the touch typing convention where you use the modifier key on the opposite side of the keyboard relative to the key you press. For example, I wil…
"Did you try it with one hand or two." ^^ was this supposed to be a joke? (I laughed at first when I thought you meant stretching the left hand between the left CTRL key and the [ :-D ). I guess I could see someone trying to type it one-handed with their right hand, but I would have never even have thought to do that (and I don't know that I ever use the right CTRL key anyway). Outside of the CTRL keys, I touch type…
That's exactly what I was thinking of. Years ago, I used to press key combinations like ctrl-c, ctrl-x by moving my left hand away from the home row and using my pinky on the ctrl key and my index finger on the c or x key. I thought you may have been doing something like taking your right hand off the home row and pressing the key combination with your thumb and index finger.
But I do find that using the modifier key on the opposite side of the keyboard requires less contortion for a given key combination (e.g., the shift-v or ctrl-v combinations for linewise or blockwise visual mode).
Re: Vim Anti-Patterns
#248Earlier quoted context omitted.
I don't want vi modality. I find it more annoying than emacs yoga-esque bindings. I want more sane emacs bindings.
You can make them yourself, and I think there are some packages for that as well.
Re: Vim Anti-Patterns
#249Earlier quoted context omitted.
I would go nuts; I prefer to use the whole screen to see what I'm looking at, and if I've just searched a buffer for a function name or whatever, there's a good chance I want to see the whole function and not the (screen height / 2) lines above it. (In emacs this is done with `C-l C-l`, in vim it's `zt`) While scanning a buffer for some pattern I'll quite often make a one-off keyboard macro that searches for a patter…
Oh guys, thank you so much for new food for my vim-addiction. I'd hesitate to call myself anything but an interested beginner, so it's always very welcome to learn new stuff. I distinctly remember running vimtutor the first time as a teenager fresh of whatever Windows came before and thinking 'goddamn, whyyyyyy is this hot mess so popular among my mentors and idols?'... Quite some years later, I don't think I could e…
Then I realized I could do y6k to pull the next six lines, rather than "told on, let me count/do the math on the line numbers". Took me another moment to realize "4j" is the way to move.
I think I'm going to like this.