7 ms·
Some thoughts on CAPSLOCK remapping: After using vi / vim since 1986, I finally remapped CAPSLOCK to CTRL at the operating system level. It's made a world of d
by sstanfie 13y ago
Some thoughts on CAPSLOCK remapping:
After using vi / vim since 1986, I finally remapped CAPSLOCK to CTRL at the operating system level. It's made a world of difference, and not just for vi. It easily unlocks all the EMACS style cursor movements like ctrl+A, ctrl+E, etc.
Yeah, I know you can do it with the CTRL key in the lower left. But if you move from Mac laptop with Fn key in lower left, to an external keyboard with no Fn, you're gonna have a bad time.
But here's another reason why I advocate this approach. Remember vi was written by Bill Joy back in the 1970s. Back then, the early terminals had the control key right there next to the A. In fact, the CAPSLOCK was to the left of that!
I was recently at the Computer History Museum in Mountain View where you can see some of these early terminals. A lot of us know the Happy Hacker Keyboard, with the control key at it's rightful place. But to see it on the old terminals, it's a pretty good archeological insight into why it just feels right.
Plus, WHO USES THE CAPS LOCK KEY ANYWAY EXCEPT FOR SHOUTING IN FORUMS?
- Dobbs 13y agoCaps as control makes a lot of things very nice. Including hitting the "ctrl+[" which is the escape code for "esc". So not only do you have easy access to keys like "ctrl+d" you also get escape.
- quadrangle 13y agoI use CAPS LOCK as my compose key…
- roryokane 13y agoI often use Caps Lock for acronyms, such as HTML, CSS, IntelliJ IDEA, and ad-hoc acronyms for book titles in notes. I do remap Caps Lock to Ctrl when I use Windows, because Windows requires Ctrl for many keyboard shortcuts, but I also make it so that Shift+CapsLock activates caps lock, so I can still use it.
- eru 13y agoCan you use Shift+Ctrl+ then?
- platz 13y agoI swapped CTRL and ALT recently, and mapped CAPSLOCK to ALT. This puts CTRL under the thumb which helps reduce strain I think
- coldpie 13y ago> Plus, WHO USES THE CAPS LOCK KEY ANYWAY EXCEPT FOR SHOUTING IN FORUMS? C identifiers like AUDCLNT_E_UNSUPPORTED_FORMAT.
- edanm 13y agoFunny enough, I just installed a vim plugin that gives a mapping for converting variables between camelCase, snake_case, MixedCase, and UPPER_CASE. The plugin is vim-abolish by Tim Pope. (This isn't really relevant to your post, just funny)
- Crito 13y agoStuff like that is what various completion options are for. Ideally you only type crap like that out once, and for that typing with your left pinky on shift is sufficient for me.
- shocks 13y agoI use smart case autocompletion for this. Ctrl is just so useful, there are only a few reasons to use capslock (imo) and they're just not worth it.
- irahul 13y agoinoremap <C-x>c <esc>bgUWea Type the identifier in lower case, and then <C-x>c(or whatever you feel like mapping it to).
- sstanfie 13y agoOMG that is so cool. I just added it to my .vimrc. Also, two high school juniors watching me try this also verified it's coolness.
- irahul 13y agoinoremap <C-x>c <esc>bgUWea Type the identifier in lower case, and then <C-x>c(or whatever you feel like mapping it to).
- snake_plissken 13y agoi write SQL in all caps...
- dontdieych 13y agoI also recommend capslock as both ctrl and esc. With combination of other keys, It works as ctrl. Otherwise it's just esc. In linux, X11, xcape does it.
- erikb 13y agoI use a Happy Hacking Keyboard which does this remapping in HARDWARE and it is awesome for nearly everything! You never need Capslock, but Ctrl you use all the time and having it basically on the homerow feels great.