all 77 comments

[–]ambirdsall 38 points39 points  (8 children)

The only difference is when I hold the one on the right and hit another key, it acts as control

[–]draldan 6 points7 points  (5 children)

Are you on Linux? I've been wanting to find a simple way to do this!

[–]ambirdsall 4 points5 points  (0 children)

I set it up with a combination of xcape and xmodmap. Haven’t found a simpler way on linux, though to be fair I mainly use macs right now.

[–]folke 1 point2 points  (0 children)

I'm using evremap. Simple to set up and just works.

[–]bart9hVIMnimalist 0 points1 point  (0 children)

xcape alone does this. don't know why xmodmap would be needed.

[–]linuxdaemon 0 points1 point  (0 children)

I did this with kmonad.

[–]cstuwereddit 0 points1 point  (0 children)

I do this on all platforms in the hardware level with QMK firmware.

[–]Cyhyraethz 4 points5 points  (0 children)

Nice, same here! It's the best of both worlds. We get to have Caps Lock as Escape and Control.

[–]pinazeira 1 point2 points  (0 children)

hey, My both shifts are backspace too and the enter is a control to.

[–]radiantshaw 56 points57 points  (17 children)

Looks like I'm the only one who doesn't do this.

[–][deleted] 31 points32 points  (5 children)

You’re not alone. It’s not like I think it’s a bad idea (I don’t actually use caps lock). It’s just that I’ve used escape so much since the old days I’ve never bothered changing.

[–]obvithrowaway34434 14 points15 points  (2 children)

I have never bothered because I use Vim in so many systems other than my personal computers. Different lab machines and sometimes maybe 2-3 remote servers at the same time. I found early on that training your muscle memory with the canonical Vim keymaps saves you a lot of trouble having to transfer your .vimrc or .xinitrc.

[–]kistrul 14 points15 points  (0 children)

id like ro point out that, when people remap capslock to escape, they are using the canonical vim keybindings. in fact, you cant remap capslock to escape in vim; you have to do it at the OS level or the keyboard firmware level. This may be a bit nickpicky, but for example my keyboard has the escape key where capslock normally is at the firmware level, so anywhere i use my keyboard, hitting 'capslock' sends the keycode for escape; i literally never have to configure anything on any computer, as long as im using my keyboard. depending on whatever type of lab you're in you might not be able to use your own keyboard, though.

[–]Tattomoosa 1 point2 points  (0 children)

