From c24c25f4db27722a6fc43c97e897433f674179d0 Mon Sep 17 00:00:00 2001 From: Bjorn Winckler Date: Sun, 12 Oct 2008 14:05:42 +0200 Subject: [PATCH] Use option as meta key Added a buffer local option called 'macmeta' which when set causes MacVim not to interpret option+key presses thus enabling the user to bind to . Also updated the documentation and added 'macmeta' to the .vim syntax file. --- runtime/doc/options.txt | 12 +++++++++ runtime/doc/quickref.txt | 1 + runtime/doc/tags | 4 +++ runtime/optwin.vim | 3 +++ runtime/syntax/vim.vim | 12 ++++----- src/MacVim/MMBackend.m | 57 ++++++++++++++++++++++++++++++++++++------- src/MacVim/MMTextViewHelper.m | 11 +++++++++ src/option.c | 19 +++++++++++++++ src/option.h | 3 +++ src/structs.h | 3 +++ 10 files changed, 110 insertions(+), 15 deletions(-) diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index bd001d7a..3cdcdf99 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -4493,6 +4493,18 @@ A jump table for the options with a short description can be found at |Q_op|. 'termencoding'. Note: MacVim does not use this option. + *'macmeta'* *'mmta'* *'nomacmeta'* *'nommta'* +'macmeta' boolean (default off) + local to buffer + {only available in MacVim GUI} + Use option (alt) as meta key. When on, option-key presses are not + interpreted, thus enabling bindings to . When off, option-key + presses are interpreted by the selected input method and inserted as + text. + Note: Some keys (e.g. , , , ) can be + bound with the Meta flag even when this option is disabled, but this + is not the case for the majority of keys (e.g. , ). + *'magic'* *'nomagic'* 'magic' boolean (default on) global diff --git a/runtime/doc/quickref.txt b/runtime/doc/quickref.txt index ae528258..cc1af875 100644 --- a/runtime/doc/quickref.txt +++ b/runtime/doc/quickref.txt @@ -767,6 +767,7 @@ Short explanation of each option: *option-list* 'listchars' 'lcs' characters for displaying in list mode 'loadplugins' 'lpl' load plugin scripts when starting up 'macatsui' Mac GUI: use ATSUI text drawing +'macmeta' 'mmta' use option as meta key (MacVim GUI only) 'magic' changes special characters in search patterns 'makeef' 'mef' name of the errorfile for ":make" 'makeprg' 'mp' program to use for the ":make" command diff --git a/runtime/doc/tags b/runtime/doc/tags index d8962860..75717359 100644 --- a/runtime/doc/tags +++ b/runtime/doc/tags @@ -381,6 +381,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME* 'lz' options.txt /*'lz'* 'ma' options.txt /*'ma'* 'macatsui' options.txt /*'macatsui'* +'macmeta' options.txt /*'macmeta'* 'magic' options.txt /*'magic'* 'makeef' options.txt /*'makeef'* 'makeprg' options.txt /*'makeprg'* @@ -407,6 +408,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME* 'mmd' options.txt /*'mmd'* 'mmp' options.txt /*'mmp'* 'mmt' options.txt /*'mmt'* +'mmta' options.txt /*'mmta'* 'mod' options.txt /*'mod'* 'modeline' options.txt /*'modeline'* 'modelines' options.txt /*'modelines'* @@ -543,9 +545,11 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME* 'nolz' options.txt /*'nolz'* 'noma' options.txt /*'noma'* 'nomacatsui' options.txt /*'nomacatsui'* +'nomacmeta' options.txt /*'nomacmeta'* 'nomagic' options.txt /*'nomagic'* 'nomh' options.txt /*'nomh'* 'noml' options.txt /*'noml'* +'nommta' options.txt /*'nommta'* 'nomod' options.txt /*'nomod'* 'nomodeline' options.txt /*'nomodeline'* 'nomodifiable' options.txt /*'nomodifiable'* diff --git a/runtime/optwin.vim b/runtime/optwin.vim index 3738b762..f81cd9fe 100644 --- a/runtime/optwin.vim +++ b/runtime/optwin.vim @@ -623,6 +623,9 @@ if has("gui") call BinOptionG("fullscreen", &fullscreen) call append("$", "fuoptions\tcontrol how fullscreen mode should behave") call OptionG("fuoptions", &fuoptions) + call append("$", "macmeta\tuse option as meta key") + call append("$", "\t(local to buffer)") + call BinOptionL("mmta") endif endif diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index b7bc7da4..1731c973 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -25,21 +25,21 @@ syn match vimCommand contained "\