Find file
Fetching contributors…
Cannot retrieve contributors at this time
124 lines (97 sloc) 2.85 KB
" We're using VIM, not VI
set nocompatible
" Windows has problem reading this file if I don't declare this early.
set encoding=utf-8
" Store swap files in fixed location, not current directory
set dir=~/.vimswap//,/var/tmp//,/tmp//,.
" Set map leader before plugins load.
let mapleader = ","
" LOAD ALL OF THE PLUGINS!
runtime bundle/pathogen/autoload/pathogen.vim
call pathogen#infect()
call pathogen#helptags()
let g:snips_author="Mattias Hermansson"
" A mouse is useful some times.
set mouse=a
if has('gui_running')
colorscheme solarized
" togglebg.vim is not autoloaded... :/
runtime bundle/colors-solarized/autoload/togglebg.vim
set background=dark
let g:solarized_contrast="high"
set go=ac
set guifont=DroidSansMono\ 9
elseif &t_Co==256
runtime bundle/colors-solarized/autoload/togglebg.vim
colorscheme solarized
set background=dark
let g:solarized_contrast="high"
let g:solarized_termcolors=256
else
colorscheme default
endif
" Save the last 50 commands in history and let me see commands not finished
" typing yet.
set history=50
set showcmd
set ruler
" Incremental and highlighted searching
set incsearch
set hlsearch
set updatetime=500
set cpoptions+=$
" It's ok to have unsaved files in the background (I promise)
set hidden
" Let the cursors move wherever it wants.
set virtualedit=all
set colorcolumn=80
set lazyredraw
set showmode
set wildmenu
" == Keyboard shortcuts ==
nmap <leader>b :ToggleBG<cr>
nmap <leader>l :set list!<cr>
nmap <leader>n :NERDTreeToggle<cr>
nmap <leader>r :RainbowParenthesesToggle<cr>
nmap <leader>t :TlistToggle<cr>
nmap <leader>ve :edit $MYVIMRC<cr>
nmap <leader>vs :source $MYVIMRC<cr>
nmap <leader>u :GundoToggle<cr>
nmap <leader>h :nohlsearch<cr>
nmap <leader>of :FSHere<cr>
nmap <leader>ol :FSRight<cr>
nmap <leader>oL :FSSplitRight<cr>
nmap <leader>oh :FSLeft<cr>
nmap <leader>oH :FSSplitLeft<cr>
nmap <leader>ok :FSAbove<cr>
nmap <leader>oK :FSSplitAbove<cr>
nmap <leader>oj :FSBelow<cr>
nmap <leader>oJ :FSSplitBelow<cr>
nmap <leader>td :vimgrep /[^A-Z]\(TODO\\|FIXME\\|CHANGED\\|BUG\\|HACK\)/g *<cr>
" Show invisibles
set nolist
set listchars=tab:\ ,trail:\ ,eol:¬
set number
set tabstop=4 " Length of a tab character
set shiftwidth=4
set softtabstop=4
set noexpandtab
" == Filtype specific commands ==
filetype plugin indent on " Let VIM understand the filetypes
syntax on
if has("autocmd")
autocmd Syntax * RainbowParenthesesLoadBraces
" More keywords when editing
autocmd Syntax * call matchadd('Todo', '\W\zs\(TODO\|FIXME\|CHANGED\|XXX\|BUG\|HACK\)')
autocmd Syntax * call matchadd('Debug', '\W\zs\(NOTE\|INFO\|IDEA\)')
" make quickfix window
autocmd QuickFixCmdPost [^l]* nested cwindow
autocmd QuickFixCmdPost l* nested lwindow
endif
if has("win32") || has("win64")
" Make VIM behave in Windows.
set backspace=2
set guifont=consolas:h9
set listchars=tab:\ \ ,trail:\ ,eol:¬
endif
set directory+=,~/tmp,$TMP