Newer
Older
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
set nocompatible
" set default 'runtimepath' (without ~/.vim folders)
let &runtimepath = printf('%s/vimfiles,%s,%s/vimfiles/after', $VIM, $VIMRUNTIME, $VIM)
" what is the name of the directory containing this file?
let s:portable = expand('<sfile>:p:h')
" add the directory to 'runtimepath'
let &runtimepath = printf('%s,%s,%s/after', s:portable, &runtimepath, s:portable)
execute pathogen#infect()
syntax on
filetype plugin on
filetype indent on " activates indenting for files
set smartindent
set autoindent
set laststatus=3 " grey status bar at the bottom
set shiftwidth=2
set expandtab
set foldmethod=indent
set foldnestmax=10
set nofoldenable
set nocompatible
set ignorecase " case insensitive search
set restorescreen=on " restore the screen
set number " line numbers
set relativenumber
" Switch to absolute numbering in insert mode
au InsertEnter * :set norelativenumber
au InsertLeave * :set relativenumber
" Maintain undo history between sessions
set undofile
set undodir=~/users/whit/.vim/undodir
" -------------------------------------
" Color scheme
"set t_Co=256
"colorscheme flattened_dark " colorscheme desert
":let g:solarized_termcolors = 256
"colorscheme wombat
colorscheme wombat256mod " current favorite
"colorscheme codeschool
"colorscheme jellybeans
"colorscheme badwolf
"colorscheme goodwolf
"colorscheme Tomorrow-Night
"set background=dark
"colorscheme solarized
"set background=dark
"colorscheme PaperColor
" disable the Background Color Erase that messes with some color schemes
set t_ut=
"
let mapleader = "-"
" vimwiki
let g:vimwiki_list = [{'path': '~/.vim/vimwiki/cdaq.wiki'}]
set nocompatible
filetype plugin on
syntax on
au BufRead,BufNewFile *.wiki set filetype=vimwiki
":autocmd FileType vimwiki map d :VimwikiMakeDiaryNote
"set spell spelllang=en_us
"function! ToggleCalendar()
" execute ":Calendar"
" if exists("g:calendar_open")
" if g:calendar_open == 1
" execute "q"
" unlet g:calendar_open
" else
" g:calendar_open = 1
" end
" else
" let g:calendar_open = 1
" end
"endfunction
":autocmd FileType vimwiki map c :call ToggleCalendar()
" --------------------------------------
" Utility Functions
"
" The following causes jump to the last cursor position when
" reopening a file
if has("autocmd")
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
\| exe "normal! g'\"" | endif
endif
" Damian conway plugins
"https://github.com/thoughtstream/Damian-Conway-s-Vim-Setup
"dragvisuals allows for moving around visual blocks
runtime plugin/dragvisuals.vim
vmap <expr> <LEFT> DVB_Drag('left')
vmap <expr> <RIGHT> DVB_Drag('right')
vmap <expr> <DOWN> DVB_Drag('down')
vmap <expr> <UP> DVB_Drag('up')
"vmap <expr> D DVB_Duplicate()
"Remove any introduced trailing whitespace after moving.
let g:DVB_TrimWS = 1
"runtime plugin/vmath.vim
"vmap <expr> ++ VMATH_YankAndAnalyse()
"nmap ++ vip++
" ----------------------------
" File type specific
autocmd Filetype python setlocal expandtab tabstop=4 shiftwidth=4
"let g:load_doxygen_syntax=1
let mapleader = "-"
" edit vim rc with
"nnoremap <leader>ev :vsplit $MYVIMRC<cr>
"nnoremap <leader>sv :source $MYVIMRC<cr>
"autocmd BufWritePre *.html :normal gg=G
" mutt
"au! BufRead,BufNewFile /tmp/mutt-* set fo+=aw
"autocmd BufRead,BufNewFile /tmp/mutt-* setlocal spell
"autocmd BufRead,BufNewFile /tmp/mutt-* set complete+=kspell
"au! BufRead,BufNewFile *mutt-* set fo+=aw
"autocmd BufRead,BufNewFile *mutt-* setlocal spell
"autocmd BufRead,BufNewFile *mutt-* set complete+=kspell
"au BufRead /tmp/mutt-* source ~/.vim/ftplugin/mail/mutt-aliases.vim
" md
autocmd BufRead,BufNewFile *.md set fo+=aw
autocmd BufRead,BufNewFile *.md setlocal spell
autocmd BufRead,BufNewFile *.md set complete+=kspell
let g:vim_markdown_folding_disabled=1
autocmd BufRead,BufNewFile *slides/*.md set ft=html
" tex
"autocmd BufRead,BufNewFile *.tex set fo+=aw
""let g:tex_flavor='latex'
autocmd BufRead,BufNewFile *.cls set ft=tex
autocmd BufRead,BufNewFile *.tex setlocal spell
autocmd BufRead,BufNewFile *.tex set complete+=kspell
"au BufNewFile,BufRead body.tex syntax spell toplevel
let g:tex_flavor='latex'
let g:vimtex_quickfix_latexlog = {'default' : 0}
" html
autocmd BufRead,BufNewFile *.html setlocal spell
autocmd BufRead,BufNewFile *.html set complete+=kspell
"au! BufRead,BufNewFile *.tex set fo+=aw
" txt
autocmd BufRead,BufNewFile *.txt set fo+=w
autocmd BufRead,BufNewFile *.txt setlocal spell
autocmd BufRead,BufNewFile *.txt set complete+=kspell
autocmd BufRead,BufNewFile CMakeLists.txt setlocal nospell
" tmp
autocmd BufRead,BufNewFile *.tmp set fo+=w
autocmd BufRead,BufNewFile *.tmp setlocal spell
autocmd BufRead,BufNewFile *.tmp set complete+=kspell
set matchpairs+=<:>
" json
autocmd BufNewFile,BufRead *.json set ft=javascript
" clang-format
map <C-K> :pyf /group/c-csv/local/stow/llvm_6.0.1/share/clang/clang-format.py<cr>
imap <C-K> <c-o>:pyf /group/c-csv/local/stow/llvm_6.0.1/share/clang/clang-format.py<cr>
" git
autocmd FileType gitcommit setlocal spell
"let g:netrw_dirhistmax = 0
"let g:netrw_dirhistmax =10
"let g:netrw_dirhist_cnt =5
"let g:netrw_home=$XDG_CACHE_HOME.'/vim'
"let g:ycm_global_ycm_extra_conf = "~/.vim/ycm_extra_conf.py"
" calendar
"let g:calendar_google_calendar = 1
"let g:calendar_google_task = 1
" vim-airline
let g:airline#extensions#tabline#enabled = 1
let g:airline_powerline_fonts = 1
"let g:airline_theme = 'powerlineish'
"let g:airline#extensions#hunks#enabled=0
"let g:airline#extensions#branch#enabled=1
"if !exists('g:airline_symbols')
" let g:airline_symbols = {}
"endif
"let g:airline_symbols.space = "\ua0"
"let g:airline_section_a = 'asdf'
"let g:airline_section_b = '%-0.10{getcwd()}'
"let g:airline_section_c = '%t'
let g:airline_extensions = ['branch', 'tabline']
"let g:airline#extensions#branch#enabled = 1
" email utils
" http://www.256bit.org/~chrisbra/cms/vim_as_e-mail_editor.html#format
"let g:checkattach_filebrowser = 'ranger'
"let g:mutt_aliases_file="~/.mutt/aliases"