-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvimrc
199 lines (148 loc) · 4.98 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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
filetype plugin on
filetype indent on
set expandtab
set shiftwidth=4
set softtabstop=4
set autoindent
set smartindent
syntax enable
set background=dark
set mouse=r
colorscheme solarized
set visualbell
" enable pathogen
execute pathogen#infect()
" don't keep a swap file
set noswapfile
" show line numbers on left
set number
" show column numbers in statusline
set ruler
" find the next match as we type the search
set incsearch
" hilight searches by default
set hlsearch
" disable folding
set nofoldenable
" allow vim to find tags file in parent directories
set tags=tags
set foldmethod=syntax
" vimdiff always vertical splits
if &diff
set diffopt-=internal
set diffopt+=vertical
endif
" exit insert mode without leaving home row
inoremap jj <Esc>
map <C-i> :noh<CR>
set exrc " enable per-directory .vimrc files
set secure " disable unsafe commands in local .vimrc files
" open text files with markdown syntax and spell checking
au BufNewFile,BufRead *.txt setf markdown
" set glsl as syntax for files
au BufNewFile,BufRead *.frag,*.vert,*.vsh,*.fsh setf glsl
au BufNewFile,BufRead *.coffee setf js
au BufNewFile,BufRead *.gradle setf groovy
au BufNewFile,BufRead *.conjure setf yaml
au FileType yml,yaml setl sw=2 sts=2 ts=2 expandtab
au BufNewFile,BufRead *.txt,*.md set tw=80 spell
set formatoptions+=t
" let mapleader = ","
" this was commented out with zsh/solarized --- let g:solarized_termcolors=256
" better colors when logging in remotely through tmux
let g:remoteSession = ($STY == "")
if g:remoteSession
set t_Co=256
endif
" Turn off folding
set nofoldenable
" fix some fucked up Vim 7.4 backspace problems
set backspace=2
" read pdf into buffer
command! -complete=file -nargs=1 Rpdf :r !pdftotext -nopgbrk <q-args> -
" auto resize panes when window is resized
autocmd VimResized * wincmd =
" #############################
" #### C++11 for Syntastic ####
" #############################
let g:syntastic_cpp_compiler = 'clang++'
"let g:syntastic_cpp_compiler_options = ' -std=c++11'
" ########################
" #### Java Specifics ####
" ########################
" Highlight functions using Java style
let java_highlight_functions="style"
" Don't flag C++ keywords as errors
let java_allow_cpp_keywords=1
" ###########################
" #### Vim-lldb Settings ####
" ###########################
" same mappings as Eclipse
map <F5> :Lstepin<CR>
map <F6> :Lnext<CR>
map <F7> :Lfinish<CR>
map <F8> :Lcontinue<CR>
" ###########################
" #### NERDTree settings ####
" ###########################
" Ctrl-n opens NERDTree
map <C-n> :NERDTreeToggle<CR>
" show current file in NERDTree
nmap ,n :NERDTreeFind<CR>
" ignore dirs containing build
" let NERDTreeIgnore=['\~$', '^build[[dir]]']
" let g:ctrlp_custom_ignore = {
" \ 'dir': '^build',
" \ }
nnoremap <C-J> <C-W>j
nnoremap <C-K> <C-W>k
nnoremap <C-L> <C-W>l
nnoremap <C-H> <C-W>h
" #############################
" #### EasyMotion Settings ####
" #############################
" Bi-directional find motion
" Jump to anywhere you want with minimal keystrokes, with just one key binding.
" `s{char}{label}`
nmap s <Plug>(easymotion-s)
hi EasyMotionTarget2First ctermbg=none ctermfg=red
hi EasyMotionTarget2Second ctermbg=none ctermfg=red
" ###########################
" #### Fugitive Settings ####
" ###########################
" Map .. to move up to the parent commit when viewing a tree or blob object
autocmd User fugitive if fugitive#buffer().type() =~# '^\%(tree\|blob\)$' | nnoremap <buffer> .. :edit %:h<CR> | endif
" ############################
" #### Vim-Latex Settings ####
" ############################
" IMPORTANT: grep will sometimes skip displaying the file name if you
" search in a singe file. This will confuse Latex-Suite. Set your grep
" program to always generate a file-name.
set grepprg=grep\ -nH\ $*
" OPTIONAL: This enables automatic indentation as you type.
filetype indent on
" OPTIONAL: Starting with Vim 7, the filetype of empty .tex files defaults to
" 'plaintex' instead of 'tex', which results in vim-latex not being loaded.
" The following changes the default filetype back to 'tex':
let g:tex_flavor='latex'
let g:Tex_DefaultTargetFormat = 'pdf'
" vim-latex useful commands:
" \ll : compile file
" \rf : fold all (unfold if cursor is on a fold)
" za : fold/unfold section under cursor
" load the types.vim highlighting file, if it exists
autocmd BufRead,BufNewFile *.[ch] let fname = expand('<afile>:p:h') . '/tags.vim'
autocmd BufRead,BufNewFile *.[ch] if filereadable(fname)
autocmd BufRead,BufNewFile *.[ch] exe 'so ' . fname
autocmd BufRead,BufNewFile *.[ch] endif
map <F2> :so tags.vim<CR>
" ################################
" #### YouCompleteMe Settings ####
" ################################
let g:ycm_global_ycm_extra_conf = "~/.vim/.ycm_extra_conf.py"
" ############################
" #### Syntastic Settings ####
" ############################
let g:syntastic_cpp_compiler = "clang++"
let g:syntastic_cpp_compiler_options = "-std=c++11 -Wall -Wextra -Wpedantic"
let g:syntastic_c_check_header = 1