Skip to content

Commit

Permalink
Reorganize directory structure to work with recent vim versions
Browse files Browse the repository at this point in the history
This reorgnization allows for one to clone the repository directly to
`~/.vim` without needing any extra symlinks from `.vim_dotfiles` or
other location into one's home directory. All that's needed from then is
to run `vim +PlugInstall +PlugClean! +qall` and you have a fully
functioning vim setup, self contained in `~/.vim`.

The `activate.sh` script left for consistency's sake and to not break
people's workflows. It may also want to warn about legacy symlinks.
  • Loading branch information
mattikus authored and ClashTheBunny committed Sep 12, 2018
1 parent 0e17a9c commit 065a1b3
Show file tree
Hide file tree
Showing 37 changed files with 25 additions and 10 deletions.
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
## Overview

After cloning this project, you can run the following to link these dotfiles
into your home directory:
Clone this project directy into `~/.vim`:

./activate.sh
```bash
# Clean up old unnecessary files or symlinks
rm -f ~/.vimrc ~/.gvimrc ~/.vimrc.bundles ~/.vim

Be warned: this will overwrite any existing .vimrc or .vim/ files you have in
your home directory.
# Clone directly into ~/.vim
git clone [email protected]:braintreeps/vim_dotfiles ~/.vim
```

After cloning this project, you can run the following to update the plugins:

```bash
./activate.sh
```

Uses `vim-plug` to manage bundles.

Expand Down
12 changes: 7 additions & 5 deletions activate.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
#!/bin/bash

set -e
set -euo pipefail

dotfiles_dir=$(cd "$(dirname "$0")"; pwd)

for name in vim vimrc vimrc.bundles; do
rm -rf "${HOME}/.${name}"
ln -s "${dotfiles_dir}/${name}" "${HOME}/.${name}"
done
if ! vim --version | grep -q '2nd user vimrc file'; then
for name in vim vimrc vimrc.bundles; do
rm -rf "${HOME}/.${name}"
ln -s "${dotfiles_dir}/${name}" "${HOME}/.${name}"
done
fi

vim +PlugInstall +PlugClean! +qall
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions ftplugin/java.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
map <silent> <LocalLeader>ra :wa<CR> :RunAllBazelTests<CR>
map <silent> <LocalLeader>rb :wa<CR> :RunTargetBazelTests<CR>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions vim
2 changes: 2 additions & 0 deletions vimrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ endif
" Install vim plugins
if filereadable(expand("~/.vimrc.bundles"))
source ~/.vimrc.bundles
elseif filereadable(expand("~/.vim/vimrc.bundles"))
source ~/.vim/vimrc.bundles
endif

if filereadable(expand("/etc/vim/vimrc.bundles"))
Expand Down

0 comments on commit 065a1b3

Please sign in to comment.