aboutsummaryrefslogtreecommitdiff
path: root/doc/paste_insert.txt
blob: 7286c157cc401dd85883cb85b74f0f9f50e70a2c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
*paste_insert.txt*	For Vim version 7.0	Last change: 2019 Jun 19

DESCRIPTION				*paste_insert*

This small plugin provides a simple "one shot paste" method, with a command or
mapping to prefix opening an insert, with the 'paste' option automatically set
after the insert ends, to avoid the annoyances caused by forgetting to do so.

It includes a timeout if insert mode isn't entered within 'updatetime'
seconds, or if the user navigates away from the buffer or window.  It can also
be cancelled with a key in normal mode, by default CTRL-C.

REQUIREMENTS				*paste_insert-requirements*

This plugin only loads if 'compatible' is not set.

COMMANDS				*paste_insert-commands*

					*:PasteInsert*
Enter the `:PasteInsert` command just before entering insert mode to set up
the relevant hooks.  It takes neither range prefix nor arguments.

MAPPINGS				*paste_insert-mappings*

					*<Plug>(PasteInsert)*
The `<Plug>(PasteInsert)` map in normal mode just does `:PasteInsert`.

OPTIONS					*paste_insert-options*

					*g:paste_insert_cancel*
Set `g:paste_insert_cancel` to a |List| of the keys you want to cancel the
pending paste in normal mode.  This defaults to `['<C-C>', '<Esc>']`, for
CTRL-C and Escape.

The plugin will overwrite any existing normal mode maps for these keys during
the normal mode phase of the operation, but will try to restore them back
afterwards.  This works well in versions of Vim 7.3.032 or newer, but before
that patch, recursive maps and flags like <expr> or <silent> are broken,
although <buffer> should still work.  Either pick keys that you don't map, or
even better--upgrade your Vim!

AUTHOR					*paste_insert-author*

Written and maintained by Tom Ryder <tom@sanctum.geek.nz>.

LICENSE					*paste_insert-license*

Licensed for distribution under the same terms as Vim itself (see |license|).

 vim:tw=78:ts=8:ft=help:norl: