]> granicus.if.org Git - vim/commitdiff
updated for version 7.0167
authorBram Moolenaar <Bram@vim.org>
Sun, 11 Dec 2005 21:27:22 +0000 (21:27 +0000)
committerBram Moolenaar <Bram@vim.org>
Sun, 11 Dec 2005 21:27:22 +0000 (21:27 +0000)
runtime/doc/index.txt
runtime/doc/map.txt
src/ex_docmd.c
src/vim.h

index 5750959f40e3cbe3692aa16fea15a04651c6a336..38f2612357173ec4ccb3e98b7c6fd558fedd5d13 100644 (file)
@@ -1,4 +1,4 @@
-*index.txt*     For Vim version 7.0aa.  Last change: 2005 Dec 09
+*index.txt*     For Vim version 7.0aa.  Last change: 2005 Dec 11
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -1255,6 +1255,7 @@ The commands are sorted on the non-optional part of their name.
 |:nmenu|       :nme[nu]        add menu for Normal mode
 |:nnoremap|    :nn[oremap]     like ":noremap" but for Normal mode
 |:nnoremenu|   :nnoreme[nu]    like ":noremenu" but for Normal mode
+|:noautocmd|   :noa[utocmd]    following command don't trigger autocommands
 |:noremap|     :no[remap]      enter a mapping that will not be remapped
 |:nohlsearch|  :noh[lsearch]   suspend 'hlsearch' highlighting
 |:noreabbrev|  :norea[bbrev]   enter an abbreviation that will not be
index a5f6d0c621df62d1f92acca4bf51d374f297d692..e6ec47a77de944c9f483f34d4310084866b608af 100644 (file)
@@ -1,4 +1,4 @@
-*map.txt*       For Vim version 7.0aa.  Last change: 2005 Oct 14
+*map.txt*       For Vim version 7.0aa.  Last change: 2005 Dec 11
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -425,7 +425,7 @@ otherwise you would not be able to use those commands anymore.  Here are a few
 suggestions:
 - Function keys <F2>, <F3>, etc..  Also the shifted function keys <S-F1>,
   <S-F2>, etc.  Note that <F1> is already used for the help command.
-- Meta-keys (with the ALT key pressed).
+- Meta-keys (with the ALT key pressed). |:map-alt-keys|
 - Use the '_' or ',' character and then any other character.  The "_" and ","
   commands do exist in Vim (see |_| and |,|), but you probably never use them.
 - Use a key that is a synonym for another command.  For example: CTRL-P and
@@ -458,14 +458,15 @@ you type slowly, or your system is slow, reset the 'timeout' option.  Then you
 might want to set the 'ttimeout' option.
 
                                                        *map-keys-fails*
-There is one situation where key codes might not be recognized:
+There are situations where key codes might not be recognized:
 - Vim can only read part of the key code.  Mostly this is only the first
   character.  This happens on some Unix versions in an xterm.
 - The key code is after character(s) that are mapped.  E.g., "<F1><F1>" or
   "g<F1>".
+
 The result is that the key code is not recognized in this situation, and the
-mapping fails.
-There are two actions needed to avoid this problem:
+mapping fails.  There are two actions needed to avoid this problem:
+
 - Remove the 'K' flag from 'cpoptions'.  This will make Vim wait for the rest
   of the characters of the function key.
 - When using <F1> to <F4> the actual key code generated may correspond to
@@ -481,6 +482,9 @@ special key: >
 Don't type a real <Esc>, Vim will recognize the key code and replace it with
 <F1> anyway.
 
+Another problem may be that when keeping ALT or Meta pressed the terminal
+prepends ESC instead of setting the 8th bit.  See |:map-alt-keys|.
+
                                                *recursive_mapping*
 If you include the {lhs} in the {rhs} you have a recursive mapping.  When
 {lhs} is typed, it will be replaced with {rhs}.  When the {lhs} which is
@@ -555,6 +559,48 @@ If the terminal key code was recognized as a mapping the key code itself is
 written to the script file.  If it was recognized as a terminal code the
 internal code is written to the script file.
 
