2

I am using a Windows 10, 64 bit machine, with gvim 8.1.1 installed (See screenshots below). I am using Vi version 8.1 which was installed as part of my git bash - version 4.4.23.

I have never installed plugins for vi/gvim and am starting out by trying to install the typescript syntax highlighting plugin that is available here - https://github.com/leafgarland/typescript-vim .

After following the instructions to install the plugin (running the git clone command on the front page), I can see that Vi has syntax highlighting for typescript. But gvim still doesn't. I can see the plugin files in my directory. What else do I need to do to make sure my Vi plugins are also functional in gvim? Or is this not possible? Do I need to install gvim plugins separately from Vi plugins?

enter image description here enter image description here enter image description here enter image description here enter image description here enter image description here

  • 1
    What is output of :set rtp? in both Vims? – Matt Sep 20 at 5:04
  • In vi runtimepath=~/.vim,~/.vim/pack/typescript/start/typescript-vim,/usr/share/vim/vimfiles,/usr/share/vim/vim81,/usr/share/vim/vimfiles/after,~/.vim/after in gvim runtimepath=~/vimfiles,C:\Program Files (x86)\Vim/vimfiles,C:\Program Files (x86)\Vim\vim81,C:\Program Files (x86)\Vim\vim81\pack\dist\opt\matchit,C:\Program Files (x86)\Vim/vimfiles/after,~/vimfiles/after – Chaitanya Sep 20 at 5:30
  • so you need to add ~.vim to your runtime path and possibly also to the packpath of your gvim. – Christian Brabandt Sep 20 at 6:08
1

So it appears you're using native Windows gvim (as expected), but the plugin was installed by msys/cygwin/WSL Vim. Windows and Unix builds use different set of config directories (see :h 'rtp'), so they end up seeing the different sets of plugins.

Personally, I use a symlink to resolve a similar issue:

  1. Make directory symlink from C:\Users\[username]\vimfiles to X:\msys64\home\[user]\.vim
  2. Move .vimrc to .vim/vimrc (that's not strictly necessary, but IMO it makes sense to write the config once with a help of a few ifs ).

Now both your Vims should see the same configuration (except viminfo and mksession).

  • 1
    What are the commands I need to create the symlinks again? Also, I didn't install cygwin. The bash prompt was installed as part of the git for windows install. I didn't enable WSL myself (although that might have been done as part of the base image on developer machine). Does that change your answer? Not sure what the x:\msys64 part is coming from either. – Chaitanya Sep 20 at 6:59
  • 1
    @Chaitanya 1) You can use mklink command which was introduced in Windows Vista back in 2000s, or some capable file manager, such as Far, or google to find yet another way; 2) This is the path to your home directory under bash/git for Windows environment. It's up to you to know what it is. – Matt Sep 20 at 7:31

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.