Recommended
- Before you start, update your vim to the last version. If using
debian
, install vim.nox
(python support) and run update-alternatives
for vim
, vi
and vimdiff
.
How-to
Using vim-plug I've managed to create a global plugin installation.
This is a step-by-step explanation;
- create
/etc/vim/autoload
. Make sure others can read/execute the directory.
- add
plug.vim
file in it. Make sure all users can read it. See below: Download
add to (preferred the begin of) your /etc/vim/vimrc.local
set runtimepath+=/etc/vim/autoload
" Initialize plugin system
call plug#begin('/etc/vim/plugged')
" Vimtemplates - templates for diverse files
Plug 'drbeco/vimtemplates', { 'do': '/etc/vim/plugged/vppinstall.sh' }
" VimColors8 - colorschemes for all
Plug 'drbeco/vimcolors8', { 'do': '/etc/vim/plugged/vppinstall.sh' }
call plug#end()
" End of initialization of plugin system
The two plugins (repositories) above, namely drbeco/vimtemplates
and drbeco/vimcolors8
are optional and are there just to test the installation. You need some plugin there to run :PlugInstall
and this two are small, easy and compatible. Feel free to change, but I recommend you first install all, check if it is ok, then change all vim-plug
session to your taste.
- Create a directory
/etc/vim/plugged/
. Make sure all users can read/execute it.
Add the following script to the plugged
directory (make it executable):
$ cat /etc/vim/plugged/vppinstall.sh
#!/bin/bash
# notice
echo "vppinstall.sh (C) 2017 Dr. Beco: Correcting plugin's permissions"
# work in plugged directory
cd /etc/vim/plugged
# execute (open) and read directories
find . -type d ! -wholename "*/.git*" -exec chmod o+rx {} \;
# read all files
find . -type f ! -wholename "*/.git*" -exec chmod o+r {} \;
This script will run as post-installation hook to correct the permissions of the files. You can set stick-bits or redefine your UMASK instead of running this script, but unless you know the security risks I don't recommend.
Almost done.
- Reload .vimrc and run :PlugInstall to install plugins.
For each new plugin you add to your
vimrc.local
, make sure it calls the post-installation script, or else users won't be able to use them.
--
Download
To download the plug.vim
file, use:
curl -fLo /etc/vim/autoload/plug.vim https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim