Vim - Debugging


  1. https://github.com/c9s/vim-dev-plugin

current mapping of any key or key combination

current option value

for path option:

all autocommands currently associated with augroup

:autocmd <augroup_name>

it might be useful to check there are no duplicate autocommands.

Vim profiling

  1. https://www.reddit.com/r/vim/comments/2lw1fd/pretty_statuslines_vs_cursor_speed/cm18qgt/:
  1. Execute :profile start result | profile func *
  2. Do some stuff (moving cursor around or splitting windows)
  3. Quit Vim
  4. Open result file and go to the last part of the log, see what’s causing your editor heavy.
  1. https://superuser.com/a/747405/326775
  2. :help 'verbose'

say, to print every executed autocommand:

:set verbose=9

to print everything:

:set verbose=15

it’s possible to set verbose level and run a command in one go in order to understand what’s going on when command is run.

e.g., setting verbose level right before opening a file can be used to find out the reason why syntax highlighting is lost:

:set verbose=15 | edit foo.js

when debugging a plugin, messages printed inside the plugin with echom[sg] are not saved in message history (:messages) - use echoe[rr] instead.