summaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorBram Moolenaar <bram@vim.org>2011-05-19 17:25:41 +0200
committerBram Moolenaar <bram@vim.org>2011-05-19 17:25:41 +0200
commit57ef554a2f2550453a046f4046355c1b4a27aedb (patch)
tree1ba22c2a473d52469c558985b3ff5480f2248fef /runtime
parenta6b476449ab8de121234a99cd93ac7de4c4a1ddf (diff)
downloadvim-57ef554a2f2550453a046f4046355c1b4a27aedb.tar.gz
updated for version 7.3.196v7.3.196v7-3-196
Problem: Can't intercept a character that is going to be inserted. Solution: Add the InsertCharPre autocommand event. (Jakson A. Aquino)
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/autocmd.txt13
-rw-r--r--runtime/doc/eval.txt1
-rw-r--r--runtime/doc/map.txt2
3 files changed, 15 insertions, 1 deletions
diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
index d40df234..145ecf62 100644
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -299,6 +299,8 @@ Name triggered by ~
|InsertEnter| starting Insert mode
|InsertChange| when typing <Insert> while in Insert or Replace mode
|InsertLeave| when leaving Insert mode
+|InsertCharPre| when a character was typed in Insert mode, before
+ inserting it
|ColorScheme| after loading a color scheme
@@ -657,6 +659,17 @@ InsertChange When typing <Insert> while in Insert or
indicates the new mode.
Be careful not to move the cursor or do
anything else that the user does not expect.
+ *InsertCharPre*
+InsertCharPre When a character is typed in Insert mode,
+ before inserting the char.
+ The |v:char| variable indicates the char typed
+ and can be changed during the event to insert
+ a different character. When |v:char| is set
+ to more than one character this text is
+ inserted literally.
+ It is not allowed to change the text |textlock|.
+ The event is not triggered when 'paste' is
+ set.
*InsertEnter*
InsertEnter Just before starting Insert mode. Also for
Replace mode and Virtual Replace mode. The
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index 50da2de6..db5ae563 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1293,6 +1293,7 @@ v:beval_winnr The number of the window, over which the mouse pointer is. Only
*v:char* *char-variable*
v:char Argument for evaluating 'formatexpr' and used for the typed
character when using <expr> in an abbreviation |:map-<expr>|.
+ It is also used by the |InsertPreChar| event.
*v:charconvert_from* *charconvert_from-variable*
v:charconvert_from
diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt
index ec21d15f..ceb29013 100644
--- a/runtime/doc/map.txt
+++ b/runtime/doc/map.txt
@@ -226,7 +226,7 @@ text before the cursor and start omni completion when some condition is met.
For abbreviations |v:char| is set to the character that was typed to trigger
the abbreviation. You can use this to decide how to expand the {lhs}. You
-can't change v:char and you should not insert it.
+you should not either insert or change the v:char.
Be very careful about side effects! The expression is evaluated while
obtaining characters, you may very well make the command dysfunctional.