junegunn / vim-plug

:hibiscus: Minimalist Vim Plugin Manager
https://junegunn.github.io/vim-plug/
MIT License
34.07k stars 1.93k forks source link

Suggestion: Don't download an entire github project #1231

Closed frankjonen closed 1 year ago

frankjonen commented 1 year ago

I just installed UltiSnips via Vim Plug and noticed it's way larger than any other plugin I had installed normally before. Turns out Vim Plug downloaded the entire 10MB repository. After manual cleanup it's now 1.2MB.

I've only used Vim Plug once so far since the UltiSnips repo is an absolute mess and I didn't want to piece it apart manually.

It'd be nice if Vim Plug had an option to clean up an install like homebrew clean for example. 10 plugins could easily cause 100MB of dead weight otherwise.

Shougo commented 1 year ago

what is the manual cleanup?

ghost commented 1 year ago

Are you talking about a cleanup, where you use rm, etc. to delete everything except what is needed to work as a plugin?

frankjonen commented 1 year ago

what is the manual cleanup?

Going through the entire repo looking for unusually large files and deleting those. Also show dotfiles/dotfolders and delete the github workspaces it downloads.

frankjonen commented 1 year ago

Are you talking about a cleanup, where you use rm, etc. to delete everything except what is needed to work as a plugin?

Yep. Something like that would be great.

ghost commented 1 year ago

I think is very difficult to determine if it is necessary for each plugin, so it is better not to do it.

frankjonen commented 1 year ago

I think is very difficult to determine if it is necessary for each plugin, so it is better not to do it.

How so?

#! /bin/bash

echo "Cleanup" && \
    rm -f .gitignore *.md *.txt Docker*.* Makefile Pipfile*.* *.ini *.py pylintrc && \
    rm -rf .github test ctags docker && \
    echo "\nDone."
frankjonen commented 1 year ago

I made a script to clean the plugins up after installing them through Vim-Plug. You run it and type in the plugin's folder name. It then cleans it up. Maybe you could add something like this.

#! /bin/bash

echo -n "Which Plugin to clean up: "
read name

cleaner () {
    rm -f .gitignore *.md *.txt Docker*.* Makefile Pipfile Pipfile*.* *.ini *.py pylintrc &&
    rm -rf .github test ctags docker
    echo "Done."
}

echo "Cleaning: $name"

( cd .vim/plugged/"$name" && cleaner )
ghost commented 1 year ago

Your script file is good. but, contains a .py file as target for delete. but, in case of rpc plugin like denite.nvim .py file is the most important file for it.

https://github.com/Shougo/denite.nvim

That's why I think is very difficult to determine if it is necessary for each plugin, so it is better not to do it.

junegunn commented 1 year ago

@hashue provided a great example of how a universal agreement on the importance of files is unattainable. As a result, vim-plug cannot offer a universally accepted solution.

10 plugins could easily cause 100MB of dead weight otherwise.

This is not a concern for most users due to the large storage capacity of modern computers. Reducing a few hundred megabytes of data is generally not worth the effort and doesn't make a significant difference. While there may be exceptional cases where it is relevant, vim-plug is not attempting to be a one-size-fits-all solution for all situations.

frankjonen commented 1 year ago

Your script file is good. but, contains a .py file as target for delete. but, in case of rpc plugin like denite.nvim .py file is the most important file for it.

https://github.com/Shougo/denite.nvim

It wouldn't be affected since the .py is not deleted recursively but only in the main directory.

That's why I think is very difficult to determine if it is necessary for each plugin, so it is better not to do it.

frankjonen commented 1 year ago

This is not a concern for most users due to the large storage capacity of modern computers. Reducing a few hundred megabytes of data is generally not worth the effort and doesn't make a significant difference

No worries I was merely under the impression that vim-plug was about efficiency. Apparently that's not the case.