Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to not get special characters in place of meta key combinations for VIM on OS X

On OS X, at any program, when I type option-p I get π, option-P I get and there's a bunch of alt/option bindings that just return greek and other special characters.

Is there a way to disable that?

Currently I'm using the Auto Pairs VIM plugin and it has the following default mappings:

<M-p> : Toggle Autopairs (g:AutoPairsShortcutToggle) 
<M-e> : Fast Wrap (g:AutoPairsShortcutFastWrap) 
<M-n> : Jump to next closed pair (g:AutoPairsShortcutJump) 
<M-b> : BackInsert (g:AutoPairsShortcutBackInsert)

It seems I can't use these and other meta key based VIM mappings while this special input is turned on.

EDIT

From this cnet article, in truth I need to know how to disable that special input shown at the bottom of the page.

like image 973
pepper_chico Avatar asked Aug 10 '12 14:08

pepper_chico


1 Answers

Use the macmeta setting: :set macmeta

From :help 'macmeta'

'macmeta' Use option (alt) as meta key. When on, option-key presses are not interpreted, thus enabling bindings to <M-..>. When off, option-key presses are interpreted by the selected input method and inserted as text.

Obviously this is a MacVim-only setting.

In Terminal.app Settings there's a setting for "Use option as meta key", under the Keyboard tab which disables e.g. Option-p printing π. You may need to start a new terminal window to see the effect. But for some reason even after disabling this I'm having trouble setting mappings for <M-p>, but mappings using Ctrl-v and inserting the character literally do work.

like image 126
pb2q Avatar answered Sep 23 '22 08:09

pb2q