![]() ![]() On the opening dialog, type the combination you want to map, for example alt + d, and select Send escape sequence from the drop down Then on the last textbox insert the escape sequence character you want to send (typically the same pressed along the meta key). Select Normal instead of +Esc and, for each key shortcut you want to map, click on the + button. This can be done in the same window as before. Another way to achieve what we want is to manually map all the meta key shortcuts. Click iTerm2 in the menu bar, choose the Preferences option, and then head to the Keys section. Set it up to the last option (+Esc) as shown in the screenshot, and then the alt key in iTerm will be sending the shell the adequate escape sequence so all meta mappings work as expected.ĮDIT (): looks like this breaks some of the characters that are used by typing the meta key, i.e. Now, on the bottom of the keymap lists, you will see that you can configure the behaviour of the option key. You just need to go to the Profiles menu, edit your profile (which is most likely to be the default one), and then go to the keys tab. ![]() Instead of moving forward or backward a word, you will see that some weird character is written on the command line.įortunately this is really easy to fix in iTerm. Now, if you open a shell in iTerm and press C-b or C-f, the output will be as expected, but not if you press M-b or M-f. In Mac OS X, the meta key is mapped to the alt key, but as you may very well know, this alt key is known as the option key, and has its peculiarities. In most keyboards (or keymaps to be precise), the control key is mapped to the ctrl key and the meta key is mapped to the alt key. The C stands for control key, while the M stands for meta key. Doing if with M-b or M-f does the same but with a word (if you are an Emacs user you will be familiar with those key shortcuts). Pressing C-b or C-f moves the cursor one character back or forward. This movements, unless you redefine it in your global or local bashrc profile (or any similar shell you maybe using), are done with the keys b and f. Using the arrow keys is usually enough, but more often than not you need to move between words. Chances are, too, that you are using iTerm instead of the system provided Terminal app. ![]() If you use your Mac OS X as a development machine and are a regular user of the shell, chances are you are going to be using the movement commands a lot. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |