From a657ce80876c22bec4df6123ef6cb751e53e2cff Mon Sep 17 00:00:00 2001 From: Mathieu Maret Date: Wed, 9 Mar 2022 10:13:02 +0100 Subject: [PATCH] vim: color, builddb and indent find fixes --- .vim/colors/mycolor.vim | 1 + .vim/plugin/cscope_plus.vim | 3 ++- .vimrc | 4 ++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.vim/colors/mycolor.vim b/.vim/colors/mycolor.vim index 036da33..abf5b62 100644 --- a/.vim/colors/mycolor.vim +++ b/.vim/colors/mycolor.vim @@ -93,6 +93,7 @@ endif hi SpellBad ctermbg=None ctermfg=Red cterm=underline +hi SpellCap ctermfg=12 ctermfg=White gui=undercurl guisp=Blue " to be used with set colorcolumn=81 highlight ColorColumn ctermbg=236 highlight ALEError ctermbg=DarkMagenta cterm=bold diff --git a/.vim/plugin/cscope_plus.vim b/.vim/plugin/cscope_plus.vim index ea782f5..3ce3c7b 100644 --- a/.vim/plugin/cscope_plus.vim +++ b/.vim/plugin/cscope_plus.vim @@ -109,7 +109,7 @@ func! MenuCB(id, result) elseif a:result == 4 call AutotagsAdd() elseif a:result == 5 - execute "!" . g:build_cmd . " --dry-run --always-make | grep -wE 'gcc|g++|cc' | grep -w '\\-c' | jq -nR '[inputs|{directory:\".\", command:., file: match(\" [^ ]+$\").string[1:]}]' > compile_commands.json" + execute "!" . g:build_cmd . " --dry-run --always-make | grep -wE 'gcc|g++|cc|clang|clang++' | grep -w '\\-c' | jq -nR '[inputs|{directory:\".\", command:., file: match(\" [^ ]+$\").string[1:]}]' > compile_commands.json" elseif a:result == 6 "https://github.com/rizsotto/Bear execute "!bear --" g:build_cmd "--always-make" elseif a:result == 7 "https://github.com/nickdiego/compiledb @@ -117,6 +117,7 @@ func! MenuCB(id, result) elseif a:result == 8 "https://github.com/rizsotto/scan-build execute "!analyze-build" endif + "Add -DCMAKE_EXPORT_COMPILE_COMMANDS=ON with cmake build endfunc command! ShowMenuCodeDb diff --git a/.vimrc b/.vimrc index f5da7a4..7d000ad 100644 --- a/.vimrc +++ b/.vimrc @@ -232,6 +232,10 @@ augroup END fu DetectIndent() + if len(expand('%')) == 0 + return + endif + execute system ('python2 ~/.vim/indent_finder/indent_finder.py --vim-output --default space --default-size ' . &tabstop .' "' . expand('%') . '"' ) if &expandtab let b:clang_style="{BasedOnStyle: LLVM, AlignConsecutiveAssignments: true, AllowShortFunctionsOnASingleLine: Empty, BreakBeforeBraces: Linux, BreakStringLiterals: false, ColumnLimit: 95, IndentCaseLabels: true, IndentWidth: " .&shiftwidth .", TabWidth: " .&tabstop .", UseTab: Never}"