From 7dc3190ee21d9ee591e091a68b5f91e65e89247e Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Thu, 17 Oct 2019 11:23:22 +0200 Subject: [PATCH] [UPDATE][VIM] Move ALE linter options to ftplugin --- vim/.vim/after/ftplugin/c.vim | 8 ++++++++ vim/.vim/after/ftplugin/cpp.vim | 8 ++++++++ vim/.vim/after/ftplugin/rust.vim | 12 ++++++++++++ vim/.vimrc | 19 ------------------- 4 files changed, 28 insertions(+), 19 deletions(-) diff --git a/vim/.vim/after/ftplugin/c.vim b/vim/.vim/after/ftplugin/c.vim index 432d12a..ca4a3ef 100644 --- a/vim/.vim/after/ftplugin/c.vim +++ b/vim/.vim/after/ftplugin/c.vim @@ -1,3 +1,11 @@ +" More warnings and the usual version in flags for Clang +let b:ale_c_clang_options='-Wall -Wextra -pedantic -std=c99' +let b:undo_ftplugin.='|unlet b:ale_c_clang_options' + +" More warnings and the usual version in flags for GCC +let b:ale_c_gcc_options='-Wall -Wextra -pedantic -std=c99' +let b:undo_ftplugin.='|unlet b:ale_c_gcc_options' + " Use compile_commands.json to look for additional flags let b:ale_c_parse_compile_commands=1 let b:undo_ftplugin.='|unlet b:ale_c_parse_compile_commands' diff --git a/vim/.vim/after/ftplugin/cpp.vim b/vim/.vim/after/ftplugin/cpp.vim index 432d12a..eac9ade 100644 --- a/vim/.vim/after/ftplugin/cpp.vim +++ b/vim/.vim/after/ftplugin/cpp.vim @@ -1,3 +1,11 @@ +" More warnings and the usual version in flags for Clang +let b:ale_cpp_clang_options='-Wall -Wextra -pedantic -std=c++17' +let b:undo_ftplugin.='|unlet b:ale_cpp_clang_options' + +" More warnings and the usual version in flags for GCC +let b:ale_cpp_gcc_options='-Wall -Wextra -pedantic -std=c++17' +let b:undo_ftplugin.='|unlet b:ale_cpp_gcc_options' + " Use compile_commands.json to look for additional flags let b:ale_c_parse_compile_commands=1 let b:undo_ftplugin.='|unlet b:ale_c_parse_compile_commands' diff --git a/vim/.vim/after/ftplugin/rust.vim b/vim/.vim/after/ftplugin/rust.vim index 234c187..a178d87 100644 --- a/vim/.vim/after/ftplugin/rust.vim +++ b/vim/.vim/after/ftplugin/rust.vim @@ -1,3 +1,15 @@ +" Check tests too +let b:ale_rust_cargo_check_tests=1 +let b:undo_ftplugin='|unlet b:ale_rust_cargo_check_tests' + +" Check examples too +let b:ale_rust_cargo_check_examples=1 +let b:undo_ftplugin='|unlet b:ale_rust_cargo_check_examples' + +" Use clippy if it's available instead of just cargo check +let b:ale_rust_cargo_use_clippy=executable('cargo-clippy') +let b:undo_ftplugin='|unlet b:ale_rust_cargo_use_clippy' + " Use rustfmt as ALE fixer for rust let b:ale_fixers=[ 'rustfmt' ] let b:undo_ftplugin.='|unlet b:ale_fixers' diff --git a/vim/.vimrc b/vim/.vimrc index b790638..3ab1aeb 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -306,25 +306,6 @@ let g:ale_echo_msg_format='[%linter%][%severity%]%(code):% %s' " The message displayed in the location list let g:ale_loclist_msg_format='[%linter%]%(code):% %s' -" C/C++ settings {{{ -"""""""""""""""" -" More warnings and the usual version in flags for Clang -let g:ale_c_clang_options='-Wall -Wextra -pedantic -std=c99' -let g:ale_cpp_clang_options='-Wall -Wextra -pedantic -std=c++17' -" More warnings and the usual version in flags for GCC -let g:ale_c_gcc_options='-Wall -Wextra -pedantic -std=c99' -let g:ale_cpp_gcc_options='-Wall -Wextra -pedantic -std=c++17' -" }}} - -" Rust settings {{{ -"""""""""""""""" -" Check tests too -let g:ale_rust_cargo_check_tests=1 -" Check examples too -let g:ale_rust_cargo_check_examples=1 -" Use clippy if it's available instead of just cargo check -let g:ale_rust_cargo_use_clippy=executable('cargo-clippy') -" }}} " }}} " FastFold settings {{{