-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
165 lines (145 loc) · 4.77 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
"""" Begin Vundle Setup Requirements
set nocompatible
filetype on
filetype off
packadd! matchit
" set the runtime path to include Vundle and initialize
if has('win32') || has('win64')
set rtp+=~/vimfiles/bundle/Vundle.vim
else
set rtp+=~/.vim/bundle/Vundle.vim
endif
call vundle#begin()
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
Plugin 'tpope/vim-fugitive'
Plugin 'tjensen/inkpot'
Plugin 'dense-analysis/ale'
Plugin 'linediff.vim'
Plugin 'vim-airline/vim-airline'
Plugin 'powerline/fonts'
Plugin 'pangloss/vim-javascript'
Plugin 'maxmellon/vim-jsx-pretty'
Plugin 'plasticboy/vim-markdown'
Plugin 'Vimjas/vim-python-pep8-indent'
Plugin 'vim-scripts/vim-coffee-script'
Plugin 'hashivim/vim-terraform'
Plugin 'PProvost/vim-ps1'
Plugin 'tjensen/vim-enforce'
Plugin 'guns/xterm-color-table.vim'
Plugin 'cespare/vim-toml'
Plugin 'rust-lang/rust.vim'
" Plugin 'leafgarland/typescript-vim'
call vundle#end()
filetype plugin indent on
"""" End Vundle Setup Requirements
" I like colors
syntax on
if has('vcon')
" Windows 10 console now supports 24-bit color!
set termguicolors
set t_Co=256
endif
if has("gui_running") || &t_Co > 16
colorscheme inkpot
else
colorscheme elflord
endif
" UTF-8 Everywhere!
set encoding=utf-8
" Show unprintable characters
set list listchars=trail:·,tab:»-
" Always show the status line
set laststatus=2
" Adjust behavior of the backspace key
set backspace=indent,eol,start
" Show line numbers
set number numberwidth=6
" Don't pester me when using netrw
let g:netrw_silent = 1
"
set encoding=utf-8
set modeline modelines=5
set wildmode=list:longest
set wildignore=*.o,*.d
if version >= 700
set diffopt=filler,vertical
endif
set scrolloff=3
set spelllang=en
if exists('+colorcolumn')
set colorcolumn=80
endif
" Jump to open window containing specified buffer, else split a new window
set switchbuf=useopen,split
" SWIG .i files
autocmd BufRead,BufNewFile *.i set filetype=swig
" Jump to last known position in file, if available
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g`\"" | endif
" C/C++ comment continuation rules
au FileType c,cpp set comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,f://
" Standard convention for code indentation
set tabstop=4 shiftwidth=4 expandtab
" For toggling paste mode
nnoremap <silent> <leader>pp :setlocal paste!<CR>
" YAML stuff
autocmd FileType yaml setlocal shiftwidth=2 tabstop=2 softtabstop=2
autocmd FileType yaml setlocal foldmethod=indent foldlevel=99
" JSON stuff
autocmd FileType json setlocal shiftwidth=2 tabstop=2 softtabstop=2
" HTML stuff
autocmd FileType html setlocal shiftwidth=2 tabstop=2 softtabstop=2
autocmd FileType html if line('$') < 5000 | :syntax sync fromstart | endif
" SCSS stuff
autocmd FileType scss setlocal shiftwidth=2 tabstop=2 softtabstop=2
" Python stuff
autocmd FileType python setlocal shiftwidth=4 tabstop=4 softtabstop=4
autocmd FileType python setlocal textwidth=99 colorcolumn=101
highlight BadWhitespace ctermbg=red guibg=red
autocmd BufRead,BufNewFile *.py,*.pyw match BadWhitespace /^\t\+/
autocmd BufRead,BufNewFile *.py,*.pyw,*.c,*.h,*.js match BadWhitespace /\s\+$/
" Javascript stuff
autocmd FileType javascript setlocal shiftwidth=2 tabstop=2 softtabstop=2
autocmd FileType javascript setlocal colorcolumn=101 textwidth=99
" Typescript stuff
autocmd FileType typescript setlocal shiftwidth=2 tabstop=2 softtabstop=2
autocmd FileType typescript setlocal colorcolumn=101 textwidth=99
" Coffeescript stuff
autocmd FileType coffee setlocal shiftwidth=2 tabstop=2 softtabstop=2
autocmd FileType coffee setlocal colorcolumn=101 textwidth=99
" Java stuff
autocmd FileType java setlocal shiftwidth=4 tabstop=4 softtabstop=4
autocmd FileType java setlocal colorcolumn=101 textwidth=99
" Objective C stuff
autocmd FileType objc setlocal shiftwidth=4 tabstop=4 softtabstop=4
autocmd FileType objc setlocal colorcolumn=101 textwidth=99
" Markdown stuff
autocmd FileType markdown setlocal spell spelllang=en_us
let g:vim_markdown_folding_disabled = 1
" Text stuff
autocmd FileType text setlocal spell spelllang=en_us
" C stuff
autocmd FileType c setlocal textwidth=99 colorcolumn=101
" Ruby stuff
autocmd BufRead,BufNewFile Fastfile set filetype=ruby
" Rust stuff
autocmd FileType rust setlocal textwidth=99 colorcolumn=101
let g:rustfmt_autosave = 1
" ALE
let g:ale_set_quickfix = 1
let g:ale_open_list = 1
nmap <silent> <C-k> <Plug>(ale_previous_wrap)
nmap <silent> <C-j> <Plug>(ale_next_wrap)
" Airline
let g:airline_detect_paste=1
let g:airline_inactive_collapse=1
let g:airline#extensions#ale#enabled = 1
let g:airline#extensions#branch#enabled=1
let g:airline#extensions#tabline#enabled=1
let g:airline_powerline_fonts=1
" Allow for system-specific settings that shouldn't be shared everywhere
if filereadable(glob("~/.vimrc_local"))
source ~/.vimrc_local
endif
"
" vim:ts=2:sw=2:et