Repository: junegunn/vim-plug

Issue #903: [question]  How to install plugins locally and also use the system wide plugins like what pip does for Python packages?
Created: 2019-11-09T10:03:34Z
I want to set up neovim for all users of my Linux server, and I use vim-plug to manage the plugins.
The part about plugin installation is something like the following:
let g:PLUGIN_HOME="/usr/local/share/nvim/site"                    
                                                                                   
call plug#begin(g:PLUGIN_HOME)                                                                                  
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }         
                                                                                          
Plug 'zchee/deoplete-jedi', { 'for': 'python' }                       
                                     
Plug 'Shougo/neco-vim', { 'for': 'vim' }  

call plug#end()                           

This works fine and will install plugins into /usr/local/share/nvim/site. All users can use these plugins under their account.
The problem is that I do not know how to let the users also use vim-plug to install other plugins they want to use.
For example, suppose a user want to install ayu-vim, if they use Plug 'ayu-theme/ayu-vim' in ~/.config/nvim/init.vim and then use :PlugInstall. vim-plug warns that the user does not have permission to install plugins under  /usr/local/share/nvim/site.
If the user choose to use:
call plug#begin('/home/username/.local/share/nvim/plugged')
Plug 'ayu-theme/ayu-vim'
call plug#end()

Only this plugin will take effect, and all other plugins under /usr/local/share/nvim/site does not work anymore.
Of course, the user can install the plugin manually and update the runtimepath variable manually. But it would be preferable to use vim-plug to manage the plugins.
I am thinking of a functionality similar to how pip manages user and global packages, i.e., the user can choose to install plugins locally if he does not have root rights. In this way, the user can use both system-wide plugins and also user-specific plugins.
Is there an easy to achieve this right now?

Duplicate issue #905: How to set multiple plug's code block of directory?
Created: 2019-11-12T13:44:55Z
How could I set multiple directory by dir option、set rtp etc ?
The example config file like as follow:
~/.vimrc
" The path of `/home/common/.vim/commons_dir` is just a common or soft link directory.

call plug#begin('/home/common/.vim/commons_dir')
" set common plugins
Plug 'majutsushi/tagbar',

call plug#end()

" source other files
source ~/.private.vimrc
~/ .private.vimrc
call plug#begin('~/.vim/private_dir')
" set private plugins
Plug 'mxw/vim-jsx',

call plug#end()


:version
VIM - Vi IMproved 8.1 (2018 May 18, compiled Sep 16 2019 18:46:24)
Included patches: 1-503, 505-680, 682-1312
Compiled by root@apple.com
Normal version without GUI.  Features included (+) or not (-):
+acl               +cmdline_compl     -emacs_tags        +insert_expand     +modify_fname      +netbeans_intg     +ruby/dyn          +terminfo          +vreplace
-arabic            +cmdline_hist      +eval              +job               +mouse             +num64             +scrollbind        +termresponse      +wildignore
+autocmd           +cmdline_info      +ex_extra          +jumplist          -mouseshape        +packages          +signs             +textobjects       +wildmenu
+autochdir         +comments          +extra_search      -keymap            -mouse_dec         +path_extra        +smartindent       +textprop          +windows
-autoservername    -conceal           -farsi             +lambda            -mouse_gpm         -perl              +startuptime       +timers            +writebackup
-balloon_eval      +cryptv            +file_in_path      -langmap           -mouse_jsbterm     +persistent_undo   +statusline        +title             -X11
-balloon_eval_term +cscope            +find_in_path      +libcall           -mouse_netterm     +postscript        -sun_workshop      -toolbar           -xfontset
-browse            +cursorbind        +float             +linebreak         +mouse_sgr         +printer           +syntax            +user_commands     -xim
+builtin_terms     +cursorshape       +folding           +lispindent        -mouse_sysmouse    -profile           +tag_binary        -vartabs           -xpm
+byte_offset       +dialog_con        -footer            +listcmds          -mouse_urxvt       +python/dyn        -tag_old_static    +vertsplit         -xsmp
+channel           +diff              +fork()            +localmap          +mouse_xterm       -python3           -tag_any_white     +virtualedit       -xterm_clipboard
+cindent           +digraphs          -gettext           -lua               +multi_byte        +quickfix          -tcl               +visual            -xterm_save
-clientserver      -dnd               -hangul_input      +menu              +multi_lang        +reltime           -termguicolors     +visualextra
-clipboard         -ebcdic            +iconv             +mksession         -mzscheme          -rightleft         +terminal          +viminfo
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H   -DMACOS_X_UNIX  -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc   -L/usr/local/lib -o vim        -lm -lncurses  -liconv -framework Cocoa



Type:

 Bug
 Enhancement
 Feature Request
 Question


OS:

 All/Other
 Linux
 OS X
 Windows


Vim:

 Terminal Vim
 GVim
 Neovim

Closing comment (2020-01-10T01:11:03Z): Duplicate of #903