How do I fuzzy-search and run any available Vim command using fzf.vim?
Answer
:Commands
Explanation
fzf.vim's :Commands opens an interactive fuzzy picker over every Ex command that Vim currently knows — built-ins, plugin-defined commands, and your own user commands. You can type to filter, preview the command definition, and press <CR> to execute it (or <C-x> to insert it at the command line without running).
How it works
- Requires the
fzfandfzf.vimplugins to be installed :Commandscollects the output of:commandand presents it through fzf's filtering UI- Each entry shows the command name and its definition or source
- Pressing
<CR>on a selection places the command on the command line, ready to run (or with a count/bang if you add it first)
Example
You vaguely remember there's a :Git... command from vim-fugitive but can't recall the exact name:
:Commands
Type git in the fzf prompt — all Git* commands appear immediately. Select :Gitsigns preview_hunk or :Gdiffsplit and press <CR>.
Tips
- Pair with
:Maps(also from fzf.vim) to fuzzy-search all current keymappings — invaluable for discovering plugin bindings :Helptagslets you fuzzy-search Vim help tags, and:Helpopens the matching help entry directly- You can bind
:Commandsto a leader key:nnoremap <leader>fc :Commands<CR> - The complementary
:History:fuzzy-searches your command-line history, while:History/searches your search history