Giter Club home page Giter Club logo

vim-plug's Introduction


A minimalist Vim plugin manager.

Pros.

  • Easy to set up: Single file. No boilerplate code required.
  • Easy to use: Concise, intuitive syntax
  • Super-fast parallel installation/update (with any of +job, +python, +python3, +ruby, or Neovim)
  • Creates shallow clones to minimize disk space usage and download time
  • On-demand loading for faster startup time
  • Can review and rollback updates
  • Branch/tag/commit support
  • Post-update hooks
  • Support for externally managed plugins

Installation

Download plug.vim and put it in the "autoload" directory.

Vim

Unix
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
    https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim

You can automate the process by putting the command in your Vim configuration file as suggested here.

Windows (PowerShell)
iwr -useb https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim |`
    ni $HOME/vimfiles/autoload/plug.vim -Force

Neovim

Unix, Linux
sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
       https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
Linux (Flatpak)
curl -fLo ~/.var/app/io.neovim.nvim/data/nvim/site/autoload/plug.vim --create-dirs \
    https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
Windows (PowerShell)
iwr -useb https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim |`
    ni "$(@($env:XDG_DATA_HOME, $env:LOCALAPPDATA)[$null -eq $env:XDG_DATA_HOME])/nvim-data/site/autoload/plug.vim" -Force

Getting Help

  • See tutorial page to learn the basics of vim-plug
  • See tips and FAQ pages for common problems and questions
  • See requirements page for debugging information & tested configurations
  • Create an issue

Usage

Add a vim-plug section to your ~/.vimrc (or stdpath('config') . '/init.vim' for Neovim)

  1. Begin the section with call plug#begin([PLUGIN_DIR])
  2. List the plugins with Plug commands
  3. call plug#end() to update &runtimepath and initialize plugin system
    • Automatically executes filetype plugin indent on and syntax enable. You can revert the settings after the call. e.g. filetype indent off, syntax off, etc.
  4. Reload the file or restart Vim and run :PlugInstall to install plugins.

Example

call plug#begin()
" The default plugin directory will be as follows:
"   - Vim (Linux/macOS): '~/.vim/plugged'
"   - Vim (Windows): '~/vimfiles/plugged'
"   - Neovim (Linux/macOS/Windows): stdpath('data') . '/plugged'
" You can specify a custom plugin directory by passing it as the argument
"   - e.g. `call plug#begin('~/.vim/plugged')`
"   - Avoid using standard Vim directory names like 'plugin'

" Make sure you use single quotes

" Shorthand notation for GitHub; translates to https://github.com/junegunn/vim-easy-align
Plug 'junegunn/vim-easy-align'

" Any valid git URL is allowed
Plug 'https://github.com/junegunn/seoul256.vim.git'

" Using a tagged release; wildcard allowed (requires git 1.9.2 or above)
Plug 'fatih/vim-go', { 'tag': '*' }

" Using a non-default branch
Plug 'neoclide/coc.nvim', { 'branch': 'release' }

" Use 'dir' option to install plugin in a non-default directory
Plug 'junegunn/fzf', { 'dir': '~/.fzf' }

" Post-update hook: run a shell command after installing or updating the plugin
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }

" Post-update hook can be a lambda expression
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }

" If the vim plugin is in a subdirectory, use 'rtp' option to specify its path
Plug 'nsf/gocode', { 'rtp': 'vim' }

" On-demand loading: loaded when the specified command is executed
Plug 'preservim/nerdtree', { 'on': 'NERDTreeToggle' }

" On-demand loading: loaded when a file with a specific file type is opened
Plug 'tpope/vim-fireplace', { 'for': 'clojure' }

" Unmanaged plugin (manually installed and updated)
Plug '~/my-prototype-plugin'

" Initialize plugin system
" - Automatically executes `filetype plugin indent on` and `syntax enable`.
call plug#end()
" You can revert the settings after the call like so:
"   filetype indent off   " Disable file-type-specific indentation
"   syntax off            " Disable syntax highlighting

