From 9f8313a45a13adda7490b6a6560cf6d491ef0077 Mon Sep 17 00:00:00 2001 From: Kevin MacMartin Date: Fri, 27 Feb 2015 11:21:28 -0500 Subject: [PATCH] Unset read-only when editing a read-only file rather than complaining + separate syntastic quiet messages out by language and checker --- vim/config/after.vim | 3 +++ vim/config/plugins.vim | 34 +++++++++++++++++++++++----------- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/vim/config/after.vim b/vim/config/after.vim index c34b18f..d4f60f5 100644 --- a/vim/config/after.vim +++ b/vim/config/after.vim @@ -27,6 +27,9 @@ if has("autocmd") && exists("+omnifunc") autocmd VimEnter,Filetype * if &omnifunc == ""|setlocal omnifunc=syntaxcomplete#Complete|endif endif +"prevent warnings when changing read-only files +autocmd FileChangedRO * nested set noreadonly + "FILETPE AND SYNTAX: {{{ "set given filenames to various filetypes autocmd BufNewFile,BufRead *.aspx,*.asmx,*.ascx,*.master setlocal ft=aspnet diff --git a/vim/config/plugins.vim b/vim/config/plugins.vim index 85cf952..11df7ce 100644 --- a/vim/config/plugins.vim +++ b/vim/config/plugins.vim @@ -168,26 +168,38 @@ scriptencoding utf-8 let g:autostartchecker=0 else if (g:autostartchecker == 1) - let g:syntastic_mode_map={'mode':'active','active_filetypes':[],'passive_filetypes':[]} + let g:syntastic_mode_map={ + \ 'mode':'active', + \ 'active_filetypes':[], + \ 'passive_filetypes':[] + \ } let g:syntastic_check_on_open=1 else - let g:syntastic_mode_map={'mode':'passive','active_filetypes':[],'passive_filetypes':[]} + let g:syntastic_mode_map={ + \ 'mode':'passive', + \ 'active_filetypes':[], + \ 'passive_filetypes':[] + \ } let g:syntastic_check_on_open=0 endif - let g:syntastic_quiet_messages={ + let g:syntastic_sh_shellcheck_quiet_messages={ \ 'regex':[ - \ 'package\ [^\ ]*\ does not exist.*', - \ 'cannot find symbol.*', - \ '.*method does not override or implement a method from a supertype.*', - \ '.*fatal error:[^:]*: No such file or directory.*', - \ '.*line too long.*', \ '.*appears unused\. Verify it or export it\. \[SC2034\]', - \ 'Expressions don.t expand in single quotes, use double quotes for that\. \[SC2016\]', - \ 'Shebang (#!) missing\. Assuming Bash\. \[SC2148\]', - \ 'trailing whitespace \[W291\]', + \ 'Expressions don.t expand in single quotes, use double quotes for that\. \[SC2016\]' + \ ]} + let g:syntastic_java_javac_quiet_messages={ + \ 'regex':[ + \ 'cannot find symbol.*', + \ 'method does not override or implement a method from a supertype.*', + \ 'package [^\ ]* does not exist.*' + \ ]} + let g:syntastic_python_flake8_quiet_messages={ + \ 'regex':[ + \ 'line too long ([^)]*) \[E501\]', \ 'blank line contains whitespace \[W293\]' \ ]} + autocmd BufNewFile,BufRead PKGBUILD,bash.bashrc,.bashrc let g:syntastic_quiet_messages={"level":"warnings"} let g:syntastic_check_on_wq=0 let g:syntastic_always_populate_loc_list=1