Created
November 7, 2011 19:13
-
-
Save tundal45/1345851 to your computer and use it in GitHub Desktop.
My Vim Configuration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nocompatible " explicitly get out of vi compatibility mode | |
set number " enable line numbers | |
set ruler " always show current position on the status line | |
syntax on " turn syntax highlighting on | |
set encoding=utf-8 | |
" Whitespace related | |
set nowrap | |
set tabstop=2 " how many columns a tab counts for | |
set shiftwidth=2 " how many columns text is indented with reindent operations | |
set softtabstop=2 " how many columns vim uses when hitting tab in insert mode | |
set expandtab " convert tabs into appropriate number of spaces | |
" load the plugin and indent settings for the detected filetype | |
filetype plugin indent on | |
" Searching | |
set hlsearch " highlight all search pattern matches | |
set incsearch " highlight first match as you type (incremental search) | |
set ignorecase " ignore case for search | |
set smartcase " case-sensitive search if search contains uppercase character & ignorecase is on | |
" Tab Completion | |
set wildmode=list:longest,list:full | |
set wildignore+=*.o,*.obj,.git,*.rbc,*.class,.svn,vendor/gems/* | |
" Status Bar | |
set laststatus=2 " always show the status bar | |
set statusline=%t\ %r\ %y\ format:\ %{&ff};\ [%c,%l] " Format statusbar http://vim.runpaint.org/display/changing-status-line/ | |
" Pathogen | |
call pathogen#infect() | |
call pathogen#helptags() | |
" Leader key | |
let mapleader="," | |
" 78 column layout | |
set textwidth=78 " set maximum characterwidth to be 78 | |
if exists('+colorcolumn') | |
set colorcolumn=78 " show a marker as a guide | |
endif | |
" Thorfile, Rakefile, Vagrantfile and Gemfile are Ruby | |
au BufRead,BufNewFile {Gemfile,Rakefile,Vagrantfile,Thorfile,config.ru} set ft=ruby | |
" add json syntax highlighting | |
au BufNewFile,BufRead *.json set ft=javascript | |
" show partial commands in the status line | |
set showcmd | |
" make Vim look pretty in iTerm2 | |
set t_Co=256 | |
" GUI Font | |
if has('gui_macvim') | |
set guifont=Inconsolata-g:h18 " use this font | |
set guioptions=egmrt " don't show toolbar | |
endif | |
" Solarized | |
syntax enable | |
if has('gui_macvim') | |
set background=light | |
colorscheme solarized | |
else | |
set background=dark | |
endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment