vim: color, builddb and indent find fixes

This commit is contained in:
Mathieu Maret 2022-03-09 10:13:02 +01:00
parent 5e87bcd5c1
commit a657ce8087
3 changed files with 7 additions and 1 deletions

View File

@ -93,6 +93,7 @@ endif
hi SpellBad ctermbg=None ctermfg=Red cterm=underline 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 " to be used with set colorcolumn=81
highlight ColorColumn ctermbg=236 highlight ColorColumn ctermbg=236
highlight ALEError ctermbg=DarkMagenta cterm=bold highlight ALEError ctermbg=DarkMagenta cterm=bold

View File

@ -109,7 +109,7 @@ func! MenuCB(id, result)
elseif a:result == 4 elseif a:result == 4
call AutotagsAdd() call AutotagsAdd()
elseif a:result == 5 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 elseif a:result == 6 "https://github.com/rizsotto/Bear
execute "!bear --" g:build_cmd "--always-make" execute "!bear --" g:build_cmd "--always-make"
elseif a:result == 7 "https://github.com/nickdiego/compiledb 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 elseif a:result == 8 "https://github.com/rizsotto/scan-build
execute "!analyze-build" execute "!analyze-build"
endif endif
"Add -DCMAKE_EXPORT_COMPILE_COMMANDS=ON with cmake build
endfunc endfunc
command! ShowMenuCodeDb command! ShowMenuCodeDb

4
.vimrc
View File

@ -232,6 +232,10 @@ augroup END
fu DetectIndent() 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('%') . '"' ) execute system ('python2 ~/.vim/indent_finder/indent_finder.py --vim-output --default space --default-size ' . &tabstop .' "' . expand('%') . '"' )
if &expandtab 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}" let b:clang_style="{BasedOnStyle: LLVM, AlignConsecutiveAssignments: true, AllowShortFunctionsOnASingleLine: Empty, BreakBeforeBraces: Linux, BreakStringLiterals: false, ColumnLimit: 95, IndentCaseLabels: true, IndentWidth: " .&shiftwidth .", TabWidth: " .&tabstop .", UseTab: Never}"