Example (Lua configuration for Neovim)

In Neovim, you can write your configuration in a Lua script file named init.lua. The following code is the Lua script equivalent to the VimScript example above.

local vim = vim
local Plug = vim.fn['plug#']

vim.call('plug#begin')

-- Shorthand notation for GitHub; translates to https://github.com/junegunn/vim-easy-align
Plug('junegunn/vim-easy-align')

-- Any valid git URL is allowed
Plug('https://github.com/junegunn/seoul256.vim.git')

-- Using a tagged release; wildcard allowed (requires git 1.9.2 or above)
Plug('fatih/vim-go', { ['tag'] = '*' })

-- Using a non-default branch
Plug('neoclide/coc.nvim', { ['branch'] = 'release' })

-- Use 'dir' option to install plugin in a non-default directory
Plug('junegunn/fzf', { ['dir'] = '~/.fzf' })

-- Post-update hook: run a shell command after installing or updating the plugin
Plug('junegunn/fzf', { ['dir'] = '~/.fzf', ['do'] = './install --all' })

-- Post-update hook can be a lambda expression
Plug('junegunn/fzf', { ['do'] = function()
  vim.fn['fzf#install']()
end })

-- If the vim plugin is in a subdirectory, use 'rtp' option to specify its path
Plug('nsf/gocode', { ['rtp'] = 'vim' })

-- On-demand loading: loaded when the specified command is executed
Plug('preservim/nerdtree', { ['on'] = 'NERDTreeToggle' })

-- On-demand loading: loaded when a file with a specific file type is opened
Plug('tpope/vim-fireplace', { ['for'] = 'clojure' })

-- Unmanaged plugin (manually installed and updated)
Plug('~/my-prototype-plugin')

vim.call('plug#end')

More examples can be found in:

Commands

