-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
183 lines (149 loc) · 4.93 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
set nocompatible
filetype off
" set the runtime path to include Vundle and initialize
set rtp+=~/.config/nvim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
Plugin 'tpope/vim-fugitive'
Plugin 'tpope/vim-repeat'
Plugin 'tpope/vim-surround'
Plugin 'vim-scripts/rainbow_parentheses.vim'
Plugin 'tpope/vim-pathogen'
Plugin 'neomake/neomake'
Plugin 'vim-airline/vim-airline'
Plugin 'zah/nim.vim'
" Syntastic is now replaced, except for Drupal.
"Plugin 'vim-syntastic/syntastic'
Plugin 'Valloric/YouCompleteMe', {
\ 'build' : {
\ 'mac' : './install.sh --clang-completer --system-libclang --omnisharp-completer',
\ 'unix' : './install.sh --clang-completer --system-libclang --omnisharp-completer',
\ 'windows' : './install.sh --clang-completer --system-libclang --omnisharp-completer',
\ 'cygwin' : './install.sh --clang-completer --system-libclang --omnisharp-completer'
\ }
\ }
Plugin 'SirVer/ultisnips'
" Snippets for ultisnips
Plugin 'honza/vim-snippets'
Plugin 'sbdchd/neoformat'
Plugin 'tell-k/vim-autopep8'
Plugin 'airblade/vim-gitgutter'
Plugin 'psf/black'
call vundle#end()
" Allow YCM for all filetypes.
let g:ycm_filetype_blacklist = {}
" Trigger configuration. Do not use <tab> if you use https://github.com/Valloric/YouCompleteMe.
let g:UltiSnipsExpandTrigger=";;"
let g:UltiSnipsJumpForwardTrigger="<c-j>"
let g:UltiSnipsJumpBackwardTrigger="<c-k>"
let g:UltiSnipsEditSplit="vertical"
let g:UltiSnipsSnippetsDir = '~/.config/nvim/UltiSnips'
"set runtimepath+=~/.config/nvim/UltiSnips
"" Settigns and remaps that it's OK for plugin settings to override.
set visualbell
" Relative line numbers
set relativenumber
set undofile
" For real RegEx instead of Vim-style.
nnoremap / /\v
vnoremap / /\v
" Replace All.
set gdefault
" Quick Escape.
inoremap jj <ESC>
" Convienience.
nnoremap ; :
nnoremap <C-f> :Autopep8
" Terminal Escape
tnoremap <Esc> <C-\><C-n>
" Syntastic plugin with Drupal Coding Standards
"let g:syntastic_php_phpcs_args="--standard=Drupal --extensions=php,module,inc,install,test,profile,theme"
" from https://github.com/spf13/spf13-vim/blob/master/.vimrc
if has('statusline')
set laststatus=2
" Broken down into easily includeable segments
set statusline=%<%f\ " Filename
set statusline+=%w%h%m%r " Options
set statusline+=%{fugitive#statusline()} " Git Hotness
set statusline+=\ [%{&ff}/%Y] " filetype
" set statusline+=\ [%{getcwd()}] " current dir
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_enable_signs=1
set statusline+=%=%-14.(%l,%c%V%)\ %p%% " Right aligned file nav info
endif
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
let g:syntastic_python_python_exec = '/usr/bin/python3'
" Trim trailing white-space on save.
autocmd BufWritePre <buffer> :%s/\s\+$//e
autocmd FileType php setlocal omnifunc=phpcomplete_extended#CompletePHP
autocmd VimLeave * mksession! /home/matt/.session.vim
autocmd FileType md set filetype=markdown
autocmd FileType conf set filetype=yaml
autocmd FileType pp set filetype=puppet
" Disable AutoComplPop.
let g:acp_enableAtStartup = 0
" Use neocomplete.
"let g:neocomplete#enable_at_startup = 1
" Use smartcase.
"let g:neocomplete#enable_smart_case = 1
" Set minimum syntax keyword length.
"let g:neocomplete#sources#syntax#min_keyword_length = 3
set wrap linebreak nolist
set colorcolumn=80
let &showbreak = '\'
let &breakat = ' '
nnoremap <F8> :setl noai nocin nosi inde=<CR>
set backupdir=~/.vim/tmp,.
set directory=~/.vim/tmp,.
set ignorecase
set smartcase
set t_Co=256
hi Folded ctermbg=233 ctermfg=248
set shiftwidth=2
set expandtab
set tabstop=4
autocmd Filetype python set shiftwidth=4
set foldmethod=indent
" For security.
set modelines=0
set tags=./tags
"" Neomake will handle linting python, see below.
"let g:syntastic_python_checkers = ['pylama', 'mypy']
"let g:syntastic_aggregate_errors = 1
"let g:syntastic_debug = 33
" Neomake config
function! MyOnBattery()
if has('mac')
return
" @TODO
endif
return readfile('/sys/class/power_supply/AC/online') == ['0']
endfunction
if MyOnBattery()
call neomake#configure#automake('w')
else
call neomake#configure#automake('nw', 1000)
endif
let g:neomake_open_list = 2
let g:neomake_python_mypy_maker = {
\ 'exe': 'mypy',
\ 'args': ['--check-untyped-defs', '--allow-untyped-defs',
\ '--ignore-missing', '--follow-imports=skip'],
\ 'errorformat': '%E%f:%l: error: %m,%W%f:%l: warning: %m,%I%f:%l: note: %m',
\ }
let g:neomake_python_enabled_makers = ['python', 'pylama', 'mypy']
let g:neoformat_enabled_python = ['docformatter']
augroup fmt
autocmd!
autocmd BufWritePre * undojoin | Neoformat
augroup END
" Color
highlight Search ctermbg=242 cterm=bold