-
Notifications
You must be signed in to change notification settings - Fork 3
/
vimrc
193 lines (149 loc) · 4.52 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
" Use Vim settings, rather then Vi settings. Must be first, because it changes
" other options as a side effect.
set nocompatible
""""" PLUGINS
" Bootstrap the plugin manager
if empty(glob('~/.vim/autoload/plug.vim'))
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
call plug#begin('~/.vim/plugged')
Plug 'tpope/vim-sensible'
Plug 'tpope/vim-fugitive'
Plug 'lambdalisue/vim-pyenv', { 'for': 'python' }
Plug 'davidhalter/jedi-vim', { 'for': 'python' }
Plug 'Valloric/YouCompleteMe'
Plug 'vim-syntastic/syntastic'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'SirVer/ultisnips'
Plug 'junegunn/seoul256.vim'
Plug 'scrooloose/nerdtree'
Plug 'jistr/vim-nerdtree-tabs'
Plug 'kien/ctrlp.vim'
Plug 'godlygeek/tabular'
Plug 'elzr/vim-json', { 'for': 'json' }
Plug 'plasticboy/vim-markdown', { 'for': 'markdown' }
Plug 'junegunn/limelight.vim', { 'for': 'markdown' }
Plug 'junegunn/goyo.vim', { 'for': 'markdown' }
Plug 'tpope/vim-sleuth'
Plug 'tpope/vim-surround'
Plug 'mattn/emmet-vim', { 'for': ['html', 'css'] }
Plug 'rhysd/vim-grammarous'
Plug 'pangloss/vim-javascript'
Plug 'moll/vim-node'
Plug 'digitaltoad/vim-pug'
Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries', 'for': 'go' }
Plug 'sbdchd/neoformat'
call plug#end()
""""" 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=","
""""" PLUGIN CONFIG
" syntastic
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
let g:syntastic_css_checkers = ['csslint']
let g:syntastic_go_checkers = ['gofmt']
let g:syntastic_html_checkers = ['tidy']
let g:syntastic_javascript_checkers = ['eslint']
let g:syntastic_json_checkers = ['jsonlint']
let g:syntastic_markdown_checkers = ['mdl']
let g:syntastic_pug_checkers = ['pug_lint']
let g:syntastic_python_checkers = ['flake8']
let g:syntastic_rst_checkers = ['rstcheck']
let g:syntastic_sql_checkers = ['sqlint']
let g:syntastic_stylus_checkers = ['stylint']
let g:syntastic_zsh_checkers = ['zsh']
" airline
let g:airline_theme='simple'
" black
autocmd BufWritePre *.py execute ':Black'
" NERDTree
let NERDTreeIgnore=['\.pyc$', '\~$']
" utilsnips
let g:UltiSnipsExpandTrigger="<tab>"
let g:UltiSnipsJumpForwardTrigger="<tab>"
let g:UltiSnipsJumpBackwardTrigger="<c-b>"
" vim-markdown
set conceallevel=2
let g:vim_markdown_frontmatter = 1
let g:vim_markdown_new_list_item_indent = 2
" limelight
let g:limelight_conceal_ctermfg = 'DarkGray'
nmap <Leader>l <Plug>(Limelight)
xmap <Leader>l <Plug>(Limelight)
" goyo
nnoremap <leader>W :Goyo<cr>
" javascript
let g:javascript_plugin_jsdoc = 1
" neoformat
let g:neoformat_enabled_html = ['prettydiff']
let g:neoformat_html_prettydiff = {
\ 'exe': 'prettydiff',
\ 'args': ['mode:"beautify"',
\ 'lang:"html"',
\ 'insize:"2"',
\ 'quote:"true"',
\ 'quoteConvert:"double"',
\ 'objsort:"all"',
\ 'preserve:"1"',
\ 'readmethod:"filescreen"',
\ 'endquietly:"quiet"',
\ 'source:"%:p"'],
\ 'no_append': 1
\ }
""""" GLOBAL SETTINGS
" Disable swap files
set noswapfile
" Enable syntax highlighting
syntax on
" Enable line numbers
set nu
" Enable backspace in insert mode
set backspace=indent,eol,start
" Store lots of history
set history=1000
" Show incomplete commands
set showcmd
" Reload files changed outside vim
set autoread
" Display unprintable chars
set list
" Make tabs, trailing whitespace, and EOL characters visible
set listchars=tab:▸\ ,trail:·,eol:¬
" Find the next match as we're typing the search term
set incsearch
" Search by case only if specified
set smartcase
" Highlight searches
set hlsearch
" Allow caseless searches
set ignorecase
" Store all change info
set undodir=~/.vim/undodir
" Write changes to the undo file
set undofile
" Allow a lot of undos
set undolevels=1000
set undoreload=10000
" Enable filetype-specific configs
filetype plugin indent on
" Fold based on indent
set foldmethod=indent
" Fold up to three levels deep
set foldnestmax=3
" Fold by default
set foldenable
" Min number of lines to keep above and below the cursor
set scrolloff=8
" Min number of columns to keep left and right of the cursor
set sidescrolloff=15
" Min number of columns to scroll horizontally
set sidescroll=8
" Automatically reload Vim when the config changes
augroup reloadvim
au!
au BufWritePost .vimrc source $MYVIMRC
augroup end