Command Description
PlugInstall [name ...] [#threads] Install plugins
PlugUpdate [name ...] [#threads] Install or update plugins
PlugClean[!] Remove unlisted plugins (bang version will clean without prompt)
PlugUpgrade Upgrade vim-plug itself
PlugStatus Check the status of plugins
PlugDiff Examine changes from the previous update and the pending changes
PlugSnapshot[!] [output path] Generate script for restoring the current snapshot of the plugins

Plug options

Option Description
branch/tag/commit Branch/tag/commit of the repository to use
rtp Subdirectory that contains Vim plugin
dir Custom directory for the plugin
as Use different name for the plugin
do Post-update hook (string or funcref)
on On-demand loading: Commands or <Plug>-mappings
for On-demand loading: File types
frozen Do not remove and do not update unless explicitly specified

Global options

Flag Default Description
g:plug_threads 16 Default number of threads to use
g:plug_timeout 60 Time limit of each task in seconds (Ruby & Python)
g:plug_retries 2 Number of retries in case of timeout (Ruby & Python)
g:plug_shallow 1 Use shallow clone
g:plug_window -tabnew Command to open plug window
g:plug_pwindow vertical rightbelow new Command to open preview window in PlugDiff
g:plug_url_format https://git::@github.com/%s.git printf format to build repo URL (Only applies to the subsequent Plug commands)

Keybindings

  • D - PlugDiff
  • S - PlugStatus
  • R - Retry failed update or installation tasks
  • U - Update plugins in the selected range
  • q - Close the window
  • :PlugStatus
    • L - Load plugin
  • :PlugDiff
    • X - Revert the update

Example: A small sensible Vim configuration

call plug#begin()
Plug 'tpope/vim-sensible'
call plug#end()

On-demand loading of plugins

" NERD tree will be loaded on the first invocation of NERDTreeToggle command
Plug 'preservim/nerdtree', { 'on': 'NERDTreeToggle' }

" Multiple commands
Plug 'junegunn/vim-github-dashboard', { 'on': ['GHDashboard', 'GHActivity'] }

" Loaded when clojure file is opened
Plug 'tpope/vim-fireplace', { 'for': 'clojure' }

" Multiple file types
Plug 'kovisoft/paredit', { 'for': ['clojure', 'scheme'] }

" On-demand loading on both conditions
Plug 'junegunn/vader.vim',  { 'on': 'Vader', 'for': 'vader' }

" Code to execute when the plugin is lazily loaded on demand
Plug 'junegunn/goyo.vim', { 'for': 'markdown' }
autocmd! User goyo.vim echom 'Goyo is now loaded!'

Note

Should I set up on-demand loading?

You probably don't need to.

A properly implemented Vim plugin should already load lazily without any help from a plugin manager (:help autoload). So there are few cases where these options actually make much sense. Making a plugin load faster is the responsibility of the plugin developer, not the user. If you find a plugin that takes too long to load, consider opening an issue on the plugin's issue tracker.

Let me give you a perspective. The time it takes to load a plugin is usually less than 2 or 3ms on modern computers. So unless you use a very large number of plugins, you are unlikely to save more than 50ms. If you have spent an hour carefully setting up the options to shave off 50ms, you will have to start Vim 72,000 times just to break even. You should ask yourself if that's a good investment of your time.

Make sure that you're tackling the right problem by breaking down the startup time of Vim using --startuptime.

vim --startuptime /tmp/log

On-demand loading should only be used as a last resort. It is basically a hacky workaround and is not always guaranteed to work.

Tip

You can pass an empty list to on or for option to disable the loading of the plugin. You can manually load the plugin using plug#load(NAMES...) function.

See https://github.com/junegunn/vim-plug/wiki/tips#loading-plugins-manually

Post-update hooks

There are some plugins that require extra steps after installation or update. In that case, use the do option to describe the task to be performed.

Plug 'Shougo/vimproc.vim', { 'do': 'make' }
Plug 'ycm-core/YouCompleteMe', { 'do': './install.py' }

If the value starts with :, it will be recognized as a Vim command.

Plug 'fatih/vim-go', { 'do': ':GoInstallBinaries' }

To call a Vim function, you can pass a lambda expression like so:

Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }

If you need more control, you can pass a reference to a Vim function that takes a dictionary argument.

function! BuildYCM(info)
  " info is a dictionary with 3 fields
  " - name:   name of the plugin
  " - status: 'installed', 'updated', or 'unchanged'
  " - force:  set on PlugInstall! or PlugUpdate!
  if a:info.status == 'installed' || a:info.force
    !./install.py
  endif
endfunction

Plug 'ycm-core/YouCompleteMe', { 'do': function('BuildYCM') }

A post-update hook is executed inside the directory of the plugin and only run when the repository has changed, but you can force it to run unconditionally with the bang-versions of the commands: PlugInstall! and PlugUpdate!.

Tip

Make sure to escape BARs and double-quotes when you write the do option inline as they are mistakenly recognized as command separator or the start of the trailing comment.

Plug 'junegunn/fzf', { 'do': 'yes \| ./install' }

But you can avoid the escaping if you extract the inline specification using a variable (or any Vimscript expression) as follows:

let g:fzf_install = 'yes | ./install'
Plug 'junegunn/fzf', { 'do': g:fzf_install }

PlugInstall! and PlugUpdate!

The installer takes the following steps when installing/updating a plugin:

  1. git clone or git fetch from its origin
  2. Check out branch, tag, or commit and optionally git merge remote branch
  3. If the plugin was updated (or installed for the first time)
    1. Update submodules
    2. Execute post-update hooks

The commands with the ! suffix ensure that all steps are run unconditionally.

Collaborators

License

MIT

vim-plug's People

Contributors

blueyed avatar dohq avatar gh4w avatar itspriddle avatar janlazo avatar junegunn avatar korniste avatar lervag avatar mattn avatar matusf avatar mhinz avatar michamos avatar nfischer avatar pockata avatar ralish avatar returntrip avatar rmschindler avatar rnwst avatar rofrol avatar shawnhatori avatar slepogin avatar smuenzel avatar srstevenson avatar starcraftman avatar subnut avatar timjk avatar vheon avatar watagashi avatar whonore avatar xanderdunn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vim-plug's Issues

Deprecate the use of Plugfile

It was an interesting experiment. But it is only an incomplete, naive solution to the problem, and I don't see it being widely used anytime soon. I'm considering retiring the use of it. It will help simplify many parts of vim-plug.

  1. Update the plugins that use Plugfile to inform user when the dependencies are not met.
    • vim-fnr
    • vim-pseudocl
  2. Remove Plugfile code from vim-plug

Speed up opening buffer (might be irrelevant)

Hi,
I found my vim became slow recently, so I decide to migrate to vim-plug from vundles. Just switching from vundles to vim-plug reduces the start-up time about half of original time (without even setting any on-demand loading). That's really amazing, thanks!

However, I'm wondering if it is possible to speed up my buffer opening through vim-plug (currently, my vim open buffers very slow) ? In fact, I have no idea how to speed up buffer opening. vim --startuptime xxx can only give me the profiling of start up time. Do you have any thought on this?

Thanks for the amazing plug-in.

PlugUpdate Timeout

Every couple of days I run PlugUpdate and it quickly updates 43/44, and then eventually does a Timeout (after 60 seconds). The plugin it gets stuck on varies.

Afterwords I run PlugUpdate again and all is well, in 3 seconds.

Sorry that I don't have any additional details.

Having plugin fire on multiple filetypes

Hey!

Thank you for all your hard work… I'm not very good at viml and I couldn't find an example in the documentation… how would you handle a plugin that needs to fire on several file types?

Plug Commands Not Live Updating on MacVim GUI

When running :PlugInstall, :PlugUpdate, etc. on MacVim, the window freezes while the command runs. Then, once it's done, the window appears in its finished state, listing the installed/updated plugins.

Basically, instead of showing the command's progress live, it freezes for several seconds (the time it takes to run the command), then shows the finished state.

This does not happen in the Terminal for either the OSX-supplied vim command or the MacVim-supplied Vim command (MacVim.app/Contents/MacOS/Vim).

I can reproduce this problem with vim's default configuration. The problem persists with my personal configuration as well.

I'm running Mac OSX 10.9.4. Here are the vim configurations I tested: https://gist.github.com/jonstoler/b211e0db7f5118618fc0

I wouldn't be as worried about this if it were just my own build that was having problems, but seeing a stock MacVim choke on this makes me feel more concerned. Let me know what I can do to help diagnose the cause of the problem.

Using local path as plugin in vim-plug

Hi, I already used vim-plug some time ago and then switched back to Vundle but I miss the parallel update so I'm considering switching back. I have this line in my .vimrc

Plugin 'file://$GOPATH/src/github.com/nsf/gocode', { 'pinned': 1, 'rtp': 'vim/' }

is this possible with vim-plug?

Invalid git URI when calling :PlugStatus or :PlugClean

When calling one of those commands, vim-plug confuses all plugins URIs with the URI of the current folder.

For example, running PlugStatus when in ~/.vim (which contains its own git repository) results in this:

Finished. 74 error(s).
x vim-cute-python:
     Invalid URI: https://github.com/Xifax/yavir.git
     Expected:    https://git:@github.com/ehamberg/vim-cute-python.git
     PlugClean required.
     ...

PlugInstall and PlugUpdate work perfectly well.

E471: Argument required: Plug

First I'd like to thank you for this amazing plugin manager! I just migrated to it from NeoBundle, love it!

However, I get this error if I use double quotes, but not if I use single quotes:

Plug "troydm/easytree.vim"         " Throws the error
Plug 'troydm/easytree.vim'         " Works fine

I didn't try to find the source of the problem, but it really doesn't make sense to me.

Load plugin on entering Insert

Is it possible to trigger a plug-in to load on entering insert mode?

I'm basically just trying to reduce the start-up time of vim. I quite often use vim to view a file and never get round to editing it, so loading plug-ins that are used for editing is not necessary (I'm thinking Ultisnips mainly cause it increases load time noticeably).

