Neovim is more than just a text editor—it's a highly extensible platform where mastering motions and navigation can dramatically increase your editing speed. In 2026, with Lua as the primary configuration language, combining built-in Vim motions with modern plugins like flash.nvim, mini.ai, and mini.surround turns Neovim into a productivity powerhouse.
This article explores advanced techniques with practical Lua code examples you can add to your init.lua or plugin files. Whether you're a power user or transitioning from basic Vim, these tricks will help you navigate and edit code faster.
Neovim's core motions (e.g., w/b for words, f/t for find, / for search) are powerful, but many users underutilize them. Combine with counts, operators, and text objects for lightning-fast edits.
Examples:
ciw → change inner worddf" → delete find next quote3j → jump 3 lines down* → search word under cursor forwardTo make these even faster, set a strong leader key (e.g., space) and remap common actions.
Flash.nvim replaces traditional f/t and search with label-based jumping. It shows jump targets with letters, letting you leap across the screen instantly.
Install with Lazy.nvim:
-- lua/plugins/flash.lua
return {
"folke/flash.nvim",
event = "VeryLazy",
opts = {
modes = {
char = { enabled = true },
search = { enabled = false }, -- optional: disable if you prefer native search
},
},
keys = {
{ "s", mode = { "n", "x", "o" }, function() require("flash").jump() end, desc = "Flash" },
{ "S", mode = { "n", "x", "o" }, function() require("flash").treesitter() end, desc = "Flash Treesitter" },
{ "r", mode = "o", function() require("flash").remote() end, desc = "Remote Flash" },
},
}
Now press s in normal mode and type the first few letters of the target word—Flash labels appear, and you press the label key to jump.
mini.ai extends Vim's text objects (a/i) with more intelligent selection, including arguments, indentation levels, and Treesitter-powered objects.
Setup:
-- lua/plugins/mini.lua
return {
"echasnovski/mini.ai",
event = "VeryLazy",
dependencies = { "nvim-treesitter/nvim-treesitter" },
config = function()
require("mini.ai").setup({
n_lines = 500, -- search range
search_method = "cover_or_next",
})
end,
}
Now you can do va= to select an argument in a function call, or vii to select an indented block.
mini.surround lets you add, delete, replace, find, and highlight surrounding characters (parentheses, quotes, tags) with simple keymaps.
Setup:
-- In the same mini.lua file
require("mini.surround").setup({
-- Add custom surroundings if needed
custom_surroundings = {
["b"] = { addition = {"(", ")"}, deletion = {"^%s*%(.-%)%s*$"} },
},
})
Keymaps (defaults): sa to add, sd to delete, sf to find, sr to replace.
Example: In visual mode, sa" surrounds selection with quotes.
Extend motions with custom functions. For example, a motion that jumps to the next comment line:
-- lua/custom/motions.lua
local function next_comment()
vim.fn.search("^\\s*//\\|^\\s*#\\|^\\s*\\*\\s", "W")
end
vim.keymap.set({"n", "x", "o"}, "]c", next_comment, { desc = "Next comment" })
vim.keymap.set({"n", "x", "o"}, "[c", function() vim.fn.search("^\\s*//\\|^\\s*#\\|^\\s*\\*\\s", "bW") end, { desc = "Prev comment" })
Now ]c jumps to the next comment, and d]c deletes until there.
Boost productivity with filetype-specific keymaps or settings:
-- lua/autocmds.lua
vim.api.nvim_create_autocmd("FileType", {
pattern = { "lua", "python", "javascript" },
callback = function()
vim.keymap.set("n", "rf", "!python %", { buffer = true, desc = "Run file" })
end,
})
This adds a buffer-local <leader>rf to run Python files directly.