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:
- Open the Command Palette by selecting
Preferences: NeoVintageous Settings
. - Add the following JSON configuration:json
{ "vintageous_enable_sneak": true }
Customize sneak mappings
You can customize the default sneak mappings by setting environment variables:
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:
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:
- Type Windows Key + R to open the "Run" dialog box.
- Enter "sysdm.cpl" and press the "OK" button. The "System Properties" dialog box will open.
- Select the "Advanced" tab and press the "Environment Variables..." button. The "Environment Variables" dialog box will open.
- 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.
- 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
Status | Command | Description |
---|---|---|
✅ | 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 |
s | Go to the [count] th next match | |
S | Go 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
Status | Command | Description |
---|---|---|
✅ | 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 |
s | Go to the [count] th next match | |
S | Go to the [count] th previous match |
Label mode
Status | Command | Description |
---|---|---|
<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.