I tried creating a command that does nothing and setting the 'on' parameter and then having an autocommand call this when entering Insert mode, but it didn't work. Having a look at the code, it looks like the command has to be provided by the plug-in that is being loaded, is that right? Any way around this (I'm versed in VimL enough to figure it out)?

Plug 'SirVer/ultisnips', {'on': 'InsertEnterCustom'}
...
function! InsertEnterCustom()
    echo "Nothing"
endfunction
command! InsertEnterCustom call InsertEnterCustom()
...
autocmd InsertEnter * InsertEnterCustom

Thanks for your work.

Update git submodules.

Currently I need to manually cd into a plugin folder containing updates to its git submodules and update them by running:

$ git submodule update --force

It's a bit of hassle since I'm not always aware there's been any updates to a plugin's git submodules or that it even has any.

This is especially annoying now that YouCompleteMe has moved the ycmd daemon into its own project which is quite regularly updated.

git clone fails with `Too many arguments.` error.

Trying to install/update promptline.vim witht the following config:

Plug 'edkolev/promptline.vim '

gives the following output after a retry:

Updated. Elapsed time: 0.196383 sec.
[x]

- Finishing ... Done!
x promptline.vim 
    Too many arguments.

    usage: git clone [options] [--] <repo> [<dir>]

        -v, --verbose         be more verbose
        -q, --quiet           be more quiet
        --progress            force progress reporting
        -n, --no-checkout     don't create a checkout
        --bare                create a bare repository
        --mirror              create a mirror repository (implies bare)
        -l, --local           to clone from a local repository
        --no-hardlinks        don't use local hardlinks, always copy
        -s, --shared          setup as shared repository
        --recursive           initialize submodules in the clone
        --recurse-submodules  initialize submodules in the clone
        --template <template-directory>
                              directory from which templates will be used
        --reference <repo>    reference repository
        -o, --origin <name>   use <name> instead of 'origin' to track upstream
        -b, --branch <branch>
                              checkout <branch> instead of the remote's HEAD
        -u, --upload-pack <path>
                              path to git-upload-pack on the remote
        --depth <depth>       create a shallow clone of that depth
        --single-branch       clone only one branch, HEAD or --branch
        --separate-git-dir <gitdir>
                              separate git dir from working tree
        -c, --config <key=value>
                              set config inside the new repository

