*better-escape.txt* Last change: 2022-02-05 Escaping insert mode without lagging! Author : Jiedong Hao 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