Code Monkey home page Code Monkey logo

Comments (13)

k-takata avatar k-takata commented on May 22, 2024

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.

chrisbra avatar chrisbra commented on May 22, 2024

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.

k-takata avatar k-takata commented on May 22, 2024

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.

chrisbra avatar chrisbra commented on May 22, 2024

That should be put into the documentation ;)

from minpac.

k-takata avatar k-takata commented on May 22, 2024

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.

k-takata avatar k-takata commented on May 22, 2024

Fixed by #46.

from minpac.

chrisbra avatar chrisbra commented on May 22, 2024

how does #46 fix it? I looked at the PR (only briefly), but don't know how this solves this problem.

from minpac.

k-takata avatar k-takata commented on May 22, 2024

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.

chrisbra avatar chrisbra commented on May 22, 2024

ah thanks!

from minpac.

mralusw avatar mralusw commented on May 22, 2024

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.

k-takata avatar k-takata commented on May 22, 2024

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.

mralusw avatar mralusw commented on May 22, 2024

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.

k-takata avatar k-takata commented on May 22, 2024

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)

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.