-
Notifications
You must be signed in to change notification settings - Fork 6
/
better-escape.txt
84 lines (65 loc) · 2.97 KB
/
better-escape.txt
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
*better-escape.txt* Last change: 2022-02-05
Escaping insert mode without lagging!
Author : Jiedong Hao <[email protected]>
License : MIT license
Requirement: Vim 7.4 (patch 7.4.1730) or Neovim 0.4+
==============================================================================
CONTENTS *better-escape-contents*
INTRODUCTION |better-escape-introduction|
USAGE |better-escape-usage|
CONFIGURATION |better-escape-configuration|
==============================================================================
INTRODUCTION *better-escape-introduction*
A lot of people have used `jk` or `kj` or `kk` mappings in insert mode in order to
leave the insert mode quickly. However, when you press the first key in these
mappings, Vim will wait for |timeoutlen| milliseconds before writing this char
to buffer, which is annoying.
Better-escape.vim is a Vim/Neovim plugin to enable the users to escape from
insert mode quickly using their customizied key combinations, without
experiencing the lag
==============================================================================
USAGE *better-escape-usage*
The default shortcut for leaving insert mode is `jk`. First press `j`, then
quickly press `k`, you will leave insert mode.
==============================================================================
CONFIGURATION *better-escape-configuration*
g:better_escape_shortcut *g:better_escape_shortcut*
Type: |String| or |List|
Default: `['jk',]`
This is a list of shortcuts you use to escape from insert mode. Each
shortcut must must have two characters. You can adjust |g:better_escape_interval|
to change the time interval between pressing the two chars in the
shortcut.
Example:
>
let g:better_escape_shortcut = 'jj'
let g:better_escape_shortcut = ['jk', 'jj', 'kj', 'лл']
<
g:better_escape_interval *g:better_escape_interval*
Type: |Number|
Default: `150`
This is the time interval (in milliseconds) between the successive
pressing of two characters in |g:better_escape_shortcut|. If the time
interval between the pressing of these two keys are above this value, the
two characters will be inserted literally.
Example:
>
" set time interval to 200 ms
let g:better_escape_interval = 200
>
>
g:better_escape_debug *g:better_escape_debug*
Type: |Number|
Default: `0`
Sometimes, you may wonder why the given escape shortcut does not work as
intended. Maybe it is because you have not pressed the two keys fast
enough. If you turn on this option, it will print some debug messages to
the message history, including the actual key press interval between the
two characters in the escape shortcut.
Example:
>
" turn on debug mode
let g:better_escape_debug = 1
>
==============================================================================
vim:ft=help