How do I open a file by name by searching through my project directories?
:find {filename}
:find searches for a file in all directories listed in the path option and opens it in the current window.
Search Vim Tricks
Searching...:find {filename}
:find searches for a file in all directories listed in the path option and opens it in the current window.
:set wildmode=longest:full,full
The wildmode option controls what happens when you press in the command line.
:keepmarks %s/pattern/replacement/g
The :keepmarks modifier prevents Vim from adjusting mark positions when a buffer-modifying command runs.
:set nowritebackup
By default, Vim saves files using a "write-then-rename" strategy: it writes to a temporary backup file and then renames it over the original.
:set virtualedit=onemore
By default, Vim's cursor cannot go past the last character of a line in normal mode — pressing $ lands on the final character, not after it.
luaeval('lua_expression')
When you have existing Vimscript code that needs to reach into Neovim's Lua ecosystem, luaeval() is the bridge.
:set noexpandtab | retab!
When you inherit space-indented code and need to switch to tabs, :retab! (with the bang) converts groups of spaces into tabs throughout the file.
"1 through "9
Vim maintains a rotating history of deleted text across registers "1 through "9.
<C-l> during / search
When searching with incsearch enabled, Vim highlights matches as you type.
crs / crm / crc / cru
The vim-abolish plugin by Tim Pope adds a cr (coerce) prefix command that instantly converts the word under the cursor between common naming conventions.
:set breakindentopt=shift:2
When breakindent is enabled, wrapped continuation lines are indented to match the start of their logical line.
as and is
Vim defines sentence text objects — as (around sentence) and is (inner sentence) — that allow any operator to act on an entire sentence in one motion.
vim.lsp.buf.code_action({ apply = true, filter = function(a) return a.isPreferred end })
When an LSP server marks a code action as isPreferred (e.
g^ and g$
When wrap is on, long lines wrap visually across multiple screen lines.
<C-k>{two-chars}
Vim's digraph system lets you type hundreds of special characters — arrows, fractions, accented letters, currency symbols, and more — using intuitive two-ch
vim.keymap.set('n', '{key}', {fn}, { desc = '{description}' })
When defining keymaps with vim.
!{motion}sort
The ! operator in Vim filters a motion's text through an external shell command, replacing it with the output.
vim.api.nvim_create_namespace('my_plugin')
Neovim's extmark system (for highlights, virtual text, and diagnostics) uses namespaces to group related marks.
vim.wo.number = true / vim.bo.tabstop = 2
Neovim's Lua API exposes three namespaces for setting options with the correct scope: vim.
vim.tbl_deep_extend('force', defaults, overrides)
vim.