Hacker News new | past | comments | ask | show | jobs | submit login
A useful Caps Lock key (brettterpstra.com)
103 points by rbcoffee on Dec 27, 2013 | hide | past | favorite | 136 comments



I remapped my Caps Lock key to switch into a "Greek" mode for typing, since I frequently need to type Greek letters interspersed with English. (Anybody in STEM classes should know how awkward it is to do this normally.) If you have a Mac, you can do this with Ukelele, a free key remapping tool. You can even set up and add "dead key" modes (e.g. the way opt+E allows you to add a diacritic to the next letter typed). There are some really advanced configurations possible. Ukelele even still works on Mavericks.

http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=...


Not awkward, just with a little steep learning curve. The only way to type math notation (which isn't the same character set as Greek. Compare \varepsilon with \epsilon, for example: http://www.w3.org/2003/entities/2007doc/#epsilon) is LaTeX. And for that, the only keys you really need are the dollar sign and backwards-slash.


I haven't set it up since getting a new laptop, but I used to have lots of math notation available on my keyboard (e.g. AltGr, <, = would give ≤), and LaTeX set up so that I could put those characters directly in my documents, and it was so much nicer than doing everything with backslash.


> The only way to type math notation is LaTeX.

No it isn't. Perhaps by far the best and most practical way, but not the only way ever to type math notation.


Try to write anything math heavy that is longer than a couple of pages in any other tool.

I'd be finishing typing a small monograph by then. LaTeX is far from perfect, but there isn't a better solution yet.


This is true in LaTeX, but sometimes you need it on IMs, comments, etc.


You'd find that STEM professionals (and academics, as some would say those two sets are disjoints) simply write LaTeX in their mails; I even find myself saying it when conversing face to face (but you loose the slashes: "take varepsilon less than frac x over y").

That's one big strength of LaTeX: everybody (in certain professions) knows it, so it is easy to collaborate on LaTeX typeset documents.


Now that you mention it, that's what I do with my LaTeX-speaking friends too...


Well, as a Greek, typing Greek isn't hard at all. Install the Greek keyboard layout (should be a few clicks in any OS) , switch to it and the letters should more or less make sense (a is α, e is ε, i is ι, etc).


> Ukelele even still works on Mavericks.

Why wouldn't it? They didn't change the entire input system in Mavericks, did they?


I think macs make working with keyboard shortcuts very difficult for various reasons. - Command and Control are confusingly named. - They use most of the function keys for windows related things - bring all windows to front etc. - There is no key for right click like those offered by Windows keyboards to bring up context menus. - You can Command-Tab to an application but not to the individual windows of that application. You must use Command-Tilde for that. - Apps offered for mac don't have a consistent behavior for the close button. Some apps will close the window, but stay in the dock. Others will quit. - On Windows, if the first letter in the menu bar items is underlined, you can be sure you can just do Alt + that letter to open up that menu item. You could even move windows using one of the menu item options and arrow keys.

My biggest issue on switching from Windows to Mac was losing all those keyboard shortcuts. On Windows I could do a whole lot more without ever touching the mouse.

I know you can remap your keys etc. but then you usually end up acting all awkward anytime you have to use someone else's computer. So I want the defaults to be good instead and I think Windows got theirs better than Mac.

Don't hate on me for this. I know both operating systems have their pros and cons.


I am surprised by this, as I have had the opposite experience.

I moved from a windows to mac a few years back, adopted alot of the keyboard shortcuts and recently a few months ago back to windows primarily. I found that on a mac the same shortcuts I use in the terminal (readline bindings), I can use most everywhere (ctrl-a for line start/ ctrl-w to kill last word etc...). For the most part Vimium takes care of the browser.

I have often found the windows shortcuts to be hidden an obscure. Alt+F4 is the defacto kill app on windows but trying to press it is inconvenient especially while Alt+tabbing through windows.

I agree command and control can be confusing but they give you more range in keyboard shortcuts as a result. The windows 8 search (although an improvement over 7) is also medicore compared to OSX spotlight making it much easier to CMD+Tab and navigate to different apps.

The least keyboard friendly part is certainly the windows cmd prompt where pasting is ALT+SPACE+E+P ... as opposed to CMD+V on OSX... not mention the lack of navigational shortcuts in the cmd prompt (kill back a word, kill rest of line etc...)

The most frustrating part for me is windows shortcuts not being consistent throughout apps. In most of the windows CTRL+BACKSPACE will kill the last word but not in notepad? or most winform applications... Ctrl-F is find in most apps but "forward email" in outlook?

I guess its really a matter of personal preference, but I think as far as keyboard shortcuts go, both OS's have plenty.


You honestly can't compare the command prompt to anything else on windows.

It's an absolute travesty, nothing works in the command prompt. None of the normal windows text functions works (ctrl-c, ctrl-x, ctrl-v, ctrl-z, ctrl-shift-left/right to copy, mouse copy or selection commands). Copy and Paste especially is an absolute travesty (although it's muscle memory to me these days) and I honestly don't know why they haven't fixed it yet.

