Clean up formatting in the config folder

This commit is contained in:
Kevin MacMartin 2018-03-11 23:36:47 -04:00
parent bc7af807b3
commit e5f28b842e
14 changed files with 126 additions and 74 deletions

View file

@ -18,6 +18,7 @@ endif
if !exists("g:disablelinebreaks") if !exists("g:disablelinebreaks")
let g:disablelinebreaks = 1 let g:disablelinebreaks = 1
endif endif
if (g:disablelinebreaks == 1) if (g:disablelinebreaks == 1)
autocmd VimEnter * set textwidth=0 autocmd VimEnter * set textwidth=0
endif endif

View file

@ -14,10 +14,21 @@ scriptencoding utf-8
"INITIALIZE PLUGINS: {{{ "INITIALIZE PLUGINS: {{{
"create missing plugin config files and directories "create missing plugin config files and directories
if exists('*mkdir')|if !isdirectory(glob("~/.vim/tags_by_filetype"))|call mkdir(glob("~/.vim/tags_by_filetype"),'p')|endif|endif if exists('*mkdir') && !isdirectory(glob("~/.vim/tags_by_filetype"))
if !filereadable(glob("~/.vim/tags"))|new|silent e ~/.vim/tags|silent w|q|endif call mkdir(glob("~/.vim/tags_by_filetype"),'p')
if !filereadable(glob("~/.vim/snippets.json"))|new|silent e ~/.vim/snippets.json|silent w|q|endif endif
if !filereadable(glob("~/.vim/filetypes.vim"))|new|silent e ~/.vim/filetypes.vim|silent w|q|endif
if !filereadable(glob("~/.vim/tags"))
new|silent e ~/.vim/tags|silent w|q
endif
if !filereadable(glob("~/.vim/snippets.json"))
new|silent e ~/.vim/snippets.json|silent w|q
endif
if !filereadable(glob("~/.vim/filetypes.vim"))
new|silent e ~/.vim/filetypes.vim|silent w|q
endif
"load plugins in vim/bundle/ and vim/bundle.user/ "load plugins in vim/bundle/ and vim/bundle.user/
execute pathogen#infect('bundle/{}', 'bundle.user/{}') execute pathogen#infect('bundle/{}', 'bundle.user/{}')

View file

@ -32,7 +32,6 @@ function! LLFugitive()
return strlen(_) ? mark._ : '' return strlen(_) ? mark._ : ''
endif endif
catch catch
endtry endtry
return '' return ''

View file

@ -12,6 +12,7 @@ else
\ 'active_filetypes':[], \ 'active_filetypes':[],
\ 'passive_filetypes':[] \ 'passive_filetypes':[]
\ } \ }
let g:syntastic_check_on_open = 1 let g:syntastic_check_on_open = 1
else else
let g:syntastic_mode_map = { let g:syntastic_mode_map = {
@ -19,6 +20,7 @@ else
\ 'active_filetypes':[], \ 'active_filetypes':[],
\ 'passive_filetypes':[] \ 'passive_filetypes':[]
\ } \ }
let g:syntastic_check_on_open = 0 let g:syntastic_check_on_open = 0
endif endif
@ -28,16 +30,19 @@ else
\ 'NameError:.* is undefined', \ 'NameError:.* is undefined',
\ 'FileError:.*' \ 'FileError:.*'
\ ]} \ ]}
let g:syntastic_scss_sass_quiet_messages = { let g:syntastic_scss_sass_quiet_messages = {
\ 'regex':[ \ 'regex':[
\ 'File to import not found or unreadable.*' \ 'File to import not found or unreadable.*'
\ ]} \ ]}
let g:syntastic_java_javac_quiet_messages = { let g:syntastic_java_javac_quiet_messages = {
\ 'regex':[ \ 'regex':[
\ 'cannot find symbol.*', \ 'cannot find symbol.*',
\ 'method does not override or implement a method from a supertype.*', \ 'method does not override or implement a method from a supertype.*',
\ 'package [^\ ]* does not exist.*' \ 'package [^\ ]* does not exist.*'
\ ]} \ ]}
let g:syntastic_javascript_eslint_quiet_messages = { let g:syntastic_javascript_eslint_quiet_messages = {
\ 'regex':[ \ 'regex':[
\ '.* is defined but never used', \ '.* is defined but never used',
@ -45,26 +50,31 @@ else
\ 'Missing "use strict" statement', \ 'Missing "use strict" statement',
\ 'Unexpected [^ ]* statement.*' \ 'Unexpected [^ ]* statement.*'
\ ]} \ ]}
let g:syntastic_javascript_jshint_quiet_messages = { let g:syntastic_javascript_jshint_quiet_messages = {
\ 'regex':[ \ 'regex':[
\ 'Expected an assignment or function call and instead saw an expression.' \ 'Expected an assignment or function call and instead saw an expression.'
\ ]} \ ]}
let g:syntastic_javascript_standard_quiet_messages = { let g:syntastic_javascript_standard_quiet_messages = {
\ 'regex':[ \ 'regex':[
\ '.* is defined but never used', \ '.* is defined but never used',
\ "'[^']*' is not defined" \ "'[^']*' is not defined"
\ ]} \ ]}
let g:syntastic_markdown_mdl_quiet_messages = { let g:syntastic_markdown_mdl_quiet_messages = {
\ 'regex':[ \ 'regex':[
\ '.*MD013.*', \ '.*MD013.*',
\ '.*MD002.*', \ '.*MD002.*',
\ '.*MD029.*' \ '.*MD029.*'
\ ]} \ ]}
let g:syntastic_python_flake8_quiet_messages = { let g:syntastic_python_flake8_quiet_messages = {
\ 'regex':[ \ 'regex':[
\ '.*\[W293\]', \ '.*\[W293\]',
\ '.*\[E501\]' \ '.*\[E501\]'
\ ]} \ ]}
let g:syntastic_php_phpmd_quiet_messages = { let g:syntastic_php_phpmd_quiet_messages = {
\ 'regex':[ \ 'regex':[
\ 'Avoid using short method names like.*', \ 'Avoid using short method names like.*',
@ -79,10 +89,12 @@ else
\ 'The class.*has.*public methods.*', \ 'The class.*has.*public methods.*',
\ 'The class.*lines of code' \ 'The class.*lines of code'
\ ]} \ ]}
let g:syntastic_sh_bashate_quiet_messages = { let g:syntastic_sh_bashate_quiet_messages = {
\ 'regex':[ \ 'regex':[
\ 'Indent not multiple of 4' \ 'Indent not multiple of 4'
\ ]} \ ]}
let g:syntastic_sh_shellcheck_quiet_messages = { let g:syntastic_sh_shellcheck_quiet_messages = {
\ 'regex':[ \ 'regex':[
\ '.*\[SC1001\]', \ '.*\[SC1001\]',
@ -95,6 +107,7 @@ else
\ '.*follow non-constant source', \ '.*follow non-constant source',
\ 'Not following:' \ 'Not following:'
\ ]} \ ]}
autocmd BufNewFile,BufRead PKGBUILD,bash.bashrc,.bashrc let g:syntastic_quiet_messages = {"level":"warnings"} autocmd BufNewFile,BufRead PKGBUILD,bash.bashrc,.bashrc let g:syntastic_quiet_messages = {"level":"warnings"}
let g:syntastic_check_on_wq = 0 let g:syntastic_check_on_wq = 0

View file

@ -1 +1,2 @@
let g:tcomment#rstrip_on_uncomment=2 "remove right-hand whitespace from all lines on uncomment "remove right-hand whitespace from all lines on uncomment
let g:tcomment#rstrip_on_uncomment = 2

View file

@ -25,12 +25,20 @@
"use the '*' register as well as the the '+' register if it's available too "use the '*' register as well as the the '+' register if it's available too
set clipboard=unnamed set clipboard=unnamed
if has('unnamedplus')|set clipboard+=unnamedplus|endif
if has('unnamedplus')
set clipboard+=unnamedplus
endif
"fancy mouse reporting with xterm2 fallback "fancy mouse reporting with xterm2 fallback
if !has('nvim') if !has('nvim')
if has("mouse_sgr")|set ttymouse=sgr|else|set ttymouse=xterm2|endif if has("mouse_sgr")
set ttymouse=sgr
else
set ttymouse=xterm2
endif endif
endif
set mouse=a "enables mouse functionality with extended capabilities set mouse=a "enables mouse functionality with extended capabilities
"8 colours in $TERM=linux, 256 elsewhere "8 colours in $TERM=linux, 256 elsewhere
@ -39,10 +47,14 @@
"configure to primarily use utf8 "configure to primarily use utf8
if has("multi_byte") if has("multi_byte")
if &termencoding == ""|let &termencoding = &encoding|endif if &termencoding == ""
let &termencoding = &encoding
endif
set encoding=utf-8 set encoding=utf-8
setglobal fileencoding=utf-8 setglobal fileencoding=utf-8
endif endif
set fileformats=unix,dos,mac "set compatible line endings in order of preference set fileformats=unix,dos,mac "set compatible line endings in order of preference
"}}} "}}}
@ -91,7 +103,10 @@
set ttimeout ttimeoutlen=100 "how long before timing out for terminal key codes set ttimeout ttimeoutlen=100 "how long before timing out for terminal key codes
"create ~/.vim/swap if necessary, then use as default swap file location "create ~/.vim/swap if necessary, then use as default swap file location
if !isdirectory($HOME.'/.vim/swap')|call mkdir($HOME.'/.vim/swap','p')|endif if exists('*mkdir') && !isdirectory($HOME.'/.vim/swap')
call mkdir($HOME.'/.vim/swap','p')
endif
set directory=$HOME/.vim/swap,.,/var/tmp,/tmp set directory=$HOME/.vim/swap,.,/var/tmp,/tmp
"FUNCTIONS: {{{ "FUNCTIONS: {{{
@ -101,9 +116,13 @@
function s:MakeNewDir(fullpath, buf) function s:MakeNewDir(fullpath, buf)
if empty(getbufvar(a:buf,'&buftype')) && a:fullpath!~#'\v^\w+\:\/' if empty(getbufvar(a:buf,'&buftype')) && a:fullpath!~#'\v^\w+\:\/'
let dirpath = fnamemodify(a:fullpath,':h') let dirpath = fnamemodify(a:fullpath,':h')
if !isdirectory(dirpath)|call mkdir(dirpath,'p')|endif
if !isdirectory(dirpath)
call mkdir(dirpath,'p')
endif
endif endif
endfunction endfunction
augroup WriteDir augroup WriteDir
autocmd! autocmd!
autocmd BufWritePre * :call s:MakeNewDir(expand('<afile>'),+expand('<abuf>')) autocmd BufWritePre * :call s:MakeNewDir(expand('<afile>'),+expand('<abuf>'))
@ -121,26 +140,34 @@
function s:SPResize33() function s:SPResize33()
sp|wincmd =|q sp|wincmd =|q
endfunction endfunction
function s:sp33() function s:sp33()
sp|call s:SPResize33()|wincmd j sp|call s:SPResize33()|wincmd j
endfunction endfunction
command! -buffer SP33 call s:sp33() command! -buffer SP33 call s:sp33()
function s:sp66() function s:sp66()
sp|wincmd j|call s:SPResize33() sp|wincmd j|call s:SPResize33()
endfunction endfunction
command! -buffer SP66 call s:sp66() command! -buffer SP66 call s:sp66()
"functions to create a vertical split using 33% and 66% width "functions to create a vertical split using 33% and 66% width
function s:VSResize66() function s:VSResize66()
vs|wincmd =|q vs|wincmd =|q
endfunction endfunction
function s:vs66() function s:vs66()
vs|call s:VSResize66() vs|call s:VSResize66()
endfunction endfunction
command! -buffer VS66 call s:vs66() command! -buffer VS66 call s:vs66()
function s:vs33() function s:vs33()
vs|wincmd h|call s:VSResize66()|wincmd l vs|wincmd h|call s:VSResize66()|wincmd l
endfunction endfunction
command! -buffer VS33 call s:vs33() command! -buffer VS33 call s:vs33()
"}}} "}}}
"}}} "}}}