aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-07-14 01:45:18 +1200
committerTom Ryder <tom@sanctum.geek.nz>2018-07-14 01:45:18 +1200
commit769048e90ba81136bbf59e786f952b29bf071fea (patch)
tree0c6f29608fafb280019425a1beb96b60af57c250
parentMerge branch 'hotfix/v3.0.1' into develop (diff)
downloadvim-insert-cancel-769048e90ba81136bbf59e786f952b29bf071fea.tar.gz
vim-insert-cancel-769048e90ba81136bbf59e786f952b29bf071fea.zip
Rewrite documentation
-rw-r--r--README.md8
-rw-r--r--doc/insert_cancel.txt36
2 files changed, 20 insertions, 24 deletions
diff --git a/README.md b/README.md
index e767d80..0bfb346 100644
--- a/README.md
+++ b/README.md
@@ -1,10 +1,10 @@
insert\_cancel.vim
==================
-This plugin provides a mapping target to cancel an insert operation, by leaving
-insert mode normally and undoing a change if one was made by that insert
-operation. It's intended as a target for `i_CTRL-C`, to make it do something
-useful, and to fire `InsertLeave` afterwards where available.
+This plugin provides a mapping target to cancel an insert operation. It leaves
+insert mode normally, firing `InsertLeave`, and then runs `:undo` if the buffer
+was changed by the insert. This is intended as a remap of Ctrl-C in insert
+mode.
License
-------
diff --git a/doc/insert_cancel.txt b/doc/insert_cancel.txt
index b7888b3..4adb82c 100644
--- a/doc/insert_cancel.txt
+++ b/doc/insert_cancel.txt
@@ -1,35 +1,31 @@
-*insert_cancel.txt* For Vim version 6.0 Last change: 2018 July 11
+*insert_cancel.txt* For Vim version 6.0 Last change: 2018 July 12
DESCRIPTION *insert_cancel*
-This plugin provides a mapping target to cancel an insert operation, by
-leaving insert mode normally and undoing a change if one was made by that
-insert operation. It's intended as a target for |i_CTRL-C|, to make it do
-something useful, and to fire |InsertLeave| afterwards where available.
+This plugin provides a mapping target to cancel an insert operation. It leaves
+insert mode normally, firing |InsertLeave|, and then runs |:undo| if the
+buffer was changed by the insert. This is intended as a remap of |i_CTRL-C|.
REQUIREMENTS *insert_cancel-requirements*
-This plugin is only available if 'compatible' is not set. It works better on
-newer versions of Vim. It works best if you have |autocmd| and at least
-|version-7.0|, because it leans on |CursorMoved|.
+This plugin only loads if 'compatible' is not set. It works best if you
+have at least |vim7| with |autocmd|, because it leans on the |CursorMoved|
+event.
+
+If you don't have |CursorMoved|, the |'[| and |']| marks are used to detect
+changes instead. This still works for undoing insert additions, but it won't
+restore text that was erased when insert mode was entered with |c| or |s| or
+their variants, and it doesn't undo new unindented blank lines.
-If you don't have |autocmd| and |version7|, all the plugin has to go on are
-the |'[| and |']| marks. It still kind of works, but there are some big gaps;
-it won't undo text that was erased when insert mode was entered with |c| or
-|s| or its variants, and it also may not undo new blank lines. Even this is
-still rather better than just the intuitive mapping:
->
- imap <C-C> <Esc>u
-<
MAPPINGS *insert_cancel-mappings*
*<Plug>(InsertCancel)*
-The single mapping target provided is |<Plug>(InsertCancel)|, mappable in any
-mode. There is no default key mapping to the target; you should define this
-yourself in your |vimrc|. For example:
+The single insert mode mapping target is |<Plug>(InsertCancel)|. There is no
+default key mapping; you should define one yourself in your |vimrc|. For
+example:
>
imap <C-C> <Plug>(InsertCancel)
-
+<
AUTHOR *insert_cancel-author*
Written and maintained by Tom Ryder <tom@sanctum.geek.nz>.