That and not being able to resize the window too. Nothing more frustrating than running a long running command and then the output wraps so it's unreadable, and you can't resize the screen. And the mouse screen resize simply doesn't work, you have to go through the whole rigmarole with the buffer size.

It's simply a complete pile of shit. That they consistently bring it out is bizarre. They didn't even bother to fix it for powershell, which essentially just makes powershell a vast pile of crap as an exploration tool.

As you can tell, the whole situation frustrates me a lot, it's a tool I use daily and that they leave it in such an abysmal state is frustrating.

So don't judge windows shortcuts by it's console, for some reason they stubbornly refuse to upgrade it to behave like the sane text editor it should be.


In my experience, even really good Windows administrators do not use the console. They know how to use it, but rarely do. Frustration with the Windows CLI is strictly an artifact of a Unix-user's culture shock. IOW, no one worth listening to is asking MS for a better command line.


Of course people don't use it. It's unusable for serious work. If they improved it you might find that people use it more often.


As someone who's admined Windows systems, the solution comes in the form of the Powershell ISE, installed on any modern Windows system. Essentially, a combination code editor and terminal for Powershell in a modern Windows interface.

Nobody uses the default terminal (cmd.exe and systems built on top of it). There's alternatives, though, and at least one is pre-installed. Do you judge Linux's command-line capabilities by the usability of xterm?


Embarrassingly I only found this about 2 weeks ago after deciding to give powershell another shot, it is rather good I must admit. I just got in the habit of typing cmd/pow in start and hitting enter.

One of the disadvantages of relying on HN for tech news, few MS stories apart from the occasional "new VS released"/"C# is awesome but lets rag on it anyway"/"wow, F# is great (no-one uses it)" stories.

I seem to remember when powershell first came out the only way to manage the next generation exchange was through the CLI? Quite a few tools lost their GUIs for a little bit? 2008? Am I wrong? Are the GUIs back now? I lost contact with my sysadmin friend and have mainly been working with small companies since that tend to outsource everything to google apps so am completely out of touch on Windows sysadmin.


Most of Exchange can be configured through the GUI - which is essentially a wrapper around Powershell commands - although there's bits and pieces that can't be, especially while initially setting up the system.

Office 365, however, requires a lot of Powershell administration, as it doesn't support the GUI management panel, and the web admin panel doesn't expose much functionality.


Several things are fixed in PowerShell actually - including resize, although I agree that it's still a travesty of a terminal compared to either Terminal.app, Gnome Terminal or Konsole. I'm not implying they are the benchmark, just that they are the delivered console on other platforms.

For windows terminals, I'm intending to look into http://bliker.github.io/cmder/.


Keyboard shortcuts are a mess in all common DEs I think. Windows mostly use win+something for commands that have a scope wider than the current application. But there's always ctrl + x, c and v.

