Find file
Fetching contributors…
Cannot retrieve contributors at this time
129 lines (91 sloc) 3.68 KB
" Example Vim configuration.
" Copy or symlink to ~/.vimrc or ~/_vimrc.
set nocompatible " Must come first because it changes other options.
silent! call pathogen#runtime_append_all_bundles()
set t_Co=256
syntax enable " Turn on syntax highlighting.
filetype plugin indent on " Turn on file type detection.
runtime macros/matchit.vim " Load the matchit plugin.
" Backup directory
set backupdir=~/.vim/backupfiles,/var/tmp,/tmp,.
" Swapfile directory
set directory=~/.vim/swapfiles,/var/tmp,/tmp,.
set showcmd " Display incomplete commands.
set showmode " Display the mode you're in.
set cursorline
set encoding=utf-8 nobomb
set magic " extended regexes
set backspace=indent,eol,start " Intuitive backspacing.
set hidden " Handle multiple buffers better.
set wildmenu " Enhanced command line completion.
set wildmode=list:longest " Complete files like a shell.
set ignorecase " Case-insensitive searching.
set smartcase " But case-sensitive if expression contains a capital letter.
set number " Show line numbers.
set ruler " Show cursor position.
set scrolloff=3
set shortmess=I
set showmode
set incsearch " Highlight matches as you type.
set hlsearch " Highlight matches.
set wrap " Turn on line wrapping.
set scrolloff=3 " Show 3 lines of context around the cursor.
set title " Set the terminal's title
set visualbell " No beeping.
set nobackup " Don't make a backup before overwriting a file.
set nowritebackup " And again.
" set directory=$HOME/.vim/tmp//,. " Keep swap files in one location
set tabstop=2 " Global tab width.
set shiftwidth=2 " And again, related.
set expandtab " Use spaces instead of tabs
set whichwrap+=<,>,[,]
set laststatus=2 " Show the status line all the time
" Useful status information at bottom of screen
set statusline=[%n]\ %<%.99f\ %h%w%m%r%y\ %{fugitive#statusline()}%{exists('*CapsLockStatusline')?CapsLockStatusline():''}%=%-16(\ %l,%c-%v\ %)%P
" avoid Hit Enter to continue prompts
:set cmdheight=3
" Or use vividchalk
colorscheme molokai
" Tab mappings.
map <leader>tt :tabnew<cr>
map <leader>te :tabedit
map <leader>tc :tabclose<cr>
map <leader>to :tabonly<cr>
map <leader>tn :tabnext<cr>
map <leader>tp :tabprevious<cr>
map <leader>tf :tabfirst<cr>
map <leader>tl :tablast<cr>
map <leader>tm :tabmove
map <leader>d :NERDTreeToggle<cr>
" Uncomment to use Jamis Buck's file opening plugin
" map <Leader>f :FuzzyFinderTextMate<Enter>
" Controversial...swap colon and semicolon for easier commands
"nnoremap ; :
"nnoremap : ;
"vnoremap ; :
"vnoremap : ;
" Automatic fold settings for specific files. Uncomment to use.
"autocmd FileType ruby setlocal foldmethod=syntax
"autocmd FileType css setlocal foldmethod=indent shiftwidth=2 tabstop=2
" For the MakeGreen plugin and Ruby RSpec. Uncomment to use.
autocmd BufNewFile,BufRead *_spec.rb compiler rspec
let g:bufExplorerShowRelativePath=1
"autocmd VimEnter * silent! Gcd
"autocmd VimEnter * NERDTree
"autocmd VimEnter * wincmd w
nnoremap j gj
nnoremap k gk
vnoremap j gj
vnoremap k gk
nnoremap <Down> gj
nnoremap <Up> gk
vnoremap <Down> gj
vnoremap <Up> gk
inoremap <Down> <C-o>gj
inoremap <Up> <C-o>gk
if has("gui_macvim")
let macvim_hig_shift_movement = 1
"highlight underscore jst templates
au BufRead,BufNewFile *.jst set filetype=jst