Asking for password on git 1.7

I wanted to install plugins on a slightly older machine with Git 1.7.7 and Vim 7.3 (+ruby). For some reason, vim-plug tries to clone URLs like https://git:@github.com/Shougo/neosnippet.git. This looks to me like trying to clone with user "git:" but you seem to have a reason to construct the URL like that. Anyway, that breaks for me because I cannot type in passwords and Vim gets locked up.

P.S.: Replacing that URI with plain 'https://github.com/' ... solves the problem.

Curl fails with 400 Bad Request

This is on a RHEL 7.0 machine with curl v7.29.0.

I found a related issue here and it seems like curl doesn't consider the 301 redirect from https://raw.github.com/... to https://raw.githubusercontent.com/... to be safe (or something like that).

I guess one solution is to just point to http://raw.githubusercontent.com directly and skip the redirect completely.

Here's a trace:

$ curl -svfLo ~/.vim/autoload/plug.vim https://raw.github.com/junegunn/vim-plug/master/plug.vim
* About to connect() to raw.github.com port 443 (#0)
*   Trying 185.31.17.133...
* Connected to raw.github.com (185.31.17.133) port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* SSL connection using SSL_RSA_WITH_RC4_128_SHA
* Server certificate:
*   subject: CN=www.github.com,O="Fastly, Inc.",L=San Francisco,ST=California,C=US
*   start date: Feb 25 00:00:00 2014 GMT
*   expire date: Mar 02 12:00:00 2015 GMT
*   common name: www.github.com
*   issuer: CN=DigiCert High Assurance CA-3,OU=www.digicert.com,O=DigiCert Inc,C=US
> GET /junegunn/vim-plug/master/plug.vim HTTP/1.1
> User-Agent: curl/7.29.0
> Host: raw.github.com
> Accept: */*
> Referer:
>
< HTTP/1.1 301 Moved Permanently
< Date: Tue, 19 Aug 2014 07:07:35 GMT
< Server: Apache
< Location: https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
< Content-Length: 0
< Accept-Ranges: bytes
< Via: 1.1 varnish
< Age: 0
< X-Served-By: cache-fra1229-FRA
< X-Cache: MISS
< X-Cache-Hits: 0
< Vary: Accept-Encoding
<
* Connection #0 to host raw.github.com left intact
* Issue another request to this URL: 'https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
* About to connect() to raw.githubusercontent.com port 443 (#1)
*   Trying 185.31.17.133...
* Connected to raw.githubusercontent.com (185.31.17.133) port 443 (#1)
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* SSL connection using SSL_RSA_WITH_RC4_128_SHA
* Server certificate:
*   subject: CN=www.github.com,O="Fastly, Inc.",L=San Francisco,ST=California,C=US
*   start date: Feb 25 00:00:00 2014 GMT
*   expire date: Mar 02 12:00:00 2015 GMT
*   common name: www.github.com
*   issuer: CN=DigiCert High Assurance CA-3,OU=www.digicert.com,O=DigiCert Inc,C=US
> GET /junegunn/vim-plug/master/plug.vim HTTP/1.1
> User-Agent: curl/7.29.0
> Host: raw.githubusercontent.com
> Accept: */*
> Referer: https://raw.github.com/junegunn/vim-plug/master/plug.vim
>
* The requested URL returned error: 400 Bad Request
* Closing connection 1

Overriding sensible.vim settings

I currently have the following on my .vimrc:

"Plug 'tpope/vim-sensible'
runtime! plugin/sensible.vim

Could there be something like:

Plug 'tpope/vim-sensible', { 'now': true }

Or something along these lines? If you could implement something like this that would be really cool. :)

