-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
155 lines (134 loc) · 6.21 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
set nocompatible " be iMproved, required
filetype off " required
" ############################################################
" ######################## Vundle ############################
" ############################################################
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" " let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
"Plugin 'Solarized'
Plugin 'tomasr/molokai'
Plugin 'davidhalter/jedi-vim'
Plugin 'scrooloose/syntastic'
Plugin 'Chiel92/vim-autoformat'
Plugin 'scrooloose/nerdtree'
Plugin 'tpope/vim-sensible'
Plugin 'tpope/vim-surround'
Plugin 'tpope/vim-fugitive'
Plugin 'tomtom/tcomment_vim'
Plugin 'ntpeters/vim-better-whitespace'
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'kien/ctrlp.vim'
Plugin 'airblade/vim-gitgutter'
Plugin 'tpope/vim-eunuch'
Plugin 'ervandew/supertab'
Plugin 'mutewinter/vim-autoreadwatch'
Plugin 'lervag/vimtex'
Plugin 'nathangrigg/vim-beancount'
call vundle#end() " required
filetype plugin indent on " required
" " Brief help
" " :PluginList - lists configured plugins
" " :PluginInstall - installs plugins; append `!` to update or just
" " :PluginUpdate
" " :PluginSearch foo - searches for foo; append `!` to refresh local cache
" " :PluginClean - confirms removal of unused plugins; append `!` to
" auto-approve removal
" " Put your non-Plugin stuff after this line
runtime! plugin/sensible.vim
" SYNTASTIC
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
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
" NERDTREE
let NERDTreeIgnore = ['\.pyc$']
" MISC
set bs=2
set visualbell
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Vim Behavior
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
set hidden " don't unload buffer when switching away
set modeline " allow per-file settings via modeline
set secure " disable unsafe commands in local .vimrc files
set encoding=utf-8 fileencoding=utf-8 termencoding=utf-8 " saving and encoding
set nobackup nowritebackup noswapfile autoread " no backup or swap
set hlsearch incsearch ignorecase smartcase " search
set wildmenu " completion
set backspace=indent,eol,start " sane backspace
set clipboard=unnamed,unnamedplus " use the system clipboard for yank/put/delete
set mouse=a " enable mouse for all modes settings
set nomousehide " don't hide the mouse cursor while typing
set mousemodel=popup " right-click pops up context menu
set ruler " show cursor position in status bar
set number " show absolute line number of the current line
"set nofoldenable " I fucking hate code folding
set scrolloff=10 " scroll the window so we can always see 10 lines around the cursor
set textwidth=80 " wrap at 80 characters like a valid human
set cursorline " highlight the current line
set cursorcolumn " highlight the current line
"set printoptions=paper:letter " use letter as the print output format
"set guioptions-=T " turn off GUI toolbar (icons)
"set guioptions-=r " turn off GUI right scrollbar
"set guioptions-=L " turn off GUI left scrollbar
"set winaltkeys=no " turn off stupid fucking alt shortcuts
set laststatus=2 " always show status bar
set shell=bash
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Appearance
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
syntax on
set background=dark
set t_Co=256 " 256 colors in terminal
" Tweaks for Molokai colorscheme (ignored if Molokai isn't used)
let g:molokai_original=1
let g:rehash256=1
" powerline for py3
" let g:powerline_pycmd="py3"
" set airline theme
let g:airline_theme='molokai'
let g:airline_powerline_fonts=1
" Use the first available colorscheme in this list
for scheme in [ 'molokai', 'solarized', 'desert' ]
try
execute 'colorscheme '.scheme
break
catch
continue
endtry
endfor
" highlight the 80th column
"
" In Vim >= 7.3, also highlight columns 120+
if exists('+colorcolumn')
" (I picked 120-320 because you have to provide an upper bound and 500 seems
" to be enough.)
let &colorcolumn="80,".join(range(120,500),",")
else
" fallback for Vim < v7.3
autocmd BufWinEnter * let w:m2=matchadd('ErrorMsg', '\%>80v.\+', -1)
endif
" Allow saving of files as sudo when I forgot to start vim using sudo.
cmap w!! w !sudo tee > /dev/null %
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Formatting
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
filetype plugin indent on
set shiftwidth=2 tabstop=2 softtabstop=2 expandtab autoindent smartindent
autocmd filetype c,asm,python setlocal shiftwidth=4 tabstop=4 softtabstop=4
autocmd FileType make setlocal noexpandtab
autocmd FileType tex setlocal tw=0 spell
autocmd FileType tex setlocal syntax=tex
let g:tex_flavor='latex'
" Beancount align commodity column
let g:beancount_separator_col = 60
" AUTOREAD
command! -bang WatchForChangesAllFileQuiet :call WatchForChanges('*', {'toggle': 1, 'autoread': <bang>0, 'quiet': 1})
autocmd VimEnter * WatchForChangesAllFileQuiet!