Mac might have a better tought out keyboard [1] with @ on a key of its own and \|/ all available on a single key just using modifiers (isn't mentioned anywhere in the manual or help system and not printed in light blue on the keys).

I think the biggest problem everywhere might be that there is no scoping. E.g. if ctrl + something would never affect anything outside of the currently focused window then any application could happily use any and all ctrl-shortcuts for its own purposes. In the same way Super could be defined to only be available for DE-level shortcuts (e.g. cut, copy, paste, switch windows etc).

[1] Also note that apple laptops like ibm/lenovo laptops have fn|ctrl instead of ctrl|fn. Unlike lenovo though it c a n n o t be remapped. (At least it was not possible last time I tried back in 2011.)


As someone who's used and seen Apple and Lenovo/IBM laptops (thinkpads and macs are vast majority of what students at my school and co-workers at my jobs used) almost exclusively over the years, I was incredibly surprised to learn that fn|ctrl was non-standard.


There's certainly been a learning curve for me recently, when switching to a Mac for my main work computer. Muscle memory for Ctrl-C, Ctrl-X and Ctrl-V are very strong and I find it highly annoying there's no easy way to make this work as it does on Linux and Windows.

Also plugging in an external, standard (non-Mac) UK keyboard leaves you with weird mappings all over the place, and Home and End don't do what they do on every other OS, but appear instead to be largely useless.

I appreciate Mac OS is it's own thing, but it does make switching that much harder and more frustrating.


There's a reason they don't use Ctrl-C etc for copy/paste - because in the terminal, as I'm sure you know, Ctrl-C sends a SIGINT signal. In OS X you can use a consistent command for copy and paste across the whole operating system, including the terminal.


That's not a good enough reason to break my muscle-memory, IMHO, even if it is consistent. I prize consistency across platforms more than within.


I think the point is that Microsoft 'broke' your muscle-memory by assigning an already-in-use shortcut.


Exactly. IIRC the command key and shortcuts were added on the Apple IIe. It's not a recent addition and not something that 'broke' anyone's muscle memory. If they'd changed it to ctrl-c to cater for windows users, that would've broken historical Mac muscle memory.


They could support it being an easy config option. Instead you can swap the keys (which breaks the key combos you might use in a VM, AFAICT) or you can mess around with KeyBindings, which only apply to some applications and not others.

Not having an option for it at this point in time seems like little more than bloody mindedness. And regardless of any of this, it makes it harder to switch comfortably to Mac OS than pretty much any other OS, and I use a lot of different OS's to get my job done.


I will concede that they could have made it reconfigurable (though you can indeed reconfigure using third party software like KeyRemap4MacBook). I was just giving a bit of historical context as to why this was the case - the IIe being a terminal-based machine. Apple are quite stubborn when it comes to accommodating people switching from other platforms, they tend to believe that their ways are the best and most usable, and that that alone will sell people on their platform. For me, that turned out to be true - having used Windows/Linux most of my life and making the full-time switch about 7 years ago, I almost always prefer the 'Apple way' these days.


No, the point is that I had to change when moving to Mac when both Windows and Linux support the Ctrl way.

That particular shortcut is not in use 99% of the time in the modern era. Arguing that the MAC UI is somehow centred around console applications seems a little churlish. Plus it's far easier to context switch on the single application level (am I in a terminal? Ctrl-C isn't copy) than it is on the platform level (which OS is this application, which looks identical on every platform, currently running on? Oh wait, is this one in a VM?).

Regardless of who may have been 'right' 20 years ago, Mac OS sticks out and makes life difficult now. It's also non-optimal in terms of either requiring a weirdly cramped hand position or two hands, but that's secondary.


I had this problem and solved it like so:

    * OS X: caps lock -> command
    * iTerm: left command (the rebound capslock) -> control
This means in iTerm I need to use the right command key for command shortcuts, but it gives me a convenient control for terminal use. The end result is the same thing as binding caps lock to control on a Linux machine.


Windows is just as inconsistent with closing, with the added bonus of also being inconsistent with minimizing behaviour too. How do you get an app to go to the systray? Close it? Minimise it? Who knows.

While I do agree Windows has a better keyboard story, most of what you describe are just differences, not worse.


Closing in windows is always Alt+F4 (or with most programs, close the last open window for that program).

