Skip to content

heimidal/vimfiles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vim Configuration

My configuration files for Vim. Tuned to play nice with MacVim. Setup using homesick for that symlinkn' goodness.

Installation Notes

Basic setup instructions to get the party started:

  1. Install the latest snapshot of MacVim using homebrew brew install macvim
  • Homebrew will also install the command line link as mvim which will open the editor from Terminal
  • Install homesick gem install homesick
  • Run homesick clone git://github.com/mkitt/vimfiles.git to clone the repository
  • Copy and Paste .vimrc.local.example to .vimrc.local and tweak the settings to your needs
  • Symlink homesick symlink vimfiles to create the necessary dot files within the ~/ directory
  • Move to the homesick directorycd ~/.homesick/repos/vimfiles/
  • Run git submodule init
  • Run git submodule update
  • Run bash update
  • Launch MacVim from Terminal by typing mvim and hitting enter
  • Right click the logo in your dock and select Options > Show in Finder
  • Create an alias of MacVim.app and drop it in the /Applications/ directory (this will allow it to be found by Spotlight)
  • Optionally choose to keep the icon in your dock Options > Keep in Dock

You should now be ready to get down to business.

Updating The Configuration

As a reminder to update the configuration do the following:

  1. close down MacVim
  • cd ~/.homesick/repos/vimfiles/
  • cd home/.vim/bundle/snipmate.vim
  • git fetch upstream master
  • git merge upstream/master
  • git push push master on the following:
    • bundle/markdown-preview.vim
    • bundle/browser-refresh.vim
    • bundle/snipmate.vim
    • syntax_checkers/compilers/nodelint-config/
  • cd ~/.homesick/repos/vimfiles/
  • $ bash update
  • commit the changes

$ bash update will handle cleaning out tags generated by help docs, pull any upstream changes from the submodules, and open gitx so you can add commit messages and make sure there isn't any damage done on the pulled upstream changes. It looks like:

git submodule foreach git checkout master
git submodule foreach git clean -f
git submodule foreach git pull --rebase
gitx

Custom Configurations

Within the configuration there is a file .vimrc.local, this stores local configurations based on the machine running it. Anything in here overrides properties set in .vimrc. This is setup for easy forking of the project.

Most of the custom configurations come from the submodules within .vim/bundle. Highly suggest taking a look at these and their help docs to see what they do and how they work. Custom settings are applied in .vimrc, so take a look at that as well.

The configuration is rolling it's own fork of snipmate.vim primarily to change some of the key commands that invoke a snippet. There has been quite a few additions to the snippets, mainly ported from TextMate and a bunch of new ones added. Snippets are your friend, check them out and use them wisely.

The configuration uses syntastic quite heavily, most of it is out of the box. The one difference deals with JavaScript.

The JavaScript syntax checker runs off of nodelint (node + JSLint) instead of jsl. The submodule to nodelint is under .vim/syntax_checkers/compilers/. Also under this directory is nodelint-config. This is the default global settings for all JavaScript files. It's possible, with a global variable, to override this location. In your .vimrc file.

let g:NodelintConfig = 'path/to/your/config.js'

This will override the one in .vim/syntax_checkers/compilers/nodelint-config. There is one more level of overriding you can perform, and this is at the project level. At the root level of your project, stick a file in there with the name nodelint-config.js and add the settings required by your project. In order for this to work, within Vim, you'll need to set the project root directory as the cwd for the Vim session.

Editor Themes

Themes included with this configuration:

  1. colorblind: Black background, super vibrant colors
  • snowblind: White background, vibrant colors (Not yet included)
  • octocat: Loosely based on the github syntax theme (Not yet included)
  • coronaburn: Similar to colorblind but with muted colors (Not yet included)

The color themes have been designed with similarities in the syntax settings. Jumping between multiple languages should be easy on the mind and the eyes. Be adventurous and mix it up once in a while.

Submodules

A few notes for future reference about working with git submodules taken from cheat sheets.

Adding Submodules:

git submodule add <remote_repository> <path/to/submodule>
git submodule init
git submodule update

Updating Submodules

git submodule foreach <command>

Removing Submodules

  1. Delete the relevant line from the .gitmodules file
  2. Delete the relevant section from .git/config
  3. Run git rm --cached path_to_submodule (no trailing slash)

Working With Your Own Submodules

In order to keep your personal submodules available to forks but allow commits back to the upstream master repository from within the submodule:

  1. Create the repository for your bundle within git
  • Then from the vimfiles directory add the submodule as you would any other submodule
  • Within your newly created submodule, create a remote reference to the upstream master repository
  • Make changes to the submodule and push updates back to the remote upstream master
  • Then whenever you pull updates to all of your submodules, you as well as everyone else should get the changes

Here is an example:

cd ~/.homesick/repos/vimfiles/
git submodule add git://github.com/mkitt/submodule-name.vim.git home/.vim/bundle/submodule-name.vim
cd home/.vim/bundle/submodule-name.vim/
git remote add push git@github.com:mkitt/submodule-name.vim.git
git submodule init
git submodule update

Then whenever you make changes to the submodule:

cd ~/.homesick/repos/vimfiles/home/.vim/bundle/submodule-name.vim/
git push push master

This allows you to make changes directly in your submodule, see the effects and push the changes back without maintaining multiple repositories and linking them back and forth. Defunkt has a good article about working with submodules.

Todo Roadmap

The following should be completed shortly:

  • Dial in Objective C work flow as a replacement for Xcode
  • Dial in ActionScript work flow and snippets (put the final nail in the coffin for TextMate and Eclipse)
  • Vim Cheat Sheet for my settings
  • Further additions to .vimrc for language settings from DP and GV
  • Create the snowblind, octocat, and coronaburn themes

License and Contributions

All licensing for the Bundles/Plugins should be found in their respective repositories. Anything written by me is of course open source through MIT. While contributions are welcome, you're probably better off forking and tuning it to your own machine.

Copyright (c) 2010 by Matthew Kitt

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

My Vim configuration

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published