Vimjas / vim-python-pep8-indent

A nicer Python indentation style for vim.
Creative Commons Zero v1.0 Universal
786 stars 69 forks source link

System wide installation #139

Closed bergentroll closed 4 years ago

bergentroll commented 4 years ago

I would like to make a package for Archlinux AUR, so I tried to install vim-python-pep8-indent system wide. I tried to put python.vim into the /usr/share/vim/vimfiles/indent/, but it does not work in such way. So I tried to put it into the /usr/share/vim/vimfiles/after/indent/, but it does not work too. I also tried to cut if exists('b:did_indent') statement to test, but it changes nothing. Therefore things work smoothely with Plug package manager or also when I manually source the python.vim.

Is such behaviour presented by design? I there a way to install script globally?

blueyed commented 4 years ago

I think putting it into /usr/share/vim/vimfiles/indent/ should work in general. Check :scriptnames and e.g. add something like unsilent echom "Loaded" there to see if it gets sourced in the first place.

bergentroll commented 4 years ago

Indeed, it works with neovim and it works with vim --clean. But python.vim has not been even loaded with plain vim some_file.py run, even when ~/.vimrc is empty. Seems like some specific case. Great thank you, @blueyed, I'll try to investigate it a bit deeper.

bergentroll commented 4 years ago

Fine, due to documentation Vim >= 8.0 needs manual sourcing of default config in .vimrc like this:

unlet! skip_defaults_vim
source $VIMRUNTIME/defaults.vim

Out of the box defaults.vim is being sourced only if ~/.vimrc is not presented.