-
Notifications
You must be signed in to change notification settings - Fork 3
Quick Start
Get SmartMotion running in 60 seconds.
{
"FluxxField/smart-motion.nvim",
opts = {
presets = {
words = true,
lines = true,
search = true,
delete = true,
yank = true,
change = true,
paste = true,
treesitter = true,
diagnostics = true,
git = true,
quickfix = true,
marks = true,
misc = true,
},
},
}use {
"FluxxField/smart-motion.nvim",
config = function()
require("smart-motion").setup({
presets = {
words = true,
lines = true,
search = true,
delete = true,
yank = true,
change = true,
paste = true,
treesitter = true,
diagnostics = true,
git = true,
quickfix = true,
marks = true,
misc = true,
},
})
end,
}Restart Neovim (or source your config), then:
Press w → labels appear on words ahead → press a label → cursor jumps there
Press d → press w → labels appear → press a label → text deleted from cursor to that word
Press s → type characters → labels appear on matches as you type → press a label
Press ]] → labels appear on all function definitions → press a label
Press daf → labels appear on all functions → select one → entire function deleted
With cursor in a function call, press daa → labels appear on arguments → select one → argument deleted (including comma)
With all presets enabled, you have 140+ keybindings:
| Preset | Keys |
|---|---|
| words |
w b e ge
|
| lines |
j k
|
| search |
s S f F t T ; , gs
|
| delete |
d dt dT rdw rdl
|
| yank |
y yt yT ryw ryl
|
| change |
c ct cT
|
| paste |
p P
|
| treesitter |
]] [[ ]c [c ]b [b af if ac ic aa ia fn saa gS R
|
| diagnostics |
]d [d ]e [e
|
| git |
]g [g
|
| quickfix |
]q [q ]l [l
|
| marks |
g' gm
|
| misc |
. g. g0 g1-g9 gp gp1-gp9 gP gA-gZ gmd gmy
|
→ See Presets Guide for detailed explanations of each.
Don't want to override native keys? Enable selectively:
presets = {
-- Only enable these presets
search = true,
treesitter = true,
diagnostics = true,
}Or enable a preset but exclude specific keys:
presets = {
words = {
e = false, -- don't override 'e'
ge = false, -- don't override 'ge'
},
search = true,
}Change the hint characters (home row recommended):
opts = {
keys = "fjdksleirughtynm", -- default
-- or for Colemak:
-- keys = "arstneio",
}Change colors:
opts = {
highlight = {
hint = { fg = "#FF2FD0" },
two_char_hint = { fg = "#2FD0FF" },
dim = "Comment",
},
}opts = {
-- Hint characters (first char = most common)
keys = "fjdksleirughtynm",
-- Flow state timeout (ms) - how long between motions to stay in "flow"
flow_state_timeout_ms = 300,
-- Auto-jump when only one target exists
auto_select_target = false,
-- Show labels during native / search (toggle with <C-s>)
native_search = true,
-- Dim non-target text
disable_dim_background = false,
-- Open folds at target position after jumping
open_folds_on_jump = true,
-- Save position to jumplist before jumping (j/k excluded to match native vim)
save_to_jumplist = true,
-- Search auto-proceed timeout (ms)
search_timeout_ms = 500,
-- Yank highlight flash duration (ms)
yank_highlight_duration = 150,
}You're ready to use SmartMotion. Here's where to go next:
→ Presets Guide: Every preset explained with examples
→ Advanced Features: Flow state, multi-window, operator-pending mode
→ Build Your Own Motions: Create custom motions in minutes
→ Configuration: All options explained
Getting Started
Using SmartMotion
Customizing
Building Your Own
Reference