6 ms·
I tried to get into Emacs on OS X a few times, but one of the things I don't like is the awkwardness of not having the Meta key mapped to a direct simple key pr
by liyanage 13y ago
I tried to get into Emacs on OS X a few times, but one of the things I don't like is the awkwardness of not having the Meta key mapped to a direct simple key press.
Activating the "Use option as meta key" isn't a good solution because I sometimes need to type accented characters that require the option key.
How do people deal with this when using Emacs in the OS X Terminal app?
- roryokane 13y agoOne workaround could be to install Evil-mode so you can use Vim bindings in Emacs. Vim, and thus Evil, doesn't use Meta in any of its mappings. Though you'll still need a way to type Meta for some Emacs-mode-specific mappings.
- ultimoo 13y agoI use the 'use option as meta' heavily and haven't till date needed to type accented chars. Maybe you can try to use only the left option as a meta and leave the right one for accented chars? Not sure whether the Terminal.app supports it, better chances of iTerm supporting it though.
- liyanage 13y agoUnfortunately the option-as-meta setting applies to both left and right option keys.
- tazjin 13y agoiTerm supports using just one option key as meta. But in general I prefer using a build of emacs with Cocoa support enabled (you can get them at http://emacsformacosx.com/ http://emacsformacosx.com/) That lets you set up things like you want with M-x customize-group ns I'm using CMD as meta there and CTRL as control, option stays option.
- cpr 13y agohttp://lmgtfy.com/?q=typing+special+characters+into+emacs http://lmgtfy.com/?q=typing+special+characters+into+emacs ;-) I've used Option as Meta for years (been using Emacs since (gulp) 1977 on ITS/TOPS-20) and never had any trouble. You can use the M-x insert-char (M-x ucs-insert) and type in the code point or Unicode name of any character.
- liyanage 13y agoI should have explained better: I want to type the accented characters the same way I type them into other OS X text fields, and not in a non-standard, emacs-specific way. I want to hold down the option key and press another key to get the character I need. That's why using Terminal's all-or-nothing option of mapping option to meta doesn't work.
- parbo 13y agoI use cmd for meta, there is an option for that: (setq mac-option-modifier nil mac-command-modifier 'meta)
- liyanage 13y agoI'll have to try that. Is this with the regular emacs in the Terminal app? Does it interfere with shortcuts like Cmd-N to open a new Terminal window?
- jcreed 13y agoI use https://github.com/andymcd/cmd-key-happy https://github.com/andymcd/cmd-key-happy which swaps option and command, and which lets you whitelist keys (iirc Cmd-N is among the defaults) to be exempt from that swapping.
- __david__ 13y agoThat config is not for terminal Emacs. It's only for when you are running a native cocoa Emacs (like http://emacsformacosx.com http://emacsformacosx.com). For terminal I always enable option as the meta key and use the OS Character viewer for the rare times I need to type a unicode character into the terminal. Having option as meta is useful outside of Emacs, as "bash" (and other shells) use Emacs keys by default (M-d, M-f and M-b are all essential for me when I'm using bash). I wish the OS would let me use the Fn key for doing fancy unicode characters (maybe Fn+option or something)—that way I could have good unicode input and my precious meta key.
- packetslave 13y agoIterm2 will let you swap option and command. I also cheat and use Keyboard Maestro to UN-swap Cmd-Tab and Cmd-` so that application switching and window switching still works.
- lord_quas 13y agoI use Caps-lock as control and Command as meta. Has worked great for me.
- chromejs10 13y agoI'm always curious why people remap the caps lock to be control. For me, extending my pinky to the caps lock makes the second key press hard. Like quitting emacs would be harder for me. I should make command the meta key though. That seems super beneficial
- ordinary 13y agoYou can enter accented characters into emacs by hitting M-x 8: M-x 8 ` e -> è M-x 8 / a -> å M-x 8 E -> € The number of these binds does not cover all of unicode, but it's surprisingly high nonetheless. If your desired character does not have a direct bind like that, or you just can't find one (C-h b lists them), you can insert a character by hitting M-x 8 RET and then typing its name: M-x 8 RET "Em dash" -> — M-x 8 RET "Hebrew letter double vav" -> װ Tab completion works for these, of course. [edit] I just saw the comment where you're more specific about what you're looking for. This isn't it, but having gotten a reply already, I don't want to delete this comment. It won't help you, but maybe it will others :P