-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
277 lines (225 loc) · 7.42 KB
/
Copy pathvimrc
File metadata and controls
277 lines (225 loc) · 7.42 KB
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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
filetype off " Required for Vundle
set shell=/bin/bash
if has('python3')
silent! python3 1
endif
call plug#begin()
Plug 'kien/ctrlp.vim'
Plug 'kshenoy/vim-signature'
Plug 'SirVer/ultisnips'
Plug 'Valloric/YouCompleteMe'
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-obsession'
" Colorschemes
Plug 'vim-scripts/Wombat'
Plug 'zeis/vim-kolor'
Plug 'morhetz/gruvbox'
Plug 'fatih/molokai'
" Indent Guides
Plug 'nathanaelkane/vim-indent-guides'
" Trailing white space
Plug 'ntpeters/vim-better-whitespace'
" Rainbow ()'s
Plug 'luochen1990/rainbow'
" Dot graphviz
Plug 'wannesm/wmgraphviz.vim'
" Go
Plug 'fatih/vim-go'
"Plug 'rhysd/vim-go-impl'
" Plug 'jodosha/vim-godebug'
" Javascript/Typescript
Plug 'pangloss/vim-javascript'
Plug 'leafgarland/typescript-vim'
Plug 'eliba2/vim-node-inspect'
" C
Plug 'vim-scripts/a.vim'
" ctags
" Plug 'craigemery/vim-autotag'
" Ruby
"Plug 'tpope/vim-rvm'
Plug 'vim-ruby/vim-ruby'
Plug 'majutsushi/tagbar'
Plug 'tpope/vim-rails'
let g:ycm_filetype_specific_completion_to_disable = {
\ 'ruby': 1
\}
" terraform
Plug 'hashivim/vim-terraform'
" cloudformation
" Plug 'speshak/vim-cfn'
" let g:syntastic_cloudformation_checkers = ['cfn_lint']
" Xml
Plug 'othree/xml.vim'
" Json
Plug 'elzr/vim-json'
" Markdown
Plug 'tpope/vim-markdown'
" yaml
Plug 'stephpy/vim-yaml'
" nginx
Plug 'chr4/nginx.vim'
" .csv
Plug 'chrisbra/csv.vim'
" php
Plug '2072/PHP-Indenting-for-VIm'
Plug 'StanAngeloff/php.vim'
Plug 'phpstan/vim-phpstan'
" Git
Plug 'tpope/vim-git'
Plug 'tpope/vim-fugitive'
Plug 'tommcdo/vim-fubitive'
Plug 'tpope/vim-rhubarb'
Plug 'airblade/vim-gitgutter'
" Syntax check
Plug 'scrooloose/syntastic'
" Paste over
Plug 'prurigro/ReplaceWithRegister'
" Search with Replace
Plug 'dkprice/vim-easygrep'
call plug#end()
" Powerline
" set rtp+=/Users/peterdalinis/Library/Python/2.7/lib/python/site-packages/powerline/bindings/vim
python3 from powerline.vim import setup as powerline_setup
python3 powerline_setup()
python3 del powerline_setup
let g:Powerline_symbols="fancy"
" set rtp+=usr/local/lib/python2.7/site-packages/powerline/bindings/vim
set t_Co=256
" Filetype detection, plugins, indent, syntax {{{1
if has('autocmd')
filetype plugin indent on " Turn on Filetype detection, plugins, and indent
endif
if has('syntax') && !exists('g:syntax_on')
syntax enable " Turn on syntax highlighting
endif
" Moving around, searching and patterns
set nostartofline " keep cursor in same column for long-range motion cmds
set incsearch " Highlight pattern matches as you type
set ignorecase " ignore case when using a search pattern
set smartcase " override 'ignorecase' when pattern has upper case character Displaying text
set scrolloff=3 " number of screen lines to show around the cursor
set number " show line numbers
set relativenumber " show relative numbers
set linebreak " For lines longer than the window, wrap intelligently. This doesn't insert hard line breaks.
set showbreak=↪\ \ " string to put before wrapped screen lines
set sidescrolloff=2 " min # of columns to keep left/right of cursor
set display+=lastline " show last line, even if it doesn't fit in the window
set cmdheight=2 " # of lines for the command window cmdheight=2 helps avoid 'Press ENTER...' prompts
" Define characters to show when you show formatting stolen from https://github.com/tpope/vim-sensible
if &listchars ==# 'eol:$'
set listchars=tab:>\ ,trail:-,extends:>,precedes:<,nbsp:+
if &termencoding ==# 'utf-8' || &encoding ==# 'utf-8'
let &listchars = "tab:\u21e5 ,trail:\u2423,extends:\u21c9,precedes:\u21c7,nbsp:\u26ad"
endif
endif
" Syntax, highlighting and spelling
set background=dark
colorscheme gruvbox
let g:rehash256=1
"let g:molokai_original = 1
set hls
" Multiple windows
set laststatus=2 " Show a status line, even if there's only one Vim window
set hidden " allow switching away from current buffer w/o writing
set switchbuf=usetab
set showtabline=2 " always show tab line
" Terminal
set ttyfast
set showcmd " In the status bar, show incomplete commands as they are typed
set noshowmode " don't display the current mode (Insert, Visual, Replace) in the status line.
set ruler " Always display the current cursor position in the Status Bar
" Editing text
set backspace=indent,eol,start "backspace over everything
set nojoinspaces " Use only one space after '.' when joining lines, instead of two
set completeopt+=longest
set completeopt-=preview
" Tabs and indenting
set tabstop=2 " tab = 2 spaces
set shiftwidth=2 " autoindent indents 2 spaces
set smarttab " <TAB> in front of line inserts 'shiftwidth' blanks
set softtabstop=2
set shiftround " round to 'shiftwidth' for "<<" and ">>"
set expandtab
" Folding
if has('folding')
set nofoldenable " When opening files, all folds open by default
endif
" Diff mode
set diffopt+=vertical " start diff mode with vertical splits by default
" Reading and writing files
set autoread " Automatically re-read files changed outside of Vim
" Command line editing
set history=200 " Save more commands in history
" Multi-byte characters
set encoding=utf-8
" Browser
let g:netrw_browsex_viewer="google-chrome"
set spell spelllang=en_us
autocmd VimEnter * nested
\ if !argc() && empty(v:this_session) && filereadable('Session.vim') |
\ source Session.vim |
\ endif
" set wildignore+=*/tmp/*,*.so,*.swp,*.zip
" let g:ctrlp_custom_ignore = '\v[\/](node_modules|target|dist)|(\.(swp|ico|git|svn))$'
"
command -nargs=1 TabExpand call HandleTabTagExpand( <f-args> )
let s:commentchar = """
function HandleTabTagExpand(tagnumber)
let tagident = expand("<cword>")
redir @a
try
sil exe "tselect ".tagident
catch /^Vim(\a\+):E433:/ " no tag file
echom "No tag file found."
return
catch /^Vim(\a\+):E426:/ " tag not found
echom "Tag not found."
return
endtry
redir END
let tagresults = split(@a, "\n")
let tagmatches = []
let linenum = 0
for line in tagresults
if linenum % 3 != 1
" every third line contains the file names
let linenum = linenum + 1
continue
endif
" figure out where the filename actually starts
" (it's usually column 32, but it might be farther)
" one before 32 is 31, but index is 30 since arrays begin at zero
let filestart = 30
let c = line[filestart]
while (filestart < strlen(line))
let filestart = filestart + 1
if c == " "
break
endif
let c = line[filestart]
endwhile
" store the parsed match in an array
call add(tagmatches, strpart(line, filestart))
let linenum = linenum + 1
endfor
" navigate to the match specified by tagnumber
try
exe "tab drop ".tagmatches[a:tagnumber-1]
catch /^Vim(\a\+):E471:/ " argument required (means no tag found)
echom "Tag not found."
endtry
let done = 0
let matchcount = 0
let f_line = ""
while done < 1 && matchcount < 1000
sil exe "/".tagident
let f_line = getline(".")
let matchcount = matchcount + 1
if match(f_line, "^\s+".s:commentchar) < 0
let done = 1
endif
endwhile
let f_index = stridx( f_line, tagident )
sil exe "normal 0"
sil exe "normal ".f_index."l"
endfunction