Minimizing is easy after Windows 7 - Windows + Down (Using the windows plus the arrow keys are stupidly useful now, I would love for Mac to have something equivalent.

I personally find Command+C to be very uncomfortable when compared to Ctrl + C - having to curl my thumb under my hand to hit Command is annoying compared to hitting Ctrl with my pinkie. Command + Q also drives me nuts, because it's so easy to hit accidentally when going for the W or tab keys.


Excel 2003 was the worst offender of inconsistent closing/minimizing behavior for me. If you had multiple workbooks open, you couldn't have one on each screen because they're tied to the main Excel window. If you tried to close a workbook using the normal X button like you were closing a single Word document, it would close every open Excel book. You had to use a smaller X below the main X to close a single book. I'm glad they finally changed that stupid behavior.


Alt-space gives the window menu.

Close: alt-space, c

Minimise: alt-space, n

Maximise: alt-space, x

etc.

Works in every version of windows since 95ish, as well as every popular Linux DE I've ever tried (inc. gnome, xfce, kde, cinnamon).


> How do you get an app to go to the systray? Close it? Minimise it? Who knows.

This is a per app thing. Many people (myself included!) want some apps down in the system tray rather than in the task bar. A common example is IM and Email apps.

This is more application developers responding to user demands than anything else. 99% of apps that do this have a toggle switch somewhere to turn this behavior off.


One solution for the menubar shortcuts on OSX is to use the help menu. Hit Cmd + Shift + / and it'll jump to it, from there you can type any menu command and invoke it when you hit return.


I've got it mapped to Control like a standard hacker,

but this reminds me that some years ago I had it mapped so that if I hit SHIFT-CAPSLOCK (which is a rather unusual thing to do, think about it), it would type... a tilde. I have no idea why I thought I wanted that.


Are you sure it was a tilde? My terminal emulator puts in tildes for various special characters (such as when I press the delete key).


Did you have a keyboard that didn't have a tilde?


Compose key! https://en.wikipedia.org/wiki/Compose_key

languages, like ruby, haskell, and go, let you use unicode characaters in the language. You can map those characters to key combinations with the compose key.

It comes with a giant list of key combos for accented characters too. So it's worth enabling, then defining your own combos for symbols you'd like to add to your vernacular.


The first ruby code I find with unicode characters outside the comments gets the author a smack around the head :)

Yes it is all very nice that you can do this, but if you publish some code which some poor shmuck wants to modify on his non-uber-unicoded-dev-setup you just made his life a lot worse.


  it 'is the season to be jolly' do
    expect(☃ + ☀).to eq(♨)
  end
;)


Who is using an editor that doesn't support Unicode?


That was what I thought until my patch broke the build for a windows based dev. Granted this was C++, Ruby should fair better by having a single popular runtime.


The compose key is also useful outside of programming environments: I'm german but still prefer english keyboard layouts for easier access to several characters (like {}[]\ and so on) which require the use of Alt Gr on german keyboards. The compose key still allows me to use german umlauts like ä by typing <Compose>"a. I've gotten quite fast in doing that because by having compose on Capslock, I can use two fingers of my left hand to press the Shift and Capslock keys (nearly) simultaneously, one finger of my right hand to press the ' key (which, together with Shift, gives me the ") and then press a afterwards.


Also, if you're looking for a good .XCompose file, this is one that someone on HN pointed me to some time ago: https://github.com/kragen/xcompose/blob/master/dotXCompose


Absolutely, I started using a Compose Key for Emoji's, and other new Unicode (no kidding).


yup, I use it as compose key too


I use caps-lock instead of shift. For example, I do "CAP-LOCK, LETTER, CAPS-LOCK" to type a capital letter. It's less efficient, yes, but it works just fine for me. Explaining this to anyone gets "you're kidding" views, but I assure you, the caps lock key is already quite useful to me.


Key sequences -- even though they may involve more strokes -- are simpler in some ways than chording, so I can see why that would be attractive.


It's actually unclear whether it's less efficient or not. Sean Wrona, one of the fastest typists in various competitions, generally uses it in place of shift.

He posts about it here: http://forum.colemak.com/viewtopic.php?pid=8851#p8851


The first thing to come to mind when I read the parent was Sean Wrona too...

I use StickyKeys which lets me hit Shift and then a letter, which I think is even faster since you don't have to "un-shift" like you would with CapsLock.


The ergonomic considerations of what he proposes are a little terrifying to me.


One of my work mates uses this technique too. I remap my caps to ctrl. Hilarity ensues whenever he tries to use my keyboard for pair programming.


Isn't hyper its own key, not a combination of the other modifiers?

http://upload.wikimedia.org/wikipedia/commons/4/47/Space-cad...

Emacs seems to think so:

  ELISP> (kbd "S-s-C-M-x")
  [176160792]
  ELISP> (kbd "s-C-M-x")
  [142606360]
  ELISP> (kbd "H-x")
  [16777336]


Yup, it's its own key. People tend to refer to this combination of modifiers on OS X as "Hyper" because of this post by Steve Losh:

http://stevelosh.com/blog/2012/10/a-modern-space-cadet/#hype...


That's annoying. How do Mac users use capitalized Greek letters as part of key combinations!?


It's a horrible burden, but we've learned to make do.


In linux, if you want to make Capslock as both ESC and Ctrl,

    $ setxkboption -option -option 'ctrl:nocaps'
    $ xcape
https://github.com/alols/xcape

What is good for?

  - Happy with vim
  - Happy with emacs like - readline - keybinding. C-a, C-e, C-u, C-k, C-d, C-h, C-w, C-p, C-n, C-y ...
  - Ctrl key is most used in any gui application.
You can abandon both bottomleft Ctrl and topleft Esc.


How does that work? Pressing it alone is escape, pressing it in combination with another key is Ctrl?


Yes


If you use Emacs, I've heard great things about used xkb to remap spacebar to control, and using xcape to make control generate a space when tapped. It sounds messy but now you'll get emacs thumb instead of emacs pinky.


I just remap caps lock to act as a random modifier each time it's pressed. It seems absurd to set it up any other way.


Caps is a fantastic key to use for things like backspace, but if you want even more functionality, try using it with Colemak as a modifier that puts all the other common keys right on your home row: http://forum.colemak.com/viewtopic.php?id=1467


Slap that on a Truly Ergonomic keyboard (https://www.trulyergonomic.com) and you're living my life. Do it all at once and type 4 wpm for a month.

(I have the older "international" version with a number of blank keys. I remapped the left space bar to command and the lower left dead key to hyper. Tapping either shift of course generates a paren.)


I do use it as backspace (I got the idea from Colemak, which I didn't like that much, but I found this particular idea great). It's very convenient especially for deleting entire words (it's ctrl + backspace normally, but ctrl + capslock only requires one hand and it just feels easier).


If you're on Windows, a no-hassle way to do this is with AutoHotkey.

http://www.autohotkey.com/

http://www.autohotkey.com/docs/misc/Remap.htm


It may be useful to remap right shift to shift/delete in similar manner. Also look how awkwardly placed ctrl is. You can remap enter to act as ctrl if it is pressed with something (and plain old enter otherwise). I did this in my keyboard layout: https://kozikow.wordpress.com/2013/11/15/the-only-alternativ... .


This is a great trick, and absolutely worth doing. I have mine mapped to Hyper as well, which is tied to Slate bindings for resizing and managing windows.

https://github.com/jigish/slate


Care to post your slate configuration file? I've just started using it and am seeking inspiration.


https://github.com/lunixbochs/reslate

Was built by a co-worker of mine (ontop of slate). Pretty great set of defaults.


+1 for reslate :)

I use it combined with a hyper key mapping (similar to OP) and enjoy it very much.

my config file: https://github.com/n0nick/dotfiles/blob/master/slate/slate.j...


Mine's a little crazy. :) I'm simulating logic using tortured math to cycle through 1/6th increments left-to-right, and then splitting into vertical halves if desired. It's buggy on boundary conditions, but good enough for my purposes. http://pastebin.com/qjD8TvrE


I just disable its functionality and use it as an extra key for things such as push to talk. Getting in the hang of using as a replacement for delete/escape etc causes muscle memory problems when typing on someone else's keyboard, if you're only ever using your own then it's beneficial, kinda like switching from qwerty


I learned to type in a keyboarding class in high school in the nineties. I was taught to use the caps lock automatically for instances where there are 3 or more capital letters. I cannot give that up as infrequently as it happens. That is much more inconvenient to me than making that key do something else.


There's history to support the Ctrl key being to the left of caps-lock.

http://www.redgrittybrick.org/terminals/keyboards.html

I guess without another key to the left a lot of people remap caps-lock to ctrl. I never got used to that for some reason. In general terms I tend to avoid remapping in order to maintain a consistent UI. the only exception to this that makes sense to me is that all of my Macs have always had their keyboards remapped to match a PC. As closely as reasonable and possible. For example, ctrl-c and ctrl-v do exactly the same thing whether I am running a Windows, Linux (GUI) or MacOS machine.


Reminds me of the Caps Lock Function key on the Acorn Electron computers. Most keywords in the version of BASIC that came with the computer had a corresponding key, so if you were writing a program, you'd simply hit CapsLckFn-P for PRINT or CapsLckFn-E for ELSE etc.

It worked surprisingly well for coding.

If you look carefully, you can see the keywords printed on the front of the keys.

http://ewyse.files.wordpress.com/2011/03/acornelectron_top.j...


Cool keyboard. It's also interesting since you assumed, and all of us would have, P would be PRINT, but it's actually PLOT. PRINT is on the /.


In a lot of old BASICs you can type "?" instead of "PRINT" [1]. I bet that's why they put PRINT on that key. Just an observation.

[1] for example: http://www.antonis.de/qbebooks/gwbasman/print.html


I ended up doing something very similar after reading Steve Losh's article. I kept Control where it was, using Caps Lock as Escape/Hyper . The best part by far is using Caps Lock + hjkl for navigation. At work, I leave my arrow keys & numpad covered up with a mouse platform so I can keep the mouse closer.

A side effect of this was feeling completely lost when using Windows in Boot Camp. I found that there's a great piece of software on Windows called "AutoHotKey" that lets me do the same hjkl navigation.


caps lock + hjkl requires your left pinky every time you want to move the cursor. This may very well induce RSI because "using the arrow keys" is something that we tend to do all the time.

I'm using the key physically at the left of the space bar (I don't like talking about the 'name' of the key because it's very keyboard-dependent) as the modifier which allows me to move the cursor. And I move the cursor using modifier+ijkl (for ijkl reproduces the inverted T arrow cluster, not unlike how gamers like to use WASD or ESDF). I do hit the modifier using my left thumb, which is a finger much stronger than the pinky (and, arguably, such a setup is less RSI inducing).

Regarding covering the arrow keys and numpad with a mouse platform: many people opt for for a "TKL" (no numpad) or even 60% keyboard (no numpad, no arrow cluster) and typically those 60% keyboards have the benefit of coming with quality switches (also arguably less RSI inducing).

If you want to see what others are doing, two great sites are geekhack.org and deskthority.net.

FWIW I use a 60% keyboard which has CTRL at the correct place (i.e. where CAPS-LOCK is on keyboards which have a caps-lock): an HHKB Pro 2 (using the amazing Topre switches)... Which doesn't even have a CAPS-LOCK key.

Note that lately there seem to be a regain in interest in alternate setups and alternate mappings: for example the "SpaceFN" layout uses the space bar as an additional modifier (when it is held down) and ijkl to move the cursor around (once again: ijkl and not vim's hjkl and a strong finger, the thumb, to press the modifier).

Regarding remapping and "feeling completely lost" on other OSes: if you want to not have to remap your keyboard on Windows / OS X / Linux etc. you may want to buy a keyboard which has a programmable controller: your setup then works the way you want on any computer.


Thanks for the info. I actually went through a whole mechanical keyboard phase myself and went through several keyboards without numpads. I spent months using these keyboards, but in the end I found I was fastest and most comfortable typing on an Apple wired keyboard (heresy, I know). I much prefer the footprint of the Apple wireless keyboard, but I find that even though it seems like it'd be identical to the wired version, the keys aren't nearly as solid.

I am kind of curious about Topre switches, I haven't tried them yet. Only various Cherry switches.

I think the pinky RSI issue isn't so bad for me because most of the time I'm in a text editor with vi keybindings, so I wouldn't be using the arrow keys anyway. It's just nice in other apps to have that ability. In the situations where I do use my pinky, it's typically when I'm not typing very much, so I actually just move my left hand so my pinky rests over the Caps Lock key and doesn't need to move laterally. It's some movement, but still less than reaching over to the arrow keys.


Us Emacs users unfortunately have to remap it to control to retain sanity on standard keyboards :P


I do that by default now, too -- OS X has a few basic Emacs control keys that work in all text fields/boxes, like ^P/^N, ^A/^E, ^D, etc., and even though I rarely use Emacs itself those have become muscle memory.

(I use KeyRemap4MacBook for a couple things, including mapping Caps Lock to pressing both shift keys simultaneously, so I still have it if I need it.)


I cut my teeth on Sun keyboards and emacs, so I always remap caps lock to control.


As a Spanish speaker who's used to using English keys for programming, I found it useful to use the Caps Lock key to change keyboard layouts.


I prefer Scroll Lock for cycling keyboard layouts


On fr_FR mapped keyboards (AZERTY) the upper left key is a utterly useless ². I've remapped it to a backtick ` which is otherwise complicated to obtain (needs a 3 key combo). If anyone interested: http://planetozh.com/projects/azertyck/


Remapping my capslock key to escape was the only way that I could finally switch to Vim. Highly Recommended.


I don't know when but very shortly after I started to use vi I learned about and used Ctrl+[, and have been doing that to this day. I still tend to use ^[ instead of Esc by instinct, even when it doesn't work in any other program.


    inoremap jj <Esc>
Best .vimrc setting ever.


Have you compared it to CapsLock as ESC? I understand Escape is in a ridiculous position on most keyboards, but I think CapsLock makes a great mode switcher, and have been using it for a few months now. (Downside being that it can't be done in vimrc, at least not in terminal vim which I use.)

The jj and jk hacks always seemed ridiculous, but maybe I'll give them a try. I think I would prefer jk for speed and fatigue reduction, or maybe even something on the left home row since I'm left-handed.


As you say, you can't just tweak the capslock assignment in vimrc or by issuing a command. The great thing about the jj/jk hack is that if you end up on some random system or borrowing someone else's shell for a second then all you have to do is type ":inoremap jj <Esc>" and you're back in the groove.

I was a little skeptical about it at first as it seemed like a weird hack, but it's actually quite practical. The fact that you don't have to leave the home row to swap between modes is a huge efficiency boost.


I find jk a lot more convenient. With Capslock my pinky has to move over to the next column, where as jk just sits on the home row.


I have Caps Lock mapped to Backspace. Makes total sense after seeing how out of the way Backspace is.


If you're looking for the rest of the private.xml file (HYPER + H/J/K/L) mappings...

https://gist.github.com/skryl/8143550


I have been using super-caps for some time to remap Caps to be Escape or Control if pressed together with something else. https://github.com/cmatheson/super-caps

I must admit, on my computer I'm super productive. My left hand isn't moving at all and my left's pinkie feels relieved because it doesn't have to bend to Control key. On other computers I'm totally screwed. As OP mentioned before, I have ruined my muscle memory.


Does nobody use the Caps Lock key as a caps lock? Pretty useful for that.


We have entire departments that use it almost all day long. Then again, we could probably fix that by having auto-capitalizing fields, but you know you're talking to someone in IM/Email that uses caps all day, when they reply in caps.

ANYWHERE FOR LUNCH IS FINE LET ME KNOW WHEN YOU WANT TO LEAVE


Lots of people have no need for locked caps.


BUT IT MAKES SARCASTIC COMMENTS SO EASY TO WRITE.


Yeah, every time this subject is brought up, I think to myself that I must be the only one who actually uses caps lock for its intended purpose. I spend a lot of my day writing capital letters at work, and having to use shift for every letter would kill me. Instead I can hit caps lock then start typing like normal.


If someone's editor has got a convenient way to capitalize parts after they've been written, I'd be interested in knowing how it works. You can invert case with ~ in vi, but it's not so great for #defines and such (you capitalize every letter in these, and ~ works on a letter at a time).


Vim provides operators for changing case: gu for lower case, gU for upper case and g~ for swapping case.

For example, gUaw changes the current word to upper case. guu changes the whole current line to lower case.

In visual mode, you can use just u and U.

Bonus useless tip: g? encodes and decodes rot13.


Thanks, I guess that explains why gg is needed to go to top. In my editor it's just g. Maybe I'll come up with something clever.


I'm no Vim wizard, but don't most of the commands work like that? You could type e.g. 6~ to change the case of 6 letters at once.


Tilde can be used as an operator in Vim, so typing ~w will change the case from the cursor to the end of the (w)ord :)


“Angry” languages aren't used much anymore (FORTRAN, COBOL, BASIC), so there is no need for Caps Lock.


Interesting enough, all of the standard library for Common Lisp is in caps. However, the default reader upcases all unescaped characters.

A somewhat common way of getting case sensitivity without (CONS (CAR x) (CDR y)) is to change the reader to be case-inverting (which then requires you to type in all standard-library symbols as lowercase.


I guess, but do you still not have a use for it? What if you're talking to git and referring to HEAD? Or if you're #defining things in C? Or if you're writing an email and you want to emphasize a few words?


I hold left shift with my pinky or right shift with my thumb. Unless I do a lot of all-caps typing it's not a problem.


Any reasonable text editor will have more efficient ways to capitalize things than dedicating one of the most convenient keys on the keyboard to it. I prefer M-u (by word) or C-x C-u (by region) in emacs.


Using xcape and xmodmap, I remapped caps lock to behave like control when held and escape when tapped. That allowed me to remap control to hyper. I've really liked this setup so far.


I use the same trick to remap caps lock to "shift+cmd+alt+ctrl" or "hyper". My configuration is highly centered around using slate with the standard h,j,k,l and also u,o,n to manage my windows. On top of that I also use the left side of my keyboard for focus binds, for example hyper+q is Chrome and hyper+e is iTerm2.

Here is my slate configuration for anyone interested: https://gist.github.com/k0nserv/8151008


I've used Autohotkey (Windows) to remap my capslock to select the word my cursor is currently in. Essentially pressing ctrl+left, then ctrl+shift+right. I too have become so use to this that using other people's keyboards is frustrating. I've taken this a couple steps further, shift+capslock selects the current line and ctrl+capslock activates Sublime's multicursor feature.


This won't work in everything, will it? What about if your cursor is at the beginning of a word? Not to mention that different editors stop in different places with ctrl+arrows. Many editors have a key combo for select word already. In Visual Studio it's ctrl-w.


I've been using it for about 1.5 years, and it's been mostly consistent between applications; Notepad being the only one I've noticed with odd characters it includes in the ctrl+arrow movements. I really like the approach using Autohotkey because it becomes universal on my system, so capslock can select words in chrome, IM apps, etc. I don't have to worry that the app supports that feature.


I map mine to control. I switched from using "Escape" to ctrl-c in vim, which plays nicely with this key mapping.


FYI you probably want to use ctrl-[, ctrl-c has some cases where the behavior isn't the same as ESC


https://upload.wikimedia.org/wikipedia/commons/7/71/Das_Keyb... The possibilities are endless, of course :)


Disabling CAPS is one of the first things I do when I refresh a system. I've always wanted to find a better alternative, but as of yet, it hasn't presented itself.

I've thought about mapping it to alt+tab since I use VNC quite a bit.


I am very unoriginal, uncreative, and uninovative.

Aside from browser and maybe calculator. What else would be good to hot key like the op author describes? Thanks!


Caps-Lock should of course be remapped to Control.


Caps lock is already control - CRUISE CONTROL FOR COOL.


While on the topic of useless keys, what do you think of the Menu key?

I use mine for a drop down terminal (Tilda, or Yakuake before).


sad how linux fell behind on keyboard customizations.

used to be the only place where i could replace caps-esc and use altGr for accents.

now windows with autokey(?) allows me to use caps as esc if pressed once, or ctrl modifier if pressed with another key.

i cant find a way to do that in linux now.


Scroll up, see kozikow's post about xcape.


Kinesis user: caps lock mapped to shift (home row), left shift mapped to escape (vim).


Great post but it's over a year old. Shouldn't it be labeled as such?


That makes sense for news or trip reports, but what has changed about keyboards in the last year? Nothing I can think of.


I can't stand the caps lock key at all. I pop them all off my keyboards.


XML? For key remapping? Seriously...?


Mine's mapped to escape because vim.


i ran org-mode with vim so i set caps lock key to ctrl and right Cmd key to esc.


"I’ve become quite used to it — to the point where using other people’s keyboards is inconvenient. " I stopped reading right there.


Why? Even without interesting remappings, aren't you more used to your own keyboard than someone else's?




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: