
Switching between files in Vim without fuzzy-finding everything
Most of the time, fuzzy-finding isn't what you need. You already know which file you want — you were just there. The real problem is getting back to it fast. Here's a progression from the fastest built-ins to a full fuzzy picker, ordered by how much setup each requires. 1) <C-^> — toggle the file you were just in If you're jumping between exactly two files — say, auth.go and auth_test.go — this is the only command you need. < C - ^ > Why it matters <C-^> switches to the alternate file , which is simply the last buffer you had open. No filename to type, no fuzzy search, no menu. Just one keystroke back where you were. Real scenario You jump to a test file with gd to look up an interface definition. You've read what you need. <C-^> lands you back at your implementation file, cursor exactly where you left it. Caveat This only remembers one previous file. The moment you open a third buffer, the earlier one is no longer the alternate. For two-file back-and-forth it's unbeatable; for broader
Continue reading on Dev.to
Opens in a new tab

