2020-09-10 09:24:40 -06:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								" -- Custom Format Settings ------------------------------ {{{
							 | 
						
					
						
							
								
									
										
										
										
											2020-11-04 14:09:09 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								function FormatFileType(indent, expandtab, foldmethod, foldlevel, spell)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									let &l:tabstop = a:indent
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									let &l:softtabstop = a:indent
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									let &l:shiftwidth = a:indent
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									let &l:expandtab = a:expandtab
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									let &l:foldmethod = a:foldmethod
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									let &l:foldlevel = a:foldlevel
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									let &l:spell = a:spell
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								endfunction
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-09-26 16:00:03 -06:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								augroup filetype_specific_formatting
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									autocmd!
							 | 
						
					
						
							
								
									
										
										
										
											2020-11-04 14:09:09 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									autocmd FileType python     call FormatFileType(4, v:true,  'indent', 99, v:false)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									autocmd FileType java       call FormatFileType(4, v:true,  'indent', 99, v:false)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									autocmd FileType cpp        call FormatFileType(4, v:true,  'indent', 99, v:false)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									autocmd FileType cs         call FormatFileType(4, v:true,  'indent', 99, v:false)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									autocmd FileType html       call FormatFileType(2, v:true,  'indent', 99, v:false)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									autocmd FileType javascript call FormatFileType(2, v:true,  'indent', 99, v:false)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									autocmd FileType vim        call FormatFileType(4, v:false, 'marker', 99, v:false)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									autocmd FileType sh         call FormatFileType(4, v:false, 'indent', 99, v:false)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									autocmd FileType zsh        call FormatFileType(4, v:false, 'indent', 99, v:false)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									autocmd FileType lisp       call FormatFileType(2, v:true,  'indent', 99, v:false)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									autocmd FileType markdown   call FormatFileType(2, v:false, 'indent', 99, v:true )
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									autocmd FileType tex        call FormatFileType(8, v:false, 'indent', 99, v:true )
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									autocmd FileType postscr    call FormatFileType(2, v:true,  'indent', 99, v:false)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									autocmd FileType haskell    call FormatFileType(2, v:true,  'indent', 99, v:false)
							 | 
						
					
						
							
								
									
										
										
										
											2019-12-31 14:26:32 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								augroup end
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								augroup forced_filetype_recognition
							 | 
						
					
						
							
								
									
										
										
										
											2020-11-04 14:09:09 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									autocmd BufRead,BufNewFile *.tmux  setfiletype tmux
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									autocmd BufRead,BufNewFile *.clisp setfiletype lisp
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									autocmd BufRead,BufNewFile *.lsp   setfiletype lisp
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2020-09-21 22:50:54 -06:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									let g:tex_flavor = "latex"
							 | 
						
					
						
							
								
									
										
										
										
											2019-09-26 16:00:03 -06:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								augroup end
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								" }}}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2020-09-21 22:50:54 -06:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								" -- <Leader>ec to 'ExeCute' a file ---------------------- {{{
							 | 
						
					
						
							
								
									
										
										
										
											2019-09-26 16:00:03 -06:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								augroup execute_file_shortcuts
							 | 
						
					
						
							
								
									
										
										
										
											2020-09-21 22:50:54 -06:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									autocmd FileType tex		nnoremap <Leader>ec :! pdf=$(grep -rl 'documentclass' ./ <bar> head -n 1 <bar> sed 's/\(.*\)\.tex/\1.pdf/'); $WEBBROWSER $pdf<CR>
							 | 
						
					
						
							
								
									
										
										
										
											2020-09-15 19:29:01 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									autocmd FileType markdown	nnoremap <Leader>ec :! $WEBBROWSER %:p<CR>
							 | 
						
					
						
							
								
									
										
										
										
											2019-09-26 16:00:03 -06:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								augroup end
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								" }}}
							 | 
						
					
						
							
								
									
										
										
										
											2019-09-22 15:00:32 -06:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2020-11-04 14:09:09 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2020-10-09 16:55:04 -06:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								" -- Miscellaneous File-specific Commands ---------------- {{{
							 | 
						
					
						
							
								
									
										
										
										
											2020-09-21 22:50:54 -06:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								augroup latex_commands
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									" overwrite the <leader>t 'test' to (double) recompile the latex document.
							 | 
						
					
						
							
								
									
										
										
										
											2020-11-04 14:09:09 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
									" in case pdflatex gets in a stuck state, it is run through timeout 3
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
									autocmd FileType tex nnoremap <Leader>t :! clear; texfile=$(grep -rl 'documentclass' ./ <bar> head -n 1); timeout 3 pdflatex $texfile && { clear; pdflatex $texfile <bar> lolcat }<CR>
							 | 
						
					
						
							
								
									
										
										
										
											2020-09-21 22:50:54 -06:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								augroup end
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								" }}}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-09-22 15:00:32 -06:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2020-09-10 09:24:40 -06:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								" -- Format Override Layers ------------------------------ {{{
							 | 
						
					
						
							
								
									
										
										
										
											2020-10-19 19:28:35 -06:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								source $VIM_DIR/rentdynamics.vim
							 | 
						
					
						
							
								
									
										
										
										
											2019-09-22 15:00:32 -06:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								" }}}
							 | 
						
					
						
							
								
									
										
										
										
											2020-09-10 09:24:40 -06:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								syntax on
							 |