Skip to content

Commit

Permalink
Fix Vim plugin submodules to resolve after fresh clone
Browse files Browse the repository at this point in the history
  • Loading branch information
conor-naranjo committed Aug 30, 2021
1 parent d1a45d3 commit e3ed6b3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/vim
8 changes: 3 additions & 5 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ location that's inside of $PATH

Vim plugins are version controlled using submodules
To add a new plugin run:
git submodule add <plugin repo> <this repo>/vim/.vim/pack/<key>/[start | opt]/<plugin name>
git submodule add <plugin repo> ./vim/.vim/pack/<key>/[start | opt]/<plugin name>
After running git submodule add, commit changes to .gitmodules

On a fresh clone of the dotfiles, to install Vim plugins run:
git submodule init
Followed by
git submodule update

./get-submodules.sh
11 changes: 11 additions & 0 deletions get-submodules.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh

set -e

git config -f .gitmodules --get-regexp '^submodule\..*\.path$' |
while read path_key path
do
url_key=$(echo $path_key | sed 's/\.path/.url/')
url=$(git config -f .gitmodules --get "$url_key")
git submodule add $url $path
done

0 comments on commit e3ed6b3

Please sign in to comment.