-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
90 lines (76 loc) · 1.96 KB
/
vimrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
" General
filetype on " If you don't do this, vim will exit nonzero
filetype off
call pathogen#runtime_append_all_bundles()
call pathogen#helptags()
filetype plugin indent on
set nocompatible
set wm=2
set history=1000
" Tabs and spacing
set expandtab
set tabstop=2
set shiftwidth=2
set autoindent
set smartindent
set wrap
autocmd FileType python set tabstop=4 | set shiftwidth=4
" UI
set number
set t_Co=256
set ruler
" Visual Cues
set showmatch
set ignorecase
set incsearch
set hlsearch
" Backups
set nobackup
set nowritebackup
set noswapfile
set backupdir=$HOME/.vim/backup
set backupcopy=yes
set backupskip=/tmp/*,$TMPDIR/*,$TMP/*,$TEMP/*
set directory=~/.vim/swap,~/tmp,.
" Filetypes
au BufRead,BufNewFile /etc/nginx/* set ft=nginx
au BufRead,BufNewFile *.json set ft=javascript foldmethod=syntax
au BufRead,BufNewFile */zsh/*,zshrc set ft=zsh
au BufRead,BufNewFile Vagrantfile,Gemfile set ft=ruby
" Colors
syntax enable
set background=dark
colorscheme solarized
" Mappings
" emacs movement in insert mode
imap <C-a> <C-o>0
imap <C-e> <C-o>$
map <C-e> $
map <C-a> 0
" Tabs
" map <C-t><up> :tabr<cr>
" map <C-t><down> :tabl<cr>
" map <C-t><left> :tabp<cr>
" map <C-t><right> :tabn<cr>
" map <C-w> <C-w>w " Ctrl-W toggles windows
" Paste
set pastetoggle=<F2>
" GUI
set guicursor=a:blinkon0 " Stop the scourge of blinking cursors
set guifont=Inconsolata:h13
set guioptions-=T " Hide the macvim toolbar (floppy disks?)
set guioptions-=L
set guioptions-=r
"ruby
autocmd FileType ruby,eruby set omnifunc=rubycomplete#Complete
autocmd FileType ruby,eruby let g:rubycomplete_buffer_loading = 1
autocmd FileType ruby,eruby let g:rubycomplete_rails = 1
autocmd FileType ruby,eruby let g:rubycomplete_classes_in_global = 1
"improve autocomplete menu color
highlight Pmenu ctermbg=238 gui=bold
" NERDTree
let NERDTreeShowHidden=1
let NERDTreeIgnore=['\.pyc$', '\.DS_Store$']
nmap <silent> <C-n> :NERDTreeToggle<CR>
set autoread " Suppress obnoxious warning
set autochdir