My dotfiles for configuring vim/bash/etc. Please feel free to use/copy/modify any of the files here for your own usage. Hope it makes your development environment a little snazzier.
For convenience, this repository has an install script at its root. This will clean up any current dotfiles and install the configuration to their appropriate directories. Here are the steps to run:
git clone [email protected]:dencold/dotfiles.git
cd dotfiles
./install.sh
That's it! You should be able to open a new terminal session and benefit from the configuration.
The vim dotfiles use the fantastic pathogen package by @tpope for plugin management. To make it easy to pull down the plugins used by .vimrc
, I store them as git submodules in this repository. This requires a little more work after the initial clone as git does not pull submodules automatically. Read on young padawan...
Once you've cloned the dotfiles repo follow these steps to get the submodule code.
git submodule init vim/bundle
git submodule update vim/bundle
Now if you cd into any of the subdirectories in the bundle directory, you'll see all of the source has been pulled down.
Also note that the install script will do this automatically for you as well.
Some helpful reference from the git book.
If you'd like to add additional packages to pathogen, follow these steps:
-
Locate the package's repository link (e.g. https://github.com/fatih/vim-go.git)
-
Add it as a submodule in the
vim/bundle
directory:git submodule add https://github.com/fatih/vim-go.git \ vim/bundle/vim-go
-
Run the install script at the dotfiles root:
./install.sh
-
Restart vim and you should see the new package installed.
-
Last bit of housekeeping, we'll want to commit the package to our git repository. Do so with the following commands:
git add .gitmodules vim/bundle/vim-go git commit
Removing packages is a litle more involved. There isn't a dedicated git command for deleting submodules so we have some extra hoops to go through. A good reference here is this entry on stackoverflow. Here are the steps:
- Delete the relevant section from the
.gitmodules
file - Stage the .gitmodules changes:
git add .gitmodules
- Delete the relevant section from
.git/config
- Run
git rm --cached path_to_submodule
(no trailing slash) - Run
rm -rf .git/modules/path_to_submodule
- Commit:
git commit -m "Removed submodule <name>"
- Delete the now untracked submodule files:
rm -rf path_to_submodule
You once you are done with those steps, you can re-run the install.sh
script and the package will be removed.