Giter Club home page Giter Club logo

better-escape.vim's Introduction

Description

A lot of people have been mapping jk or kj or kk to ESC in order to escape insert mode quickly. However, when we press the first key in these mappings, Vim will wait for timeoutlen milliseconds before writing this char to buffer. The apparent lag caused by this behaviour is annoying.

Better-escape.vim is a plugin to help Vim/Nvim users escape from insert mode quickly using their customized key combinations, without experiencing the lag.

Install

Use your favorite plugin manager to install it:

  • Use vim-plug: Plug 'jdhao/better-escape.vim'
  • Use dein: call dein#add('jdhao/better-escape.vim')

How to use?

The default shortcut for leaving insert mode is jk: first press j, then quickly press k, you will leave insert mode.

By default, the time interval threshold between pressing j and k is set to 150 ms. That is, if the time interval between pressing of k and j is above the threshold, jk will be inserted literally. Otherwise, we assume you want to leave insert mode. The time interval can be customized via option g:better_escape_interval:

" set time interval to 200 ms
let g:better_escape_interval = 200

If you want to use other shortcut, you can customize via option g:better_escape_shortcut:

" use jj to escape insert mode.
let g:better_escape_shortcut = 'jj'

Multiple shortcuts

Some people may prefer to use multiple shortcuts. This is also supported:

let g:better_escape_shortcut = ['jk', 'jj', 'kj', 'лл']

Doc

See :h better-escape.txt.

License

This plugin is released under the MIT License.

better-escape.vim's People

Contributors

jdhao avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.