← Back to articles

File Navigation in LazyVim

Path: Computer Tech/Development/Editors/Neovim/LazyVim Workflows/File Navigation in LazyVim.mdUpdated: 2/3/2026

File Navigation in LazyVim

Fast file navigation is the foundation of efficient coding. LazyVim provides multiple tools for finding and opening filesβ€”learn when to use each one.

The Three Ways to Navigate

  1. Telescope - Fuzzy finding (most common)
  2. Neo-tree - File explorer (visual browsing)
  3. Buffer navigation - Switch between open files

Telescope - Fuzzy Finding

Telescope is your primary navigation tool. It's a fuzzy finder that searches files, text, symbols, and more.

Find Files

Space + f + f

How it works:

  • Type partial filename (fuzzy match)
  • No need for exact matches or paths
  • Instant results as you type

Examples:

# Project structure:
src/components/UserProfile.tsx
src/utils/formatDate.ts
tests/components/UserProfile.test.tsx

# Find "UserProfile.tsx":
Space + f + f
Type: "upro"       β†’ Matches UserProfile.tsx
Type: "userpro"    β†’ Also matches
Type: "cmp/user"   β†’ Also matches (path aware)

Pro tips:

  • Use Ctrl+j / Ctrl+k to move down/up in results
  • Enter to open file
  • Ctrl+x to open in horizontal split
  • Ctrl+v to open in vertical split
  • Ctrl+t to open in new tab

Search Text in Files (Grep)

Space + s + g

Find any text across your entire project:

Space + s + g
Type: "function handleClick"
β†’ Shows all files containing that text
β†’ Shows line number and preview

Use cases:

  • Find where a function is defined
  • Find all TODOs
  • Find API endpoint usage
  • Find error messages

Pro tip: Use regex:

Space + s + g
Type: "const.*=.*useState"
β†’ Finds all useState declarations

Find Recent Files

Space + f + r

Shows files you recently opened:

  • Faster than fuzzy finding when you just edited a file
  • Great for switching between 2-3 files repeatedly

Find Buffers (Open Files)

Space + f + b

Lists currently open files:

  • Use this instead of cycling with :bn / :bp
  • Type partial filename to filter

Example workflow:

# You have 10 files open
Space + f + b
Type: "user"
β†’ Shows only UserProfile.tsx, UserSettings.tsx
Enter β†’ Opens selected file

Find Symbols (Go to Symbol)

Space + s + s

Shows all functions, classes, variables in current file:

javascript
// Your file has:
function handleSubmit() {}
function validateForm() {}
const API_URL = "..."
class UserService {}

Space + s + s
Type: "valid"
β†’ Jump directly to validateForm()

Great for navigating large files without scrolling.

Find Git Files

Space + f + g

Only shows files tracked by git:

  • Ignores node_modules, build artifacts, etc.
  • Faster than Space + f + f in large repos

Neo-tree - File Explorer

Visual file browser for when you need to see directory structure.

Toggle Explorer

Space + e

Navigation:

  • j / k - Move up/down
  • Enter - Open file or expand folder
  • a - Create new file/folder
  • d - Delete
  • r - Rename
  • c - Copy
  • x - Cut
  • p - Paste
  • q - Close explorer

Keybindings in Neo-tree:

KeyAction
aAdd (create file/folder)
dDelete
rRename
cCopy
xCut
pPaste
yCopy filename
YCopy relative path
gyCopy absolute path
oOpen file
sOpen in split
tOpen in tab

When to Use Neo-tree

Use Neo-tree when:

  • βœ… Exploring unfamiliar codebase
  • βœ… Need to see folder structure
  • βœ… Creating/deleting/renaming multiple files
  • βœ… Visual context helps you think

Use Telescope when:

  • βœ… You know the filename
  • βœ… Quick file switching
  • βœ… Searching for text
  • βœ… You're already in flow state

Buffer Navigation

Buffers are open files in memory.

