vim-plug
vim-plug copied to clipboard
Suggestion of changing the commands to install and update a plugin
I suggest run this command to install a plugin:
git clone -b master --single-branch --depth 1 {repo}
This command to update a plugin:
git fetch --depth 1 origin master && git reset --hard @{u}
Explanation:
- We don't need to download history commits, so
--single-branch --depth 1
is better. - The plugin folders are not supposed to be touched by user. Therefore,
reset --hard
is better thanpull
as sometimespull
doesn't work because of local changes by any reasons.
I also need "--depth 1", how to option for this
I agree. For example updating nerd-fonts takes forever (and A LOT of space) because that repo is huge AND has a lot of stale branches. --no-single-branch
was the issue. I wonder why that's needed?
Btw, man git-clone states that --depth N
imples --single-branch
.
IMO this could also be a config option of vim-plug
itself. Some users might actually want to see the history of all the commits.