Comments (13)
If you don't mind losing the commit of the plugin, maybe the easiest way is: change .vimrc
to add {'type': 'opt'}
, source it, then call minpac#update()
and minpac#clean()
.
Another idea is...
A user can get the directory of the plugin by minpac#getpluginfo('plugin_name').dir
. So a user might be able to define a custom command using it and rename()
to move the plugin.
I'm not sure whether minpac should have this feature by default.
from minpac.
hm, it is not so easy. I tried with this approach:
command! -nargs=1 -complete=customlist,CompletePack PackDisable
\ let url=minpac#getpluginfo(<q-args>).url |
\ call minpac#clean(<q-args>) |
\ call minpac#add(url, {'type': 'opt'}) |
\ call minpac#update()
command! PackUpdate packadd minpac | source $MYVIMRC | call minpac#update()
command! PackClean packadd minpac | source $MYVIMRC | call minpac#clean()
func! CompletePack(A, Cmd, Pos)
return map(glob("~/.vim/pack/minpac/start/". a:A. "*", 0, 1), 'substitute(v:val, ".*/", "", "g")')
endfunc
That works, however I still have to change the minpac#add() call...
from minpac.
A user can get the directory of the plugin by minpac#getpluginfo('plugin_name').dir. So a user might be able to define a custom command using it and rename() to move the plugin.
Here is a snippet based on this idea:
let plugdir = minpac#getpluginfo(plugin_name).dir
call rename(plugdir, substitute(plugdir, '/start/\ze[^/]\+$', '/opt/', ''))
That works, however I still have to change the minpac#add() call...
Yes..., users should always update minpac#add()
properly.
from minpac.
That should be put into the documentation ;)
from minpac.
Updated example:
command! -nargs=1 -complete=customlist,CompletePack PackDisable
\ let plugdir=minpac#getpluginfo(<q-args>).dir |
\ call rename(plugdir, substitute(plugdir, '/start/\ze[^/]\+$', '/opt/', ''))
func! CompletePack(A, Cmd, Pos)
return minpac#getpackages('minpac', 'start', a:A . '*', 1)
endfunc
from minpac.
Fixed by #46.
from minpac.
how does #46 fix it? I looked at the PR (only briefly), but don't know how this solves this problem.
from minpac.
Edit your .vimrc
and add {'type': 'opt'}
to the plugin you want to move from 'start' to 'opt', then execute minpac#update()
. The plugin directory will be automatically moved under the 'opt' directory.
however I still have to change the minpac#add() call...
This is still not changed, but I think this is the expected behavior.
from minpac.
ah thanks!
from minpac.
So it's still not entirely clear, can I move stuff from opt/ to start/ manually and vice versa? Can I zip the pack/minpac folder and move it to another machine?
from minpac.
As I wrote above, if you want to move a plugin from opt/ to start/, edit your .vimrc
and remove {'type': 'opt'}
from the plugin setting, then execute minpac#update()
.
Can I zip the pack/minpac folder and move it to another machine?
It doesn't seem to related this, but yes, you can.
from minpac.
Thanks. I don't actually configure plugins (other than minpac#init
) in my .vimrc at all, I just use minpac#add
to install, then :packadd
to load them from vim when needed. Maybe this should be a separate issue though.
from minpac.
If you have a line call minpac#add('user/plugin')
in your .vimrc, the plugin will be installed into the start/ directory.
If you change the line to call minpac#add('user/plugin', {'type': 'opt'})
, then execute minpac#update()
, the directory will be moved into the opt/ directory.
from minpac.
Related Issues (20)
- Updating blocks for a while before showing window HOT 6
- Specify minpac#add defaults in minpac#init HOT 1
- Why is nocompatible required? HOT 9
- minpac#update() not working on Windows 10 + nvim 0.5.0 HOT 4
- minpac update progress window name "a" HOT 7
- Migrate CI to GitHub Actions
- How to setup denite ? HOT 2
- Inaccurate documentation of minpac#init() function HOT 2
- Changing subdir after installation has no effect
- minpac#update() alters 'cpo'
- buffer-local mappings not executed until timeout HOT 3
- Do not map <C-j> and <C-k> in status window
- [Question] using `confirm()` instead of `input()` in `minpac#clean()`
- minpac#update Not Working HOT 1
- `core.autocrlf`が`true`の場合vim-jp/vimdoc-jaのtags-jaファイルで衝突が起こる HOT 3
- Getting Error when trying to clean HOT 2
- What is a good way to check if a package is loaded? HOT 6
- maintained? HOT 6
- warning: minpac progress window not found. HOT 2
- WindowsにてVimパッケージインストール後のエラーメッセージ HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from minpac.