Switch Between Buffers

]b    # Next buffer
[b    # Previous buffer

Or use Telescope:

Space + f + b

Close Buffer

Space + b + d    # Close current buffer

List All Buffers

Space + f + b    # Telescope buffer search

Or see buffer list:

:buffers         # Show numbered list
:b <number>      # Jump to buffer number
:b <partial>     # Jump to buffer by partial name

Window (Split) Navigation

Windows are the visible panes on screen.

Navigate Between Windows

Ctrl + h    # Left window
Ctrl + j    # Down window
Ctrl + k    # Up window
Ctrl + l    # Right window

Create Splits

Ctrl + w + s    # Horizontal split
Ctrl + w + v    # Vertical split

Close Window

Ctrl + w + c    # Close current window
Ctrl + w + o    # Close all other windows (keep current)

Resize Windows

Ctrl + w + =    # Equal size
Ctrl + w + >    # Wider
Ctrl + w + <    # Narrower
Ctrl + w + +    # Taller
Ctrl + w + -    # Shorter

Tab Navigation

Tabs are collections of windows.

Tab Management

Space + <tab> + l    # List tabs
Space + <tab> + n    # New tab
Space + <tab> + d    # Close tab
gt                   # Next tab
gT                   # Previous tab

Tabs are useful when:

  • Working on two separate features simultaneously
  • Keeping different contexts (e.g., code vs config files)

Most people don't need tabsβ€”buffers + splits are enough.

Real-World Workflows

Scenario 1: "I need to edit UserProfile.tsx"

Method 1: Telescope (fastest)

Space + f + f
Type: "upro"
Enter

Method 2: Neo-tree (visual)

Space + e
Navigate to src/components/
Enter on UserProfile.tsx

Scenario 2: "Where is the login function defined?"

Space + s + g
Type: "function login"
Enter on result

Scenario 3: "Switch between 3 files I'm actively editing"

# First time: Open via Telescope
Space + f + f β†’ Open File1
Space + f + f β†’ Open File2
Space + f + f β†’ Open File3

# Then: Quick switch via buffers
Space + f + b
Type partial filename
Enter

Scenario 4: "Navigate large file"

# Inside the file:
Space + s + s       # Symbol search
Type function name
Enter β†’ Jump there

Scenario 5: "Explore new codebase"

Space + e           # Open file explorer
Navigate folders
j/k to move
Enter to open files

Advanced Techniques

Jump to Definition (LSP)

gd    # Go to definition

This is NOT file navigationβ€”it's code intelligence:

  • Cursor on a function name
  • Press gd
  • Jumps to where it's defined (even in another file)

Go back:

Ctrl + o    # Jump back
Ctrl + i    # Jump forward

Jump List

Neovim tracks everywhere you've been:

Ctrl + o    # Jump to older position
Ctrl + i    # Jump to newer position

Example:

1. You're in File A
2. Press gd β†’ Jump to File B
3. Press gd β†’ Jump to File C
4. Press Ctrl+o β†’ Back to File B
5. Press Ctrl+o β†’ Back to File A

Marks

Set marks to bookmark locations:

m + a    # Set mark 'a' at cursor
`a       # Jump to mark 'a'
:marks   # List all marks

Use marks for:

  • Temporary bookmarks within a file
  • Quick navigation between important spots

Search and Replace in Multiple Files

# 1. Find all occurrences
Space + s + g
Type: "oldFunction"

# 2. Send results to quickfix list
Ctrl + q

# 3. Search and replace
:cdo s/oldFunction/newFunction/g

# 4. Save all changes
:wa

Keyboard Shortcut Summary

ActionKeybindingWhen to Use
Find filesSpace f fKnow filename, quick navigation
Find textSpace s gSearch across all files
Recent filesSpace f rRecently edited files
File explorerSpace eVisual browsing, creating files
BuffersSpace f bSwitch between open files
SymbolsSpace s sNavigate within file
Next buffer]bCycle through open files
Go to defgdJump to function definition
Jump backCtrl oUndo jump
Jump forwardCtrl iRedo jump

Pro Tips

  1. Default to Telescope - It's fast and works for 90% of navigation
  2. Learn fuzzy matching - Type "upr" instead of "UserProfile", it's faster
  3. Use Neo-tree sparingly - Only when you need visual context
  4. Master jump list (Ctrl+o / Ctrl+i) - Navigate your code history
  5. Don't overuse tabs - Buffers are usually enough
  6. Memorize gd - Jump to definition is the most used LSP feature

Common Mistakes

❌ Using arrow keys in Telescope β†’ Use Ctrl+j / Ctrl+k instead (faster)

❌ Scrolling through file explorer β†’ Use Telescope fuzzy find instead

❌ Opening too many splits β†’ Keep it simple: 2-3 splits max

❌ Not learning jump list β†’ Ctrl+o is how you navigate code efficiently

Related: