Open auwsmit opened 7 years ago
This tool was made with Linux/OS X in mind, so making it work on Windows might require some modifications.
It seems that subprocess.call
cannot find gvim
: does running gvim
in your shell alone works?
As for vim
, it seems that the script could not find your plugin directory. Could you provide more information on your setup (e.g. where are the plugins located)?
This tool was made with Linux/OS X in mind, so making it work on Windows might require some modifications.
It's cool and somewhat expected, Windows always gets the short end of the foss-stick :P
does running
gvim
in your shell alone works?
Yeah, both it and regular vim are in my PATH environment variable
Could you provide more information on your setup (e.g. where are the plugins located)?
The vim folder in Windows is located at $HOME/vimfiles
, and I used vim-plug
, so they're under the plugged
folder. However, it probably isn't related to plugin location because I was able to use the profiler just fine on Debian with my same vim setup.
Either way, thanks for the useful tool!
Figured out the gvim
error! The Windows installer uses .bat
files to launch the executable files, so by using the direct path, I don't get all the errors anymore:
X:\Desktop>vim-profiler.py "C:\Program Files (x86)\Vim\vim80\gvim.exe"
Running C:\Program Files (x86)\Vim\vim80\gvim.exe to generate startup logs... done.
Loading and processing logs...
No plugin found. Exiting.
X:\Desktop>vim-profiler.py "C:\Program Files (x86)\Vim\vim80\vim.exe"
Running C:\Program Files (x86)\Vim\vim80\vim.exe to generate startup logs... done.
Loading and processing logs...
No plugin found. Exiting.
However, it still can't find plugins
If you're familiar with Python, you can take a look at the __guess_plugin_dir
method. This is probably where something goes wrong (user plugin directory detection fails). Can you try to run the profiler with the -s
option? It will take system plugins into account as well.
We could probably add appveyor support as well, that would allow ensuring continuous support for Windows.
It is because all regex search are written as
"sourcing (.+?)/(?:[^/]+/)(?:%s)/[^/]+"
which should be
r"sourcing (.+?)\\(?:[^\\]+\\)(?:%s)\\[^\\]+"
for Windows.
Delimiters are hard-coded as /
.
Also, self.system_dirs = ["/usr", "/usr/local"]
makes no sense for Windows. I simply give it an empty list.
After fixing these problems, it runs successfully on Windows for both vim and gvim.
PS R:\vim-profiler-master> python win.py D:\Vim\vim80\gvim.exe
Running D:\Vim\vim80\gvim.exe to generate startup logs... done.
Loading and processing logs... done.
Plugin directory: D:\\Vim\\vimfiles\\plugged
=======================================================================
Top 10 plugins slowing D:\Vim\vim80\gvim.exe's startup
=======================================================================
1 6.000 base16-vim
2 5.000 nerdcommenter
3 4.000 vim-airline
4 3.000 fencview
5 2.000 vim-airline-themes
6 1.000 vim-toml
7 1.000 auto-pairs
8 1.000 vim-expand-region
9 0.000 vim-json
10 0.000 vim-stylus
However, instead of using regex on full paths, pathlib.Path.parts
or os.path.split
should be more elegant and predicable. These built-in libraries are designed for cross-platform and complex environments (Network drives, UNC, symbol links, etc.).
Here's what happens when I try to run gvim from the command-line:
And regular vim isn't detected:
I have 32-bit vim 8 from this repo, with Python 2.7.0 and Python 3.4.0 installed