Giter Site home page Giter Site logo

3-chars label? about vim-sneak HOT 2 CLOSED

nyngwang avatar nyngwang commented on June 1, 2024
3-chars label?

from vim-sneak.

Comments (2)

ggandor avatar ggandor commented on June 1, 2024 2

vim-sneak/doc/sneak.txt

Lines 379 to 411 in 94c2de4

sneak#wrap(op, inputlen, reverse, inclusive, label) *sneak#wrap()*
Sneaks with exactly {inputlen} characters. For example with {inputlen}
of 2 the search is performed when the second character is typed,
without waiting for <Enter>.
Parameters:
{op}: operator name: empty string "" for normal-mode,
otherwise |v:operator|, |visualmode()|, or custom.
{inputlen}: wait for this many input keys
{reverse}: 0: forward motion
1: backward motion
{inclusive}: 0: |t|-like motion
1: |f|-like motion
2: |exclusive| motion like |/|
{label}: 0: never invoke |sneak-label-mode|
1: label-mode for >=2 matches
2: label-mode always
Example: Configure "f" to trigger label-mode: >
nnoremap <silent> f :<C-U>call sneak#wrap('', 1, 0, 1, 1)<CR>
nnoremap <silent> F :<C-U>call sneak#wrap('', 1, 1, 1, 1)<CR>
xnoremap <silent> f :<C-U>call sneak#wrap(visualmode(), 1, 0, 1, 1)<CR>
xnoremap <silent> F :<C-U>call sneak#wrap(visualmode(), 1, 1, 1, 1)<CR>
onoremap <silent> f :<C-U>call sneak#wrap(v:operator, 1, 0, 1, 1)<CR>
onoremap <silent> F :<C-U>call sneak#wrap(v:operator, 1, 1, 1, 1)<CR>
<
Example: Configure "s" to wait for 3 characters: >
nnoremap <silent> s :<C-U>call sneak#wrap('', 3, 0, 2, 1)<CR>
nnoremap <silent> S :<C-U>call sneak#wrap('', 3, 1, 2, 1)<CR>
xnoremap <silent> s :<C-U>call sneak#wrap(visualmode(), 3, 0, 2, 1)<CR>
xnoremap <silent> S :<C-U>call sneak#wrap(visualmode(), 3, 1, 2, 1)<CR>
onoremap <silent> s :<C-U>call sneak#wrap(v:operator, 3, 0, 2, 1)<CR>
onoremap <silent> S :<C-U>call sneak#wrap(v:operator, 3, 1, 2, 1)<CR>

from vim-sneak.

justinmk avatar justinmk commented on June 1, 2024

See docs as noted. The README.md also has hints.

from vim-sneak.

Related Issues (20)

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.