How do I jump anywhere on screen with labeled targets using flash.nvim?
Answer
:lua require('flash').jump()
Explanation
flash.nvim by folke is a Neovim plugin that overlays short, unique jump labels on every visible match so you can teleport the cursor anywhere on screen in two or three keystrokes. It enhances and replaces f/F/t/T motions and also provides treesitter-aware selection and remote operator support.
How it works
Flash integrates with Neovim's search infrastructure. After pressing the trigger key (s by default), you type one or two characters. Flash highlights all matches on screen with a single-letter label. Type the label to jump.
Default mappings (set during require('flash').setup()):
s— jump to any position on screen (replaces vim-sneak-styles)S— treesitter-aware jump that also selects the target node visuallyr(in operator-pending mode) — remote flash: apply any operator to a distant target without moving the cursor first
Example setup:
require('flash').setup({
modes = {
search = { enabled = true }, -- enhance / with flash labels
char = { enabled = true }, -- enhance f/F/t/T
},
})
Example
You want to delete a word three lines above without leaving your current position:
- Press
d(delete operator) - Press
r(remote flash in operator-pending mode) - Type the first letter of the target word — flash shows labels
- Type the label — the word is deleted and the cursor returns
This is equivalent to jumping up, performing the operation, then jumping back — but in one fluid motion.
Tips
- Enhanced
/: withmodes.search = { enabled = true }, flash adds labels to incremental search results, letting you jump to any match instantly instead of repeatedly pressingn - Treesitter select (
S): jumps to the nearest node of a selected treesitter type — ideal for selecting function arguments, blocks, or statements precisely - Repeat jumps: use
;and,to repeat the last flash jump forward and backward - Flash labels are case-sensitive uppercase letters by default, minimizing conflicts with typed characters
- Works with
count:3slimits flash to the first 3 matches