One-time, double-loading of ftplugin files on FT-based ODL

If filetype plugin on is called before plug#end() call (mostly due to /etc/vimrc), autocmd for loading ftplugin files (#filetypeplugin) are registered before ODL autocmd from vim-plug. This caused the problem where ftplugin files not loaded the first time as pointed out in #24.

The first approach I took to fix the problem was to remove #filetypeplugin autocmd. However, this effectively changed the order of autocmds on FileType event, and caused unwanted side-effect where a FileType autocmd defined before plug#end() is overridden by plugins. (This only happened when filetype plugin on was called by /etc/vimrc)

So I reverted the change, and updated vim-plug to re-set &filetype after ODL. It fixed the aforementioned problems. However, due to this change, ftplugin files can be unnecessarily loaded twice on the first time a file of the type is opened, when filetype plugin on was not called before plug#end(). It is harmless, and should be unnoticeable, as it usually takes a few milliseconds. But nevertheless, it would be nice if we could avoid it.

$HOME environment variable not being interpreted under Windows

Under Windows, when I run :PlugInstall the packages are downloaded to an incorrect location. Instead of putting them under vimfiles\plugged in the directory pointed to by my $HOME environment variable (e.g. C:\Users), a directory named '$HOME' (literally) is created under the current directory and the files placed there. In other words, it is as if the $HOME variable is not being interpreted as a variable, but taken as a literal string.

p.s. I know Windows may not be your priority, but it would still be nice to fix this issue. Thanks for a great tool.

