~bpv/pm

7f64c070d0bacddaa27e96c897cdaa153fd24d65 — Bryce Vandegrift 4 months ago 3d6091a
Add ClonePlugin command

Command will clone the specified url but
not add it to g:plugins. Good for temp plugins.
3 files changed, 13 insertions(+), 2 deletions(-)

M README.md
M pm.txt
M pm.vim
M README.md => README.md +2 -1
@@ 58,7 58,8 @@ let g:plugins = ["https://github.com/ap/vim-css-color.git", "https://git.sr.ht/~

### Commands

- `:DownloadPlugins`: Downloads all plugins from thier Git repos
- `:DownloadPlugins`: Downloads all plugins from their Git repos
- `:ClonePlugin "url"`: Downloads plugin from specified `url` but does not add it to `g:plugins`
- `:UpdatePlugins`: Updates all installed plugins
- `:PurgePlugins`: Removes all plugins not defined in `g:plugins`
- `:UpdatePM`: Downloads and updates pm

M pm.txt => pm.txt +2 -0
@@ 89,6 89,8 @@ USAGE                                                             *pm-usage*

pm has a few commands that you can use:
- `:DownloadPlugins`: Downloads all plugins from their Git repos
- `:ClonePlugin "url"`: Downloads plugin from specified `url` but does not add
	it to `g:plugins`
- `:UpdatePlugins`: Updates all installed plugins
- `:PurgePlugins`: Removes all plugins not defined in `g:plugins`
- `:UpdatePM`: Downloads and updates pm itself

M pm.vim => pm.vim +9 -1
@@ 1,6 1,6 @@
" pm.vim - Stupidly Simple Vim/NeoVim plugin manager
" Author: Bryce Vandegrift <https://brycevandegrift.xyz>
" Version: 0.5.0
" Version: 0.6.0

if exists("g:pm_loaded") || &cp || v:version < 800
	finish


@@ 47,6 47,13 @@ function! s:updatedocs(item)
	endif
endfunction

function! s:clonePlugin(url)
	echom "Cloning " . a:url . "..."
	execute "!cd " . g:pm_path . ";git clone " . a:url
	call s:updatedocs(s:namefromgit(a:url))
	echom "Done!"
endfunction

function! s:downloadPlugins()
	echom "Downloading plugins..."
	if empty(g:plugins)


@@ 101,6 108,7 @@ function! s:updatePM()
endfunction

command! -nargs=0 DownloadPlugins call s:downloadPlugins()
command! -nargs=1 ClonePlugin call s:clonePlugin(<args>)
command! -nargs=0 UpdatePlugins call s:updatePlugins()
command! -nargs=0 PurgePlugins call s:purgePlugins()
command! -nargs=0 UpdatePM call s:updatePM()