Is there a syntime equivalent global command that can track the overall Vim performance? I am having trouble debugging the cause for a set of very-slow file-operations on a Windows machine.

Since these operations are done in an active Vim session, the following syntax that tracks only file-opening events are not enough: gvim --startuptime d:\timelog.log the_file


You can profile and measure time Vim spends on executing functions and scripts. For more details, run :h profile in Vim.

Here's an example:

profile start ~/vim-profile.log
profile file ~/.vim/*
profile func foo#*

This will profile functions that start with foo# under ~/.vim/ and log the output in ~/vim-profile.log.

  • I do understand the syntax, but what if I don't have a function to track? I am trying to first find out what has been causing a very-slow file operation (opening a file and switching buffer are taking more than 2 seconds in some occasions). Thus, I am asking for a time-logging method that can yield similar output to the` --startuptime`, but rather for all internal Vim operations.
    – llinfeng
    May 13 '17 at 14:37
  • @llinfeng Have you tried loading this file with Vim from command-line, including the --startuptime? e.g. vim SLOWFILE.md --startuptime /tmp/vim.log +q
    – rafi
    May 18 '17 at 17:30
  • Have just tried what you said, and I saw a detailed list composed of each and every .vim files through the --startuptime``. Yet, no function was mentioned at all. Yet, I have found why my gvim.exe` is slowing down in my Windows machine: it has to do with the way I start it. On my Windows machine, I use AutoHotKey on a daily basis. For some yet unknown reason, gvim.exe processes started by AutoHotKey is SLOW. Yet, gvim.exe processes started through the Windows Run window, or the Command Prompt, are fast and responsive.
    – llinfeng
    May 18 '17 at 23:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.