vixploder - “it may explode your vim”

DESCRIPTION:

A simple ‘dotfiles’ management tool used to distribute common configuration files across multiple machines.

DETAILS

The idea is not incredibly novel, but after realizing how poor the default VIM configuration is (at least on OS X), I wanted to be able to share mine with a few friends. Standard configuration files for other tools can easily be added to the tool, such as a core .profile, .screenrc file, or Emacs config files…VIM is just the “test-case” for the distribution method at this point.

Vixploder is designed to give room for machine-/user-specific overrides. For example, the .vimrc file sources a ~/.local_vimrc file. These ‘local dotfiles’ are intentionally left out of version control and intended for settings that are either machine-specific or something a user may not want to be in a publicly-available repository. A couple examples of such content would be aliases for SSH-ing into a server with a particular username (ie: site aliased to ssh my_username@my_website.com), or aliases to machine-specific paths for a project directory (both of these examples would be for your shell setup files, not vimrc, but the logic is the same…maybe you want a different colorscheme on a particular server in VIM).

The VIM configuration is tailored to Ruby/Rails developers at this point, as that is what I currently work with/on. The intention of this project is not to be the “setup everyone uses without changing”. Instead, fork it and set your own “sane” defaults for whatever your preferences are and then use that as your own base. The .vimrc file is extensively commented. Turning off a setting is as easy as putting a ‘“’ (double-quote character) as the first character of the line. Modifying it is either intuitive or as easy as typing :help <setting name> (in vi) to check the possible parameters the setting accepts.

The vixplode command will backup & symlink any files named .[filename] in your home directory (which it replaces) with each file/directory in lib/dotfiles (of the vixploder directory structure). For example, there is a vimrc file in lib/dotfiles…which will be symlinked to ~/.vimrc. Same goes for the vim directory. The original files are backed up to ~/vixploder_backup/. If you want to revert the installation, you can remove the symlinks created and copy your files back into your home directory (there will be a script to do this for you soon…).

What’s included:

Solid Default VIM Configuration

  • The VIM configuration will be covered in more detail elsewhere (YTBD), but a few of the ‘highlights’ are:

    • Pleasant-looking vim & gVim color schemes (see ‘Requirements’ section for terminal support)

    • Has Jamis Buck’s (awesome) FuzzyFinderTextmate plugin bundled in and set up to /-f (backslash-f)

    • Mouse support is enabled (yes, in the terminal too…)

    • Ships with a few other popular plugins (and maybe some not-so-popular that I find useful/cool), such as:

      • NERDTree.vim (link)

        • Directory-tree on sidebar of window (similar to TextMate’s “drawer”)

      • Rails.vim (link)

        • Plugin by Tim Pope which makes jupming around to different files in a Rails app a snap

      • Gist.vim

      • GITDiff.vim

        • Shows a diff of what has changed in the current file since HEAD

      • Comments.vim (link)

        • Easily (un)comment blocks of code by hitting Ctl-c

      • Matchit.vim (link)

        • Enhanced match-support for opening/closing brackets & method declarations

      • MRU.vim (Most Recently Used files) (link)

        • Quickly jump to recently used files by hitting Ctl-o

      • Rspec.vim

        • Adds shortcuts for running Rspec tests (read rspec.vim & modify to suit your preferences)

      • Snippets.vim (link)

        • Makes it dead-simple to add “snippets” of code which will auto-expand for you…similar to many other editors (TextMate obviously being a popular one in Rails-land).

      • Surround.vim (link)

        • Simplifies “surrounding” text with a pattern of characters, such as quotes, parens, or opening & closing HTML/XML tags.

      • SuperTab.vim (link)

        • Gives tab-completion in VIM. Works pretty well with Ruby. I do not use this often, but…it’s kind of neat…and can come in handy at times.

    • A couple useful abbreviations

      • lorem is expanded to a paragraph of ‘Lorem ipsum’ text

      • hh becomes =>

    • Sane defaults most people familiar with other editors would expect

      • Things like: arrow keys being correctly mapped, auto-indenting, being able to ‘delete’ to a previous line, soft tabs, et cetera…

Shell Aliases

NOTE: For now, there is an aliases file which will be symlinked to ~/.aliases. Because vixploder is not sending any default shell profiles (yet), you need to source this file in the appropriate shell initiliazation file if you are interested in using the aliases outlined below (.profile, .tcshrc, .zshrc, .bashrc…whatever your preference).

  • SVN

    • up : performs an svn update --ignore-externals to make updates a bit faster

  • Git

    • g: git

    • gst: git status

    • gl: git pull

    • gp: git push

    • gc: git commit -v

    • gca: git commit -v -a

    • gb: git branch

    • gba: git branch -a

    • ga: git add

  • Rails

    • ss: ./script/server --debugger

    • sc: ./script/console

    • sg: ./script/generate

    • sas:./script/autospec

  • Misc

    • vil: vi $_ (which opens last argument of previous command in vi…useful for…say…after you copy a file)

    • mr: mate app config db features lib public test spec vendor/plugins vendor/gems

REQUIREMENTS:

  • VIM compiled with Ruby support

    • You can check this by starting up vi and typing :version. If you have a +ruby, you are set. If not, you need to either compile in support yourself, or find a package which has done it for you.

      • For Mac-users: MacVim comes with this built in, but you may want to check your ‘terminal’ version of VIM if you want to be able to use vi in the terminal with the same feature-set. If you have [MacPorts](www.macports.org/) installed, you should be able to just run:

        sudo port install vim +ruby
        

        …and be all set.

      • For Linux/Unix users missing the +ruby in the :version output: You should be able to run:

        sudo apt-get install vim-common vim-runtime vim-gnome
        

        …and be all set.

  • A 256-color-capable terminal application

    • For Mac-users: As of Version 2.0.1, build 240, Terminal.app on Mac OS X (10.5.5) does not meet this requirement. [iTerm](iterm.sourceforge.net/) does. Other applications may as well (recommendations welcome)…

    • For Linux/Unix users: You need to have ncurses-term installed. On apt-based systems, run:

      sudo apt-get install ncurses-term
      

INSTALL:

Installing as a gem:

If you already have github set up as a source for gem:

sudo gem install tomkersten-vixploder

Otherwise:

sudo gem install tomkersten-vixploder --source http://gems.github.com

Installing manually:

  1. Clone the repository (or download the repository and unpack it) to a stable local location

  2. Execute the ‘bin/vixplode’ command in the source directory

LICENSE:

(The MIT License)

Copyright © 2008 Tom Kersten

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.