Skip to content

Sneak Since 1.21

Sneak is a port of vim-sneak by @justinmk.

By default, Sneak is disabled to prevent conflicts with certain Vim commands such as s, S, z, and Z. To enable Sneak, follow these steps:

  1. Open the Command Palette by selecting Preferences: NeoVintageous Settings.
  2. Add the following JSON configuration:
    json
    {
        "vintageous_enable_sneak": true
    }

Customize sneak mappings

You can customize the default sneak mappings by setting environment variables:

sh
NEOVINTAGEOUS_SNEAK_MAP_S=s
NEOVINTAGEOUS_SNEAK_MAP_BIG_S=S
NEOVINTAGEOUS_SNEAK_MAP_Z=z
NEOVINTAGEOUS_SNEAK_MAP_BIG_Z=Z
Linux and Mac setup example

You could add the following lines to your ~/.profile, ~/.bashrc, or relevant shell file:

sh
export NEOVINTAGEOUS_SNEAK_MAP_S=s
export NEOVINTAGEOUS_SNEAK_MAP_BIG_S=S
export NEOVINTAGEOUS_SNEAK_MAP_Z=z
export NEOVINTAGEOUS_SNEAK_MAP_BIG_Z=Z

NOTE

You may need to reboot your system for the environment variables to take effect.

Windows setup example:

You can set environment variables for each user separately through the System Properties dialog box. The steps to do that:

  1. Type Windows Key + R to open the "Run" dialog box.
  2. Enter "sysdm.cpl" and press the "OK" button. The "System Properties" dialog box will open.
  3. Select the "Advanced" tab and press the "Environment Variables..." button. The "Environment Variables" dialog box will open.
  4. Select an existing variable in the "User variables" list and press the "Edit..." button to edit it. Or press the "New..." button to add a new variable.
  5. After you finished editing variables, press the "OK" button to save the changes.

NOTE

You may need to reboot your system for the environment variables to take effect.

Why environment variables?

The necessity to configure these mappings through environment variables, rather than conventional settings, arises from an implementation detail: plugins are loaded during startup, and access to settings is not available at this stage. Resolving this issue will require making significant design adjustments. In the meantime, employing environment variables provides a solution.

Settings

vintageous_enable_sneak

  • Type: boolean
  • Default: false

Enable sneak plugin.

vintageous_sneak_use_ic_scs

  • Type: integer
  • Default: 0

Case sensitivity mode for Sneak.

Set this value to 0 for always case-sensitive.

Set this value to 1 for based on 'ignorecase' and 'smartcase'.

Status

Normal mode

StatusCommandDescription
s{char}{char}Go to the next occurrence of {char}{char}
S{char}{char}Go to the previous occurrence of {char}{char}
s{char}<Enter>Go to the next occurrence of {char}
S{char}<Enter>Go to the previous occurrence of {char}
s<Enter>Repeat the last Sneak.
S<Enter>Repeat the last Sneak, in reverse direction.
;Go to the [count]th next match
, or \Go to the [count]th previous match
sGo to the [count]th next match
SGo to the [count]th previous match
[count]s{char}{char}Invoke sneak-vertical-scope
[count]S{char}{char}Invoke backwards sneak-vertical-scope
{operator}z{char}{char}Perform {operator} from the cursor to the next occurrence of {char}{char}
{operator}Z{char}{char}Perform {operator} from the cursor to the previous occurrence of {char}{char}

Visual mode

StatusCommandDescription
s{char}{char}Go to the next occurrence of {char}{char}
Z{char}{char}Go to the previous occurrence of {char}{char}
s{char}<Enter>Go to the next occurrence of {char}
Z{char}<Enter>Go to the previous occurrence of {char}
s<Enter>Repeat the last Sneak.
Z<Enter>Repeat the last Sneak, in reverse direction.
;Go to the [count]th next match
, or \Go to the [count]th previous match
sGo to the [count]th next match
SGo to the [count]th previous match

Label mode

StatusCommandDescription
<Space> or <Esc>Exit sneak-label-mode where the cursor is.
<Tab>Label the next set of matches.
<BS> or <S-Tab>Label the previous set of matches.

Check out the roadmap for a detailed inventory of feature status.