2010-11-30 12:26:57 +11:00
|
|
|
set nocompatible
|
|
|
|
|
2010-11-30 01:02:34 +11:00
|
|
|
" Pathogen setup
|
2010-11-30 01:35:37 +11:00
|
|
|
runtime! autoload/pathogen.vim
|
|
|
|
if exists('g:loaded_pathogen')
|
|
|
|
filetype off
|
|
|
|
|
2010-11-30 12:26:57 +11:00
|
|
|
call pathogen#runtime_append_all_bundles()
|
2010-11-30 01:35:37 +11:00
|
|
|
call pathogen#helptags()
|
|
|
|
endif
|
2010-11-30 01:02:34 +11:00
|
|
|
|
2010-12-06 13:06:09 +11:00
|
|
|
" Syntax
|
2010-11-30 01:02:34 +11:00
|
|
|
syntax on
|
2010-11-30 01:35:37 +11:00
|
|
|
filetype plugin indent on
|
2010-12-06 13:06:09 +11:00
|
|
|
match ErrorMsg '\%>80v.\+'
|
|
|
|
|
|
|
|
|
|
|
|
" UI
|
|
|
|
set number
|
|
|
|
set ruler
|
|
|
|
set guioptions=aAce
|
|
|
|
set mouse=a
|
2010-11-30 01:02:34 +11:00
|
|
|
colorscheme railscasts
|
|
|
|
|
2010-12-06 13:06:09 +11:00
|
|
|
" Tabs/Whitespace
|
2010-11-30 01:02:34 +11:00
|
|
|
set tabstop=2
|
|
|
|
set shiftwidth=2
|
|
|
|
set autoindent
|
|
|
|
set smarttab
|
|
|
|
set expandtab
|
2010-12-06 13:06:09 +11:00
|
|
|
set nowrap
|
|
|
|
set list listchars=tab:\ \ ,trail:·
|
2010-11-30 01:02:34 +11:00
|
|
|
|
2010-12-06 13:06:09 +11:00
|
|
|
" Searching
|
|
|
|
set hlsearch
|
|
|
|
set incsearch
|
|
|
|
set ignorecase
|
|
|
|
set smartcase
|
|
|
|
|
|
|
|
" Tab completion
|
|
|
|
set wildmode=list:longest,list:full
|
|
|
|
set wildignore+=*.o,*.obj,.git,*.rbc
|
|
|
|
|
|
|
|
" Status bar
|
|
|
|
set laststatus=2
|
|
|
|
|
|
|
|
" CTags
|
|
|
|
map <Leader>rt :!ctags --extra=+f -R *<CR><CR>
|
|
|
|
|
|
|
|
" Remember last location in file
|
|
|
|
if has("autocmd")
|
|
|
|
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
|
|
|
|
\| exe "normal g'\"" | endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
function s:setupWrapping()
|
|
|
|
set wrap
|
|
|
|
set wm=2
|
|
|
|
set textwidth=72
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
function s:setupMarkup()
|
|
|
|
call s:setupWrapping()
|
|
|
|
map <buffer> <Leader>p :Mm <CR>
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
" make and python use real tabs
|
|
|
|
au FileType make set noexpandtab
|
|
|
|
au FileType python set noexpandtab
|
|
|
|
|
|
|
|
" Thorfile, Rakefile and Gemfile are Ruby
|
|
|
|
au BufRead,BufNewFile {Gemfile,Rakefile,Thorfile,config.ru} set ft=ruby
|
|
|
|
|
|
|
|
" md, markdown, and mk are markdown and define buffer-local preview
|
|
|
|
au BufRead,BufNewFile *.{md,markdown,mdown,mkd,mkdn} call s:setupMarkup()
|
|
|
|
|
|
|
|
au BufRead,BufNewFile *.txt call s:setupWrapping()
|
|
|
|
|
|
|
|
" allow backspacing over everything in insert mode
|
|
|
|
set backspace=indent,eol,start
|
2010-11-24 17:43:17 +11:00
|
|
|
|
|
|
|
" Window manipulation
|
2010-11-30 01:02:57 +11:00
|
|
|
"map tt <C-w>
|
2010-11-24 17:43:17 +11:00
|
|
|
map <C-w><Backspace> <C-w><Left> | " This and the below are also useful for colemak
|
|
|
|
map <C-w><Space> <C-w><Right>
|
|
|
|
|
|
|
|
" Surrounds shortcuts for visual selections
|
2010-11-30 01:02:57 +11:00
|
|
|
"vmap " s"
|
|
|
|
"vmap ' s'
|
|
|
|
"vmap ( s)
|
|
|
|
"vmap [ s]
|
|
|
|
"vmap { s}
|
|
|
|
"vmap < s>
|
2010-11-24 17:43:17 +11:00
|
|
|
|
|
|
|
" Pressing backspace with selection does something weird
|
|
|
|
" thanks to above surrounds shortcuts so let's be specific
|
|
|
|
" here:
|
|
|
|
vmap <Backspace> xi
|
|
|
|
|
|
|
|
" Colemak
|
|
|
|
"
|
|
|
|
" * Switch 'h' and 'n' (so 'up' is on top of 'down').
|
|
|
|
" * Use <Space> and <Backspace> for <Right> and <Left>, instead (and disable 'j'
|
|
|
|
" and 'l' which are where 'y' and 'u' are in in QWERTY)
|
|
|
|
nmap h <Up>
|
|
|
|
nmap k <Down>
|
|
|
|
|
|
|
|
" Nicer split controls
|
|
|
|
"map <C-_> normal :split<CR>
|
|
|
|
"map <C-\|> normal :vsplit<CR>
|
|
|
|
|
2010-11-24 18:37:37 +11:00
|
|
|
" Emacs-like keys for the command line
|
|
|
|
cnoremap <C-A> <Home>
|
|
|
|
cnoremap <C-E> <End>
|
|
|
|
cnoremap <C-K> <C-U>
|
|
|
|
|
2010-11-24 18:38:01 +11:00
|
|
|
set wildignore+=Transmission*Remote*GUI
|
2010-11-24 18:37:37 +11:00
|
|
|
|
2010-11-30 01:03:50 +11:00
|
|
|
let g:ragtag_global_maps = 1
|
|
|
|
|
2010-11-30 01:35:37 +11:00
|
|
|
if filereadable(expand('~/.vimrc.local'))
|
|
|
|
source ~/.vimrc.local
|
|
|
|
endif
|
|
|
|
|