-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
229 lines (180 loc) · 7.99 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
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
" Use Vim settings, rather then Vi settings (much better!). This must be
" first, because it changes other options as a side effect.
set nocompatible
" Set clipboard - MacOS"
set clipboard=unnamed
" ========== Vundle Initialization ==========
" Required for Vundle to work properly. Disabled file type detection.
filetype off
" This loads all the plugins in ~/.vim/bundle.
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" Install and manage all our Vim scripts using Vundle. To install (or update)
" all these scripts at once, run:
"
" :PluginInstall
"
" To remove unused scripts, run:
"
" :PluginClean
Plugin 'VundleVim/Vundle.vim'
Plugin 'tpope/vim-fugitive'
Plugin 'vim-scripts/python.vim--Vasiliev'
Plugin 'vim-scripts/django.vim'
Plugin 'tpope/vim-markdown'
Plugin 'Shougo/neocomplcache'
Plugin 'Raimondi/delimitMate'
Plugin 'scrooloose/syntastic'
Plugin 'mikewest/vimroom'
Plugin 'airblade/vim-gitgutter'
Plugin 'vim-scripts/matchit.zip'
Plugin 'fatih/vim-go'
Plugin 'altercation/vim-colors-solarized'
Plugin 'digitaltoad/vim-jade'
Plugin 'wavded/vim-stylus'
Plugin 'mattn/emmet-vim'
Plugin 'moll/vim-node'
Plugin 'nathanaelkane/vim-indent-guides'
Plugin 'othree/html5.vim'
" Plugin 'SirVer/ultisnips'
Plugin 'honza/vim-snippets'
Plugin 'gorodinskiy/vim-coloresque'
Plugin 'tpope/vim-surround'
Plugin 'matze/vim-move'
Plugin 'tpope/vim-commentary'
Plugin 'scrooloose/nerdTree'
Plugin 'Xuyuanp/nerdtree-git-plugin'
Plugin 'pangloss/vim-javascript'
Plugin 'mxw/vim-jsx'
Plugin 'leafgarland/typescript-vim'
Plugin 'peitalin/vim-jsx-typescript'
Plugin 'w0rp/ale'
" Plugin 'davidhalter/jedi-vim'
call vundle#end()
" Reactivate file type support.
filetype plugin indent on
" ========== Leader Config ==========
" Make , the default shortcut key. This allows us to easily add custom
" key mappings later on without breaking any of Vim's default functionality.
let mapleader=","
" ========== General Config ==========
set number " Line numbers are good.
set backspace=indent,eol,start " Allow backspace in insert mode.
set history=1000 " Store lots of :cmdline history.
set showcmd " Show incomplete cmds down the bottom.
set showmode " Show current mode down the bottom.
set hidden " Allow buffers to exist in the background.
set autoread " Reload files changed outside vim
set list " Display unprintable characters.
set listchars=tab:▸\ ,trail:·,eol:¬ " Make tabs, trailing whitespace, and EOL characters easy to spot.
syntax on " Enable syntax highlighting.
" ========== Search Settings ==========
set incsearch " Find the next match as we type the search.
set smartcase " Search by case only if specified.
set hlsearch " Hilight searches by default.
set ignorecase " Allow case searches.
set viminfo='100,f1 " Save up to 100 marks, enable capital marks.
" ========== Swap Files ==========
set noswapfile " Don't use a swapfile for buffers.
set nobackup " Disable file backups when writing files.
set nowritebackup " Don't backup before overwriting files.
" ========== Persistent Undo ==========
set undodir=~/.vim/undodir " Store all change information in a undodir.
set undofile " Write changes to the undofile.
set undolevels=1000 " Maximum number of changes that can be undone.
set undoreload=10000 " Maximum number lines to save for undo on a buffer reload.
" ========== Indentation ==========
set autoindent " Copy indent from current line when starting a new line.
set smartindent " Do smart autoindenting when starting a new line.
set smarttab " A <tab> in front of a line inserts spaces.
set shiftwidth=2 " Number of spaces to use for each step of autoindent.
set softtabstop=2 " Number of spaces that a <tab> counts for while editing.
set tabstop=2 " Number of spaces that a <tab> in the file counts for.
set expandtab " Use the appropriate number of spaces to insert a <tab>.
" Set smaller tab settings for HTML type stuff.
au FileType coffee,javascript,css,xml,xhtml,html,htmldjango,haml,json set shiftwidth=2 tabstop=2
" ========== Editor Width ==========
set nowrap " Don't wrap lines.
set linebreak " Wrap lines when convenient. This doesn't effect text, only display.
set textwidth=79 " Make all lines 79 chars or less.
" ========== Filetype Config ==========
filetype plugin on " Automatically load filetype specific configs.
filetype indent on " Automatically load filetype specific indent configs.
" ========== Folds ==========
set foldmethod=indent " Fold based on indent.
set foldnestmax=3 " Limit folds to three levels of depth.
set foldenable " Fold by default.
" ========== Completion ==========
set wildmode=list:longest " When more than one match, list all and look for the longest.
set wildmenu " Auto complete command line operations using <tab> and <ctr-p>/<ctr-n>.
set wildignore=*.o,*.obj,*~ " Filenames to ignore when auto completing.
set wildignore+=*vim/backups* " (continued)
set wildignore+=*.pyc,*.pyo " (continued)
" ========== Scrolling ==========
set scrolloff=8 " Minimal number of screen lines to keep above and below the cursor.
set sidescrolloff=15 " Minimal number of screen columns to keep to the left and the right of the cursor.
set sidescroll=1 " Minimal number of columns to scroll horizontally.
" ========== Reload ==========
" Automatically reload Vim if you make changes to vimrc.
augroup reloadvim
au!
au BufWritePost .vimrc source $MYVIMRC
augroup end
" ========== neocomplcache ==========
let g:neocomplcache_enable_at_startup = 1
let g:neocomplcache_enable_smart_case = 1
let g:neocomplcache_min_syntax_length = 3
let g:neocomplcache_auto_completion_start_length = 3
" ========== delimitMate ==========
let g:delimitMate_autoclose = 1
let g:delimitMate_expand_cr = 1
let g:delimitMate_expand_space = 1
let g:delimitMate_smart_quotes = 1
let g:delimitMate_smart_matchpairs = 1
let g:delimitMate_balance_matchpairs = 1
let g:delimitMate_excluded_ft = "mail,help"
" ========== vimroom ==========
let g:vimroom_ctermbackground = "black"
let g:vimroom_width = 79
nnoremap <leader>V :VimroomToggle<cr>
" ========== syntastic ==========
let g:syntastic_check_on_open = 1
let g:syntastic_python_flake8_post_args = "--ignore=E251,E128,E501"
let g:syntastic_javascript_checkers = ['eslint']
" ========== vim-gitgutter ==========
let g:gitgutter_enabled = 1
" ========== go.vim ==========
set rtp+=~/.vim/bundle/vim-golang/
" ========== vim-go ==========
let g:go_highlight_functions = 1
let g:go_highlight_methods = 1
let g:go_highlight_structs = 1
let g:go_metalinter_command='golangci-lint'
let g:go_metalinter_autosave=1
let g:go_metalinter_autosave_enabled = ['errcheck', 'staticcheck', 'unused', 'gosimple', 'structcheck', 'varcheck', 'ineffassign', 'deadcode']
let g:go_list_type = "quickfix"
let g:go_fmt_command = "goimports"
let g:go_def_mode='guru'
let g:go_info_mode='guru'
let g:go_referrers_mode = 'guru'
let g:go_implements_mode = 'guru'
let g:go_rename_command = 'gorename'
let g:go_gopls_enabled = 0
" ========== emmet ==========
let g:user_emmet_install_global = 1
let g:user_emmet_mode='a'
let g:user_emmet_leader_key='<C-e>'
" ========== utilsnips ==========
let g:UltiSnipsExpandTrigger="<tab>"
let g:UltiSnipsJumpForwardTrigger="<tab>"
let g:UltiSnipsJumpBackwardTrigger="<c-b>"
" ========== Pathogen ===========
" execute pathogen#infect()
" ========== vim-move ===========
let g:move_key_modifier= 'C'
" ========== JSX ===========
let g:jsx_ext_required = 0
let g:typescript_indent_disable = 1
" ========== NerdTree ==========
let NERDTreeShowHidden=1
let g:NERDTreeWinSize=20