Add :BuildDir to select YouCompleteMe build directory

This commit is contained in:
Kenneth Benzie 2020-10-06 17:12:06 +01:00
parent b148f9fb68
commit d960053dfc
2 changed files with 9 additions and 0 deletions

6
autoload/build.vim Normal file
View File

@ -0,0 +1,6 @@
function! build#dir(dir) abort
let l:cwd = getcwd()
let $BUILD_DIR = l:cwd.'/'.a:dir
let g:ycm_clangd_args = ['--compile-commands-dir='.$BUILD_DIR]
YcmRestartServer
endfunction

View File

@ -29,3 +29,6 @@ command! -nargs=+ -complete=file Debug call do#debug(<f-args>)
" Find all TODO items in the current file and populate the location list
command! TodoFile lvimgrep /todo/ %
" Change build directory
command! -nargs=1 -complete=dir BuildDir call build#dir(<f-args>)