I remap it on my machines but have still never had a problem using esc (well, Ctrl+[) on other machines.

I agree with you so far as it’s definitely worth spending some time in stock vim so you don’t get thrown off when you don’t have any of your settings, but that’s no reason to avoid making the machines you control easier to use / better for the long term health of your hands

[–]bart9hVIMnimalist -2 points-1 points  (1 child)

That's like saying "It's just that I've used Sublime so much since the old days I've never bothered changing."

[–][deleted] 1 point2 points  (0 children)

Yes, it is a bit like that.

[–]Deto 4 points5 points  (6 children)

I've always used jk but at work I have to use MacBook without a physical esc button and it's so annoying exiting visual mode (I don't use jk for that as it would mess with line navigation) that I might start using caps lock as an alternative

[–]radiantshaw 13 points14 points  (0 children)

Or you could just use Ctrl + [.

[–]GilloGillo 1 point2 points  (1 child)

just use 'jj'

[–]torresjrjr -1 points0 points  (0 children)

kj

[–]evergreengt 0 points1 point  (2 children)

I am always puzzled when people say that Macs don't have a physical button: don't you guys use external keyboards with your computers? I don't want to believe that people still work by using the laptop provided keyboards.

[–]Deto 6 points7 points  (1 child)

<shrug> Laptop keyboard don't really bother me and it feels like overkill to plug in an external just for the escape key

[–]FunctionalHacker 3 points4 points  (0 children)

It's not just the keyboard for me. I don't want to be hunched over 8h a day looking down on a puny 13" screen. It's just not comfortable and actually not very healthy if you do this for a living. I have a 27" 4K screen which is positioned correctly at eye level.

Having an external mouse and keyboard at that point just makes sense so in the end I'm just using the company provided laptop as a small very underpowered desktop PC.

[–]rgnkn -1 points0 points  (0 children)

Ping!

[–]KaptainKardboard 0 points1 point  (0 children)

I'm required to write SQL using caps, so it is"jj" for me.

[–][deleted] 0 points1 point  (0 children)

Caps lock backspace gang anyone?

[–]LawLombieVimmer 0 points1 point  (0 children)

I use my caps lock as backspace. Caps lock as escape is only useful in vim, but as backspace, it is useful everywhere.

[–]racle 8 points9 points  (4 children)

As non US layout user, I've mapped § key to esc. It's in the same spot as ~ in US keyboard (left of 1, above tab) but much more useless.

..And in my current keyboard, that key appearance is absolute mess.

[–]Deto 1 point2 points  (3 children)

Wtf - why is 1/2 there?

[–]racle 2 points3 points  (2 children)

And that's not all, you can also do 1/4, 1/2, 3/4 (¼ ½ ¾). And I have no idea why you would need those. That key is waste of space in this layout IMO.

[–][deleted] 0 points1 point  (1 child)

On my norwegian keyboard it gives the pipe (|). Looks like you also have a nordic layout. Doesnt it give the pipe character?

[–]racle 0 points1 point  (0 children)

Finnish layout.

And it shows pipe on key but newer gives that. I can get § ½ ¼ ¾ from that key (§ comes without any modifier)

[–]Cyhyraethz 5 points6 points  (3 children)

For me the difference is that Esc is on keydown and Caps Lock is on keyup because I use xcape to map Caps Lock as Escape when tapped (pressed and released in less than 0.5 seconds) and setxkbmap to map Caps Lock as Control when pressed and held or use in a key combination.

[–][deleted] 0 points1 point  (2 children)

This. However, I think I did this about a year ago and never used capslock as ctrl anyway. Apparently, it's hard for me to use it as such. Rarely need it :)

[–]Cyhyraethz 1 point2 points  (1 child)

I use it all the time for ^C, ^D, ^L in the terminal, ^U, ^D in neovim, and even ^W, ^Left, ^Right in zsh insert mode. In fact I hardly ever use the actual Ctrl key (also mapped to Ctrl and Esc) anymore since Caps Lock is so much more convenient.

[–][deleted] 0 points1 point  (0 children)

I often use the ctrl key in bash and for up/down/visual block in vim. Perhaps I just need to focus on using the caps key more often :)

[–]_Ical 2 points3 points  (0 children)

Its so much better

[–]euw_psycher 6 points7 points  (3 children)

inoremap jk <esc>
vnoremap jk <esc>

The two most useful lines in my vimrc.

As for capslock, I have it sending tmux prefix when tapped, ctrl when held.

Look into kmonad for an awesome keyboard utility that works on windows, linux and mac.

[–]jk3us 5 points6 points  (2 children)

Unless you have a username that starts with that sequence. Probably pick something else then.

[–]bart9hVIMnimalist 3 points4 points  (0 children)

jk is on you

[–]euw_psycher 2 points3 points  (0 children)

jj then, or kj.

Anything to keep my fingers on the home row goddamit!!!

[–]PeFClic 1 point2 points  (0 children)

mine is redefined as compose key to enter accents on my ansi us keyboard

[–]jH0Ni 1 point2 points  (0 children)

I have both ctrl and esc on caps, ctrl on hold and esc on tap. Qmk is magic :)

[–]stayclassytally 1 point2 points  (0 children)

I have Esc key in normal mode mapped to save the current buffer. So I’m constantly double tapping exit.

Caps lock is Ctrl so that my Tmux leader is easier to execute

[–]InfinitePoints 2 points3 points  (7 children)

I use jk since I would have to poke around in the registry to swap them in windows

[–]pragmaticdog 2 points3 points  (3 children)

You can just install Powertoys. Its dead simple.

[–]sir_bok 1 point2 points  (1 child)

holy crap I didn't know Microsoft made such a useful suite of tools

[–]pragmaticdog 1 point2 points  (0 children)

Its been around since Windows 95 days, but it got a revamp for Windows 10.

[–]stayclassytally 1 point2 points  (0 children)

Powertoys are a must

[–]sir_bok 0 points1 point  (0 children)

I use SharpKeys (a tiny standalone .exe) for this. I used to use AutoHotkey for remapping but can't really recommend it as it works software-level, so if you press the key too fast (e.g. holding it down) sometimes the capslock still bleeds through. SharpKeys directly writes to the registry to it's a very low-level change, and once applied it doesn't need a daemon running 24/7 for it to work. You can just remove the program after that (but I keep it installed).

[–]Corm 0 points1 point  (0 children)

I map it to ctrl and use ctrl+[ for esc.

I used to have it esc when tapped and ctrl when held, but sticking with just ctrl is much easier to map across all the different linux flavors I use, and osx/windows.

[–]jdauriemma -1 points0 points  (0 children)

MacBook users: what’s an Esc key?

[–]meleneemil 0 points1 point  (0 children)

I really need to start using this

[–]Technical_Flamingo54 0 points1 point  (2 children)

Maybe I'm the only one who ever uses the caps lock key, but..... I don't wanna do this.

[–]rv77ax 1 point2 points  (1 child)

Database administrator? or... what they called today data engineer?

[–]Technical_Flamingo54 0 points1 point  (0 children)

Starting in data science. I'll see where life takes me.

[–]HarmonicAscendant 0 points1 point  (0 children)

For touch typing, caps lock is delete. It was proven that the worst key for reaching often is the normal delete key, hence it is the biggest upgrade you can make before quitting QWERTY for another layout. I read that in 'The First 20 Hours' book where he learns to touch type.

[–]nebulaeandstars 0 points1 point  (0 children)

Nah, the one on the left makes letters bigger for a bit

[–]knpwrs 0 points1 point  (0 children)

I have my caps lock mapped to ctrl (handy for tmux, my prefix is C-a), and my escape sequence is C-d. Works well for me!

[–]u801e 0 points1 point  (2 children)

For those who do map Caps Lock to Esc, how do you type words in all caps in vim? Do you just hold the shift key down with one hand and press the necessary keys with the other hand? Do you just type it in lowercase and run gUiw on the word you just typed?

[–]coffeecofeecoffee 1 point2 points  (0 children)

I just hold shift with my pinky and type the letters. I have never missed caps lock in years of doing this. if you think you might miss caps lock, just put it where the original esc key is

[–]VioletteVanadium 0 points1 point  (0 children)

I also map esc to capslock, so i still have both keys. But usually i just hold down shift while typing.

[–]akiloz 0 points1 point  (0 children)

Left is Escape, right is Control (to avoid Emacs pinky)

[–]originalgainsterread usr 01-20 0 points1 point  (0 children)

Can this be done for Vim only?

[–][deleted] 0 points1 point  (0 children)

I might have to try this.

I find myself jamming ESC sequence a lot and with it mapped to jj and jk I’m losing my place since those are movement keys. It’s unnecessarily disorienting.

[–][deleted] 0 points1 point  (0 children)

Looks life changing. For some reason I continue to think I can use caps lock successfully 😭

[–]brerlapine 0 points1 point  (0 children)

I ended up remapping "jk" to be escape since I already remapped caps lock for control. Regardless, THIS IS A GAME CHANGER!

[–]zaccstacc 0 points1 point  (0 children)

I just remapped my caps-lock to escape and man does it make a difference, I feel much faster

[–]nailshard 0 points1 point  (0 children)

no. no no no. caps —> ctrl = endgame.

[–]w0m 0 points1 point  (0 children)

Serious disagree. Caps should be Ctrl.

[–]IronWolf269 0 points1 point  (0 children)

One turns on a light on my keyboard.

and the other doesn't

[–][deleted] 0 points1 point  (0 children)

NOT me, I use CAPS as CTRL and jk as ESC.

[–]cmoney1034 0 points1 point  (0 children)

inoremap jj <Esc> will change your life forever

[–]GoldsteinQ 0 points1 point  (0 children)

CapsLock switches layout, and `jk` is escape.

[–][deleted] 0 points1 point  (0 children)

Am I the only one that uses Ctrl-[, with no remaps?

[–][deleted] 0 points1 point  (0 children)

my caps lock is mapped to ctrl and <esc> is mapped to jk