Feature: display git log for updated plugins

Hi Junegunn,

Thanks for your awesome work! I really enjoy how much faster vim-plug is compared with Vundle. One feature that I'm missing is displaying the git log for plugins that have been updated. In Vundle after running BundleUpdate, you can just press u to display the log, this helps to keep track of what's new in the plugins. Would you consider adding such a feature to vim-plug?

Thanks,
Anton

Can't PlugUpdate individual plugins

Hi, I might just be understanding the README wrong, but I was under the impression that you could pass the name of a specific plugin to PlugUpdate instead of updating all installed plugins at once.

I tried PlugUpdate vim-surround, PlugUpdate 'vim-surround', PlugUpdate tpope/vim-surround, and PlugUpdate 'tpope/vim-surround' but all four commands updated all installed plugins instead of just that one.

Am I misunderstanding the README and is this feature not available in Vim-Plug?

Thanks!

Installing a new plugin results in an error

After the recent update, installing a new plugin leads to an error like:

x tabular
    Cloning into '/Users/anton/.vim/plugged/tabular'...
    fatal: Not a git repository (or any of the parent directories): .git

This doesn't prevent the plugin from being installed.

ftplugin/**/*.vim don't load lazily

I found that I need to add 'ftplugin' to the list of types in the s:lod_ft function to make vim-go plugin work properly. Without it the :GoFmt command was not available.

function! s:lod_ft(name, plug)
  if has_key(s:loaded, a:name)
    return
  endif
  call s:lod(a:plug, ['ftplugin', 'plugin', 'after'])
  let s:loaded[a:name] = 1
endfunction

My little knowledge of the vim internals doesn't allow me to make it a pull request. Can this change break something?

vim-plug managing itself

I'm not sure if this has been suggested or not, but with Vundle, it can manage itself. That is, if you run PluginUpdate it will also update Vundle (assuming you've added Plugin 'gmarik/Vundle.vim' to your vimrc). Is it possible to add this feature to vim-plug? As I think it would be really useful.

False alarm from PlugStatus when tag specified

PlugStatus currently only works with branch names. If a tag is specified for a plugin, it returns an error:

    Invalid branch: HEAD. Try PlugUpdate.

How to fix:

  1. git describe --exact-match --tags HEAD
  2. git rev-parse --abbrev-ref HEAD

vim +PlugInstall crashes Vim

Hello junegunn,

First, thanks for this plugin. I tested Vundle and Neobundle but I really like the philosophy of vim-plug.
I'm using a script to automate the setup of my vim configuration in which I have the following command:

vim +PlugInstall

and that gives me the error

Vim: Caught deadly signal SEGV
Vim: Finished.
zsh: segmentation fault vim +PlugInstall

Actually this command always crashes even run directly from the terminal. I noticed that this bug affects the version 7.4 of Vim and not the 7.3.

Do you have any idea about how to fix this bug?

Taurus

Git SubModules

For YouCompleteMe, I currently have in my .vimrc the following line:

Plug 'Valloric/YouCompleteMe', { 'do': './install.sh --clang-completer' }

However, it seems to me that the install script must have failed (either that or it did not run). As it would not compile the binaries (when I ran vim again, YouCompleteMe would tell me that I have not ran the install.sh script). I decided to manually go to the ~/.vim/plugged/YouCompleteMe directory, and run ./install.sh --clang-completer from there. However, I got this error:

Some folders in ./third_party are empty; you probably forgot to run:

    git submodule update --init --recursive

Therefore, would it be possible to update/init submodules when you run PlugInstall/PlugUpdate? Otherwise, I would have to manually go to the repository and update/init the submodules; or alternatively make a function that does this for me (but this seems tedious, especially for other plugins that may require git submodules).

