vimtricks.wiki Concise Vim tricks, one at a time.

How do I see every Vim script and plugin file that has been loaded in the current session?

Answer

:scriptnames

Explanation

:scriptnames prints a numbered list of every Vim script file that has been sourced (loaded) during the current session, in the order they were loaded. This includes your vimrc, filetype plugins, syntax files, and all installed plugins — giving you complete visibility into what code is running in your Vim.

How it works

:scriptnames

Output (example):

  1: ~/.vimrc
  2: /usr/share/vim/vim90/syntax/syntax.vim
  3: ~/.vim/plugged/vim-surround/plugin/surround.vim
  4: ~/.vim/plugged/fzf.vim/plugin/fzf.vim
  ...

Each line shows:

  • A sequential number (load order)
  • The full path to the script file

When to use it

  • Debugging slow startup: see which plugins are loading (combine with --startuptime)
  • Finding conflicts: check if a plugin is actually being loaded
  • Locating files: find the exact path of a plugin or filetype script
  • Auditing: verify no unexpected scripts are being sourced

Example workflow

Find where a specific plugin loaded from:

:scriptnames
" then search with /surround in the output

Or filter with execute():

:echo join(filter(split(execute('scriptnames'), '\n'), 'v:val =~ "surround"'), '\n')

Tips

  • vim --startuptime /tmp/startup.log logs load times for each script — combine with :scriptnames for performance debugging
  • :verbose set {option}? tells you which specific script set an option; :scriptnames tells you which scripts loaded at all
  • The list only shows files sourced so far — lazy-loaded plugins may not appear until triggered
  • In Neovim, :scriptnames works identically

Next

How do I run a search and replace only within a visually selected region?