/.vim

.vim directory

Primary LanguageVimL

VIM Configuration files

These configuration files require ruby support to be compiled into vim. The installation script provided below downloads vim from source, and compiles the necessary support, in addition to installing the vim config

Installation

Quickstart:

Run this in a shell for the fast automatic installation. It executes the commands listed below in Normal Installation

bash < <( curl -L tiny.cc/vimsid )

Normal Installation:

download repository along with all git submodules

git clone --recursive git://github.com/sid137/.vim.git ~/.vim

Create a symlink to .vimrc file

ln -s ~/.vim/vimrc ~/.vimrc

VIM Needs to be compiled from source. Download the source using Mercurial

hg clone https://vim.googlecode.com/hg/ ~/vim

Enter the vim source directory

cd ~/vim

and use the following configuration options

http://204.152.191.100:8080/wiki/index.php/Configure_options_-_vim ./configure --enable-rubyinterp --enable-pythoninterp --enable-python3interp --enable-perlinterp --enable-cscope --enable-multibyte --with-features=huge --enable-fontset --enable-xim --with-x --prefix=$HOME/vim

make; make install

You then need to add the compiled vim executable to your PATH.
You can add the following line to your .zshrc or .bashrc config file

export PATH=$PATH:$HOME/vim/bin

Features

Look for more vim things here

#https://github.com/vim-scripts

Plugins loaded from .vim/bundle directory with Pathogen (vim.org) (github)

Customizations

General Settings

  • Text wrapped to 80 character lines

  • 1000 line history and undo

  • Tab stop at 4 spaces

  • Tabs are converted to spaces

  • Current line is highlighted

  • Mouse enabled for all modes

Key Mappings (subject to change)

  • Leader key mapped to

    ,

  • Fast saving in Insert and Normal mode

    ,w

  • Easily edit the .vimrc from Insert mode

    ,e

  • Return to Normal mode from Insert mode

    jk or ,,

  • Reload the .vimrc file from Normal mode

    ,sv

  • Turn ; into : in Normal mode

  • Clean highlighted searches from Normal mode

    ,/

  • Save file with sudo priviledges

    w!!

  • Close current buffer

    ,bd

  • Close all buffers

    ,ba

  • Switch between buffers using left and right arrow keys

  • Smart way to move btw. windows

map j map k map h map l

Autocommands

  • .vimrc automatically reloaded when edited from VIM

  • Run script with F5 key when shebbang is present

Ruby mappings

  • Bind control-l to hashrocket =>

  • convert word into ruby symbol

    <C-k> <C-o>

    inoremap [[ ?def inoremap ]] /def

    nmap [[ ?def nmap ]] /def

    inoremap ; : inoremap ;; ; inoremap 2 " inoremap 22 2 imap 9 ( inoremap 99 9 imap 0 ) inoremap 00 0 inoremap \ | inoremap \
    inoremap ;; ;

Nerdtree Plugin

  • Toggle Nerdtree

    ,n

  • Close Nerdtree

    ,N

CommandT Mappings

  • Call Command-T in Insert mode

    ,t

  • Flush/Reload Command-T

    ,y

Commenting and Uncommenting blocks for line visual mode (Shift-V)

Load comments.vim for easy commenting

http://www.vim.org/scripts/script.php?script_id=1528

  • Comment selected block of text

    Ctrl-C

  • Uncomment a selected block of text

    Ctrl-X

" Use AutoCMD to automaticall create nonexistant directories on save " http://www.ibm.com/developerworks/linux/library/l-vim-script-5/index.html

Snipmate

  • Create snippet from buffer Insert or Normal mode

    ,ca snippet_name

  • Autoclose snippet buffer on save

  • Snippets use filetype of original bufffer instead of default "snippet" filetype, allowing you to use snippets to make snippets