-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
179 lines (144 loc) · 5.05 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
syntax on
set t_Co=256
colorscheme molokai
set tags=tags;/
set number " show line numbers
set expandtab " expand tabs to spaces
set tabstop=2 " tab = 2 speaces
set shiftwidth=2 "indent
set hls is " highlight search, incremental search
set autoindent
set ruler
set history=100
set showcmd
execute pathogen#infect()
set shell=zsh
"set shellcmdflag=-ci
set list
set listchars=tab:>-,trail:- " show tabs and trailing spaces
"set listchars=trail:- " show tabs and trailing spaces
"autocmd FileType go set listchars-=tab:>- " dont show tabs for golang
set ignorecase " Make searches case insensitive.
set smartcase " Make searches case-sensitive if they contain upper-case
" Wildignore RBC and doc files
set wildignore+=*.rbc,doc/*,*spec/cassettes/*,*tags*,*junit*,*target*
" Set spelling region to English
set spelllang=en
" Use proper clipboard
set clipboard=unnamed
" make the paren highlighting less distracting, swap fg and bg colors
highlight MatchParen ctermfg=208 ctermbg=16
set backspace=indent,eol,start
set laststatus=2
" statusline
" cf the default statusline: %<%f\ %h%m%r%=%-14.(%l,%c%V%)\ %P
" format markers:
" %< truncation point
" %n buffer number
" %f relative path to file
" %m modified flag [+] (modified), [-] (unmodifiable) or nothing
" %r readonly flag [RO]
" %y filetype [ruby]
" %= split point for left and right justification
" %-35. width specification
" %l current line number
" %L number of lines in buffer
" %c current column number
" %V current virtual column number (-n), if different from %c
" %P percentage through buffer
" %) end of width specification
set statusline=%<\ b%n\ \ \ %f\ \ \ %h%m%r%y\ \ \ line:%l\ of\ %L\ col:%c%V
" jj in insert mode will switch back to normal
:inoremap jj <Esc>
set modeline
set ls=2
" syntax highlight *.thor files as ruby
au BufRead,BufNewFile *.thor set filetype=ruby
" auto trim trailing whitespace on save
autocmd FileType c,cpp,java,php,coffee,javascript,ruby,scala,go,python autocmd BufWritePre <buffer> :%s/\s\+$//e
"fix behavior of backspace key
set backspace=indent,eol,start "fix for behavoir of backspace key
" alias common slow-shift typos to intended commands :W => :w
command WQ wq
command Wq wq
command BW bw
command Bw bw
command BP bp
command Bp bp
command W w
command Q q
" fix for scrolling and selection on Mac OSX 10.10.2
set mouse=a
" allows h,l to wrap to next line when it reaches beginning or EOL
set whichwrap+=<,>,h,l
" CtrlP VIM plugin options
" use find for building file index instead of vim globbing (buggy in OSX), rm common build dirs
let g:ctrlp_user_command = 'find %s -type f -not \( -path "*/.git/*" -prune \) -not \( -path "*node_modules*" -prune \) -not \( -path "*coverage*" -prune \) -not \( -path "*env*" -prune \) -not \( -path "*.gen/*" -prune \) -not \( -path "*tmp/*" -prune \) -not \( -path "*build/*" -prune \) -not \( -path "*Godeps*" -prune \) -not \( -path "*vendor/*" -prune \)'
" increase the default max size of results
let g:ctrlp_match_window = 'max:35'
" enable cross session caching
let g:ctrlp_clear_cache_on_exit = 0
" max number fo files to scan
let g:ctrlp_max_files = 100000
let g:ctrlp_max_depth = 100
" default mode to open CtrlP in
let g:ctrlp_cmd = 'CtrlP'
" fix for random issue with writing to crontab via tmp files on OSX 10.10
autocmd Filetype crontab setlocal nobackup nowritebackup
" set indent on certain file types to 4
autocmd FileType javascript,python,json set tabstop=4|set shiftwidth=4
autocmd BufRead,BufNewFile *.json set tabstop=4|set shiftwidth=4
" go uses 8
autocmd FileType go set tabstop=4|set shiftwidth=4|set noexpandtab|set nolist
" syntastic
set statusline+=\ \ %#warningmsg#
set statusline+=\ \ %{SyntasticStatuslineFlag()}
set statusline+=%*
" always fill in the location list when syntastic runs
let g:syntastic_always_populate_loc_list = 1
" auto open/close the location list 0 none 1 auto open&close 2 auto close
let g:syntastic_auto_loc_list = 0
let g:syntastic_check_on_open = 0
" don't check on :wq in active mode
let g:syntastic_check_on_wq = 0
" enable ballons, vim must be compiled with some balloons option
let g:syntastic_enable_balloons = 0
" Better :sign interface symbols
let g:syntastic_error_symbol = 'x'
let g:syntastic_warning_symbol = '!'
"short command aliases
command Sc SyntasticCheck
command Sm SyntasticToggleMode
command Si SyntasticInfo
command Sr SyntasticReset
let g:syntastic_javascript_checkers = ["standard"]
let g:syntastic_mode_map = {
\ "mode": "active",
\ "active_filetypes": [],
\ "passive_filetypes": [] }
let g:syntastic_quiet_messages = {
\ "regex": '.*Rule.*was removed and replaced by.*' }
" end syntastic
" set a light grey vertical line at max column width
set colorcolumn=81
" re-map Shift-Tab to de-tab (outdent)
" normal mode
nnoremap <S-Tab> <<
"insert mode
inoremap <S-Tab> <C-d>
" YouCompleteMe
""
""set nocompatible
""filetype off
""
""set rtp+=~/.vim/bundle/vundle
""call vundel#rc()
""
""Bundle 'gmarik/vundle'
""
""Bundle 'Valloric/YouCompleteMe'
""Bundle 'Valloric/ListToggle'
""Bundle 'scrooloose/syntastic'
call plug#begin()
Plug 'fatih/vim-go'
call plug#end()