-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc
195 lines (161 loc) · 5.29 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
so ~/vimrc.local
if &term =~ '256color'
set t_ut=
endif
""""" teach of keys for different environments (tmux)
if &term =~ '^screen'
" Page keys http://sourceforge.net/p/tmux/tmux-code/ci/master/tree/FAQ
execute "set t_kP=\e[5;*~"
execute "set t_kN=\e[6;*~"
" Arrow keys http://unix.stackexchange.com/a/34723
execute "set <xUp>=\e[1;*A"
execute "set <xDown>=\e[1;*B"
execute "set <xRight>=\e[1;*C"
execute "set <xLeft>=\e[1;*D"
endif
""""" end teaching keys
""""" from https://github.com/junegunn/vim-plug README
call plug#begin('~/.vim/plugged')
""""" start easy-align - plugin for align around a character fetches https://github.com/junegunn/vim-easy-align
Plug 'junegunn/vim-easy-align'
" Start interactive EasyAlign in visual mode (e.g. vipga)
xmap ga <Plug>(EasyAlign)
" Start interactive EasyAlign for a motion/text object (e.g. gaip)
nmap ga <Plug>(EasyAlign)
""""" easy-align end
""""" start syntastic - plugin for static syntax checks for multiple languages
Plug 'vim-syntastic/syntastic'
"syntastic statusline info
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
set cursorline
"syntastic global flags, related to actions
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_javascript_checkers=['jshint']
let g:syntastic_ignore_files = ['.py']
" let g:syntastic_go_checkers = ['go', 'govet', 'errcheck']
let g:syntastic_quiet_messages = {"level":"warnings"}
let g:tern_show_argument_hints='on_hold'
let g:tern_map_keys=1
""""" end syntastic
""""" start nerdtree
Plug 'scrooloose/nerdtree'
"handy shortcut for nerd tree
map <C-n> :NERDTreeToggle<CR>
""""" end nerdtree
""""" start neocomplete - for autocomplete from history/docs/fs
if has('nvim')
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
else
Plug 'Shougo/deoplete.nvim'
Plug 'roxma/nvim-yarp'
Plug 'roxma/vim-hug-neovim-rpc'
endif
let g:deoplete#enable_at_startup = 1
"Plug 'Shougo/neocomplete'
""neocomplete config
"let g:neocomplete#enable_at_startup = 1
"let g:neocomplete#enable_smart_case = 1
"let g:neocomplete#sources#syntax#min_keyword_length = 3
if !exists('g:neocomplete#force_omni_input_patterns')
let g:neocomplete#force_omni_input_patterns = {}
endif
let g:neocomplete#force_omni_input_patterns.java = '\k\.\k*'
let g:neocomplete#force_omni_input_patterns.scala = '\k\.\k*'
""""" end neocomplete
""""" start vim-airline - for status bar
Plug 'vim-airline/vim-airline'
"airline config
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#branch#enabled = 1
let g:airline_powerline_fonts = 1
""""" end vim-airline
""""" start vim-go
Plug 'fatih/vim-go', { 'tag': 'v1.25', 'do': ':GoUpdateBinaries' }
"vim-go config
let g:go_fmt_command = "goimports"
""""" end vim-go
""""" start gocode
" Plug 'mdempsky/gocode', { 'rtp': 'vim', 'do': '~/.vim/plugged/gocode/vim/symlink.sh' }
""""" end gocode
" start closetag - to insert end tags in web markup
Plug 'alvan/vim-closetag'
"closetag config
let g:closetag_filenames = '*.html,*.xhtml,*.phtml,*.htm'
""""" end closetag
""""" start vm-jsbeautify - for web scripting
Plug 'maksimr/vim-jsbeautify'
"vim-jsbeautify config
autocmd FileType javascript noremap <buffer> <c-f> :call JsBeautify()<cr>
" autocmd FileType python noremap <buffer> <c-s-f> :!black %<cr>
" for json
autocmd FileType json noremap <buffer> <c-f> :call JsonBeautify()<cr>
" for jsx
autocmd FileType jsx noremap <buffer> <c-f> :call JsxBeautify()<cr>
" for html
autocmd FileType html noremap <buffer> <c-f> :call HtmlBeautify()<cr>
" for css or scss
autocmd FileType css noremap <buffer> <c-f> :call CSSBeautify()<cr>
""""" end vm-jsbeautify
""""" start snippets
" Plug 'SirVer/ultisnips' | Plug 'honza/vim-snippets'
""""" end snippets
""""" start comments plugin
Plug 'tpope/vim-commentary'
""""" end comments
""""" start surround
Plug 'tpope/vim-surround'
""""" end surround
""""" start ctrlp - fast file search
Plug 'kien/ctrlp.vim'
""""" end ctrlp
""""" start colorschemes - large collection of vim co
Plug 'flazz/vim-colorschemes'
""""" end colorschemes
"""" gruvbox colorscheme
Plug 'morhetz/gruvbox'
"""" end gruvbox
""""" start solorized theme - better solorized
Plug 'lifepillar/vim-solarized8'
""""" end solarized
"python stuff
" Plug 'python-mode/python-mode', { 'for': 'python', 'branch': 'develop' }
" let g:pymode_indent = 1
"end python stuff
"begin rainbow parens
Plug 'luochen1990/rainbow'
let g:rainbow_active = 1
"end rainbow parens
"begin clojure mode
Plug 'guns/vim-clojure-static'
"end clojure mode
"begin autoclose/autopair
" Plug 'jiangmiao/auto-pairs'
"end autoclose/autopair
Plug 'w0rp/ale'
let g:ale_linters = {'python': ['flake8', 'pydocstyle']}
let g:ale_fixers = {'*': [], 'python': ['black', 'isort']}
let g:ale_fix_on_save = 1
call plug#end()
""""" some ui stuff
"so entire background looks better
" set background=dark
"custom stuff
"theme name
colorscheme gruvbox
hi Visual ctermbg=4 ctermfg=0
"show some characters instead of white space
set listchars=tab:>~,nbsp:_,trail:.,extends:<,precedes:-
set list
""""" end ui stuff
"tab shorts from https://www.youtube.com/watch?v=1QD3u6NC5KU
nnoremap tn :tabnew<Space>
nnoremap tk :tabnext<CR>
nnoremap tj :tabprev<CR>
nnoremap th :tabfirst<CR>
nnoremap tl :tablast<CR>
nnoremap \s :SyntasticToggleMode<CR>