Give Me A Better # Key
If you use a Mac in the UK and often type #, you may find the Option-3 key combo annoying. I do.
Fortunately there’s another key nearby which I never use: the §/± key underneath Escape. We can map that to # and forget about the Option key.
To sort out your command line, add this to your
You’ll need to reload your readline configuration, most easily by restarting Bash.
Vim is slightly trickier. We want to map § to # in insert mode and on the command line (for
: commands), but not in normal mode where # means the same as * but backwards. So far, so good. But we also want to be able to replace a character with # using
r§, and move forward to the next # with
Fortunately Ben Schmidt explained to me how to do this. Add this to your
set iminsert=1 set imsearch=-1 noremap § # noremap! § # lnoremap § #
Unfortunately IRB doesn’t pay attention to your
~/.inputrc, as far as I can tell, even though it is supposed to integrate with readline.
If anyone knows how to fix this, I’d love to hear about it!