vim-isort icon indicating copy to clipboard operation
vim-isort copied to clipboard

The contents of `plugin/python_vimisort` is not a valid vimscript

Open char101 opened this issue 7 years ago • 2 comments

I am using this plugin with vim package on Windows and got this error:

Error detected while processing vim\package\40-filetype_python\isort\plugin\python_vimisort.vim:
line    1:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name '_vimisort' is not defined

Is that supposed to be a symlink or something? I think the right content of plugin\python_vimisort should be

runtime ftplugin\python_vimisort.vim

char101 avatar Sep 10 '18 07:09 char101

Also AFAIK pathogen adds the plugin path into &rtp so it should not have any problem with ftplugin.

char101 avatar Sep 10 '18 07:09 char101

Had the same issue on my vim setup when running on windows, and changed as pointed out to:

runtime ftplugin\python_vimisort.vim

And it worked.

On my Linux setup, I checked and it's is a symlink to the actual file. So I changed it to be a file with the command explained at the top and it also works :)

What happens is windows don't deal with symlinks the same way POSIX systems do, so by default git, when cloning repositories is that git on windows by default sets the config core.symlinks to false. So symlinks will be conned as plain textfiles.

You can have more info on that here: https://stackoverflow.com/questions/11662868/what-happens-when-i-clone-a-repository-with-symlinks-on-windows/11664406

As pointed at the link even setting symlinks to true you need to have administrator rights to be able to properly set up the policies, and you need to be cloning to a NTFS portion instead of a FAT one, so the approach suggested by @char101 is a great solution for the case to keep it multiplatform and with an easier setup.

humrochagf avatar Aug 31 '21 18:08 humrochagf