+
+Mapping ALT-keys                                       *:map-alt-keys*
+
+In the GUI Vim handles the Alt key itself, thus mapping keys with ALT should
+always work.  But in a terminal Vim gets a sequence of bytes and has to figure
+out whether ALT was pressed or not.
+
+By default Vim assumes that pressing the ALT key sets the 8th bit of a typed
+character.  Most decent terminals work that way, such as xterm, aterm and
+rxvt.  If your <A-k> mappings don't work it might be that the terminal is
+prefixing the character with an ESC character.  But you can just as well type
+ESC before a character, thus Vim doesn't know what happened (except for
+checking the delay between characters, which is not reliable).
+
+As of this writing, some mainstream terminals like gnome-terminal and konsole
+use the ESC prefix.  There doesn't appear a way to have them use the 8th bit
+instead.  Xterm, aterm and rxvt should work well by default, unless you tweak
+resources like "metaSendsEscape", "eightBitInput" and "eightBitOutput".
+
+On the Linux console, this behavior can be toggled with the "setmetamode"
+command.  Bear in mind that not using an ESC prefix could get you in trouble
+with other programs.  You should make sure that bash has the "convert-meta"
+option set to "on" in order for your Meta keybindings to still work on it
+(it's the default readline behavior, unless changed by specific system
+configuration).  For that, you can add the line: >
+
+       set convert-meta on
+
+to your ~/.inputrc file. If you're creating the file, you might want to use: >
+
+       $include /etc/inputrc
+
+as the first line, if that file exists on your system, to keep global options.
+This may cause a problem for entering special characters, such as the umlaut.
+Then you should use CTRL-V before that character.
+
+Bear in mind that convert-meta has been reported to have troubles when used in
+UTF-8 locales.  On terminals like xterm, the "metaSendsEscape" resource can be
+toggled on the fly through the "Main Options" menu, by pressing Ctrl-LeftClick
+on the terminal; that's a good last resource in case you want to send ESC when
+using other applications but not when inside VIM.
+
 ==============================================================================
 2. Abbreviations                       *abbreviations* *Abbreviations*
 
index 2a4fd14e64959cf7a250901f5d757cb4ede09fc5..6977904b2a35d06fb7672174ce2cc96905578b8f 100644 (file)
@@ -1806,6 +1806,20 @@ do_one_cmd(cmdlinep, sourcing,
 #endif
                        continue;
 
+           case 'n':   if (!checkforcmd(&ea.cmd, "noautocmd", 3))
+                           break;
+#ifdef FEAT_AUTOCMD
+                       if (cmdmod.save_ei == NULL)
+                       {
+                           /* Set 'eventignore' to "all".  Don't free the
+                            * existing option value, we restore it later. */
+                           cmdmod.save_ei = vim_strsave(p_ei);
+                           set_string_option_direct((char_u *)"ei", -1,
+                                                  (char_u *)"all", OPT_FREE);
+                       }
+#endif
+                       continue;
+
            case 'r':   if (!checkforcmd(&ea.cmd, "rightbelow", 6))
                            break;
 #ifdef FEAT_WINDOWS
@@ -2595,6 +2609,14 @@ doend:
 
     if (verbose_save >= 0)
        p_verbose = verbose_save;
+#ifdef FEAT_AUTOCMD
+    if (cmdmod.save_ei != NULL)
+    {
+       /* Restore 'eventignore' to the value before ":noautocmd". */
+       set_string_option_direct((char_u *)"ei", -1, cmdmod.save_ei, OPT_FREE);
+       free_string_option(cmdmod.save_ei);
+    }
+#endif
 
     cmdmod = save_cmdmod;
 
index c8357ff948265c885680b872ade82a8fb66ba18b..ec69431e00102104ae15fbd2645296ba7d690c80 100644 (file)
--- a/src/vim.h
+++ b/src/vim.h
@@ -1576,7 +1576,8 @@ int vim_memcmp __ARGS((void *, void *, size_t));
 #define VV_SCROLLSTART 44
 #define VV_SWAPNAME    45
 #define VV_SWAPCHOICE  46
-#define VV_LEN         47      /* number of v: vars */
+#define VV_SWAPCOMMAND 47
+#define VV_LEN         48      /* number of v: vars */
 
 #ifdef FEAT_CLIPBOARD