Also, I believe Vundle does update/init submodules for repositories (source: https://github.com/Valloric/YouCompleteMe#full-installation-guide).

I am currently running OS X 10.9.2, with git version 1.8.5.2 (Apple Git-48), if this issue is only occurring for me, or if it is due to the fact I am using the --clang-completer argument for the install script.

spellfile is saved in an unexpected path

Hi Junegunn,

If spellfile is not set, Vim will try saving the file using the first directory in runtimepath, which after being configured by vim-plug, will very likely be a path pointing to one of the plugin's directory

For example, if the first directory in runtimepath is ~/.vim/plugged/vim-easymotion/, spellfile will be saved in ~/.vim/plugged/vim-easymotion/spell/en.utf-8.add, as opposed to the expected path like ~/.vim/spell/en.utf-8.add

This can be easily fixed by manually setting spellfile, but it might be more desirable to let vim-plug make the first entry of runtimepath always be the default ~/.vim?

Awesome plugin manager by the way.

Cheers

Vim version dependencies

I've looked through the README and recent issues, but I haven't seen a solution for this.

I've got a number of plugins specified in the following manner:

 if v:version > 703 || (v:version == 703 && has('patch584'))
    Plug 'Valloric/YouCompleteMe', { 'do': './install.sh' }
endif

Kind of messy to put it in my list of plugins.

There are already conditions for filetypes and on specific commands. What about on a function return? Say if a specific function returns 0 (equivalent to "false" in vimscript, right?), don't load the function .

Post-(install/update) hook

It would be really cool (and useful) if I could specify post-* hooks. For example, If I use a plugin like YouCompleteMe, which requires to be compiled after it's installed or updated, then I have to go to the plugin folder and compile it manually. What if this process could be automated?

The only other plugin manager that actually does that is NeoBundle, which I stopped using in favour of vim-plug.

Anyway, just a thought.

auto source $MYVIMRC?

i saw this line in the doc:

If you put Plug 'junegunn/dummy1' in your configuration file, and run :PlugInstall,

but i don't think my vim auto re-source $MYVIMRC anyway..

would it be a good idea to add the "auto re-source $MYVIMRC" functionality in the plugin?

thanks!

I ported my whole plugins from NeoBundle to your plugin and have a problem with colorschemes

I have Plug 'wikimatze/vim-github-theme' in my vimrc files and it is installed correctly under ~/.vim/plugged but setting my colorscheme to colorscheme github doesn't work, because it could not find the scheme. It works only if I

wm~/.vim(master↓1↑1|✚1…)$ mv plugged/vim-github-theme/colors .

So, is there a way to include this files in the load paths? I could not find any information. Of course, it's no problem for me to check in the colors folder.

Best regards from Berlin,

Matthias

Update/Install timeout needed.

I'm using 38 vim plugins, PlugUpdate or Install often hangs on */38 (most of the times 37/38) well.. I thought it hangs, but I minimized my vim and forgot about it, and it finished! after drums 1 hour :) You really need some kind of timeout so it can jump to the next plugin, or just ignore it with the status failed. Cheers!

how to keep vim-plug it self up-to-date?

how to keep vim-plug itself up-to-date?

if i download vim-plug in to ~/.vim/autoload myself, i can hardly keep in mind that i should/need to update it.

maybe in a way like what vundle did?

thanks!!

Unsetting showcmd?

Near the top of my .vimrc I have set showcmd, and after that I have plug#begin and plug#end. When I start Vim, noshowcmd is set. Using :verbose set showcmd?, Vim tells me it was last set from plug.vim. This happens even with no plugins listed between plug#begin and plug#end.

Stance of you, missing in README.md

I liked your article.
You'd better to add to the README.md a sentence of your stance; something like you will not accept a feature request of others.
There's a link of your article though.
BTW, note that striking animation image on the top will invite more and more users:)

changelist always shows "No updates."

After PlugUpdate with several plugins getting updates, status says "Press 'D' to see the updated changes." When I press D, new buffer always says ""No updates."

Haven't had time to dig in further, but this happens on linux, mac, and windows. Maybe something wrong with my vimrc?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.