Use GNU stow to manage symlinks
This commit is contained in:
parent
e395c6d49b
commit
4e5e48c64a
19 changed files with 13 additions and 30 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,2 +0,0 @@
|
||||||
oh-my-zsh/
|
|
||||||
vim/
|
|
0
.gitmodules
vendored
0
.gitmodules
vendored
26
Makefile
26
Makefile
|
@ -1,19 +1,7 @@
|
||||||
excludes = -I Makefile -I README.md
|
|
||||||
symlinks = $(shell find . -maxdepth 1 \( ! -iname "Makefile" ! -iname "README.md" ! -iname ".*" ! -name "bin" ! -iname "nvim" \) | sed 's|./||')
|
|
||||||
|
|
||||||
.PHONY: $(symlinks) nvim
|
|
||||||
|
|
||||||
all: install
|
all: install
|
||||||
|
|
||||||
install: install-bin plug-vim $(symlinks)
|
install: plug-vim
|
||||||
|
stow bin git nvim ruby tmux vim zsh
|
||||||
install-bin:
|
|
||||||
mkdir -p $$HOME/bin
|
|
||||||
cp bin/* $$HOME/bin
|
|
||||||
|
|
||||||
nvim:
|
|
||||||
mkdir -p ~/.config/nvim
|
|
||||||
cp nvim/init.vim ~/.config/nvim/
|
|
||||||
|
|
||||||
plug-vim:
|
plug-vim:
|
||||||
if test ! -f ~/.vim/autoload/plug.vim ; then \
|
if test ! -f ~/.vim/autoload/plug.vim ; then \
|
||||||
|
@ -33,15 +21,7 @@ rbenv-build:
|
||||||
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build ; \
|
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build ; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
$(symlinks):
|
update: update-repo
|
||||||
test -e `pwd`/$@ \
|
|
||||||
&& ln -sfn `pwd`/$@ ~/.$@
|
|
||||||
|
|
||||||
update: update-repo $(symlinks)
|
|
||||||
|
|
||||||
update-repo:
|
update-repo:
|
||||||
git pull --rebase
|
git pull --rebase
|
||||||
git submodule update
|
|
||||||
|
|
||||||
clean:
|
|
||||||
for file in $(symlinks); do rm ~/.$$file; done
|
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
## Dependencies
|
## Dependencies
|
||||||
|
|
||||||
|
* [stow](https://www.gnu.org/software/stow/)
|
||||||
* [tmux](https://github.com/tmux/tmux)
|
* [tmux](https://github.com/tmux/tmux)
|
||||||
* [zsh](https://github.com/zsh-users/zsh)
|
* [zsh](https://github.com/zsh-users/zsh)
|
||||||
* [neovim](https://github.com/neovim/neovim)
|
* [neovim](https://github.com/neovim/neovim)
|
||||||
|
@ -14,12 +15,11 @@
|
||||||
* Install dependencies
|
* Install dependencies
|
||||||
* Clone this repository
|
* Clone this repository
|
||||||
* Run `make`
|
* Run `make`
|
||||||
* Will symlink files into parent
|
* Uses GNU stow to generate symlinks
|
||||||
* Will overwrite existing files
|
* Config files must already exist
|
||||||
* Install vim plugins
|
* Install vim plugins
|
||||||
|
|
||||||
```
|
```
|
||||||
make nvim
|
|
||||||
nvim
|
nvim
|
||||||
,pi
|
,pi
|
||||||
```
|
```
|
||||||
|
|
|
@ -36,12 +36,17 @@ if which rbenv > /dev/null; then
|
||||||
(rbenv rehash &) 2> /dev/null
|
(rbenv rehash &) 2> /dev/null
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# init nodenv
|
# # init nodenv
|
||||||
if which nodenv > /dev/null; then
|
if which nodenv > /dev/null; then
|
||||||
eval "$(nodenv init --no-rehash -)"
|
eval "$(nodenv init --no-rehash -)"
|
||||||
(nodenv rehash &) 2> /dev/null
|
(nodenv rehash &) 2> /dev/null
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -d $HOME/.asdf ]; then
|
||||||
|
source $HOME/.asdf/asdf.sh
|
||||||
|
fi
|
||||||
|
. ~/.asdf/plugins/java/set-java-home.zsh
|
||||||
|
|
||||||
# init direnv
|
# init direnv
|
||||||
if which direnv > /dev/null; then
|
if which direnv > /dev/null; then
|
||||||
eval "$(direnv hook zsh)"
|
eval "$(direnv hook zsh)"
|
Loading…
Reference in a new issue