Back to Blog

Learn Vim Navigation: Search, Marks, Buffers & Splits | Episode 3

Sandy LaneSandy Lane

Video: Learn Vim Navigation: Search, Marks, Buffers & Splits | Episode 3 by Taught by Celeste AI - AI Coding Coach

Watch full page →

Learn Vim Navigation: Search, Marks, Buffers & Splits

Mastering navigation in Neovim dramatically improves your editing speed and efficiency. This guide covers essential commands for searching text, setting marks, managing buffers, and working with splits, empowering you to move fluidly through your code and files.

Code

" Search forward for 'pattern'
/pattern

" Search backward for 'pattern'
?pattern

" Repeat last search forward
n

" Repeat last search backward
N

" Search for word under cursor forward
*

" Search for word under cursor backward
#

" Find character 'x' on current line (forward)
fx

" Move till character 'x' on current line (before x)
tx

" Find character 'x' backward on current line
Fx

" Move till character 'x' backward on current line (after x)
Tx

" Repeat last f/t/F/T command forward
;

" Repeat last f/t/F/T command backward
,

" Jump to matching bracket under cursor
%

" Set mark 'a' at current position
ma

" Jump to mark 'a'
'a

" Jump back in jumplist
Ctrl-o

" Jump forward in jumplist
Ctrl-i

" Open file 'filename'
:e filename

" List open buffers
:ls

" Go to next buffer
:bn

" Go to previous buffer
:bp

" Open vertical split with current file
:vs

" Open horizontal split with current file
:sp

" Navigate between splits (panes)
Ctrl-w h   " move to left pane
Ctrl-w j   " move to pane below
Ctrl-w k   " move to pane above
Ctrl-w l   " move to right pane

Key Points

  • Use / and ? to search forward and backward, then n and N to cycle through matches.
  • f, t, F, and T find characters on the current line with ; and , to repeat or reverse the search.
  • * and # instantly search for the word under the cursor forward and backward.
  • Marks (m{a-z}) let you bookmark locations, and '{a-z} jumps back to them quickly.
  • Buffers hold open files, splits display multiple views, and Ctrl-w navigates between panes efficiently.