Last active
May 28, 2020 11:08
-
-
Save yutkat/b724a4fa4a2148df62442bf252968a10 to your computer and use it in GitHub Desktop.
Vim C++ local env
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! GetCurrentFunctionName() abort | |
if empty(get(g:vista, 'raw')) | |
throw 'Please execute `:Vista`' | |
endif | |
let sig = vista#util#BinarySearch(g:vista.raw, line('.'), 'line', 'signature') | |
let func_name = split(substitute(substitute(sig, '(', '', 'g'), ')', '', 'g'), ',') | |
return func_name[0] . "." . func_name[1] | |
endfunction | |
command! TestCurrent :execute 'AsyncRun ./bin/' . expand('%:p:h:t') . '.test --gtest_filter=' . GetCurrentFunctionName() | |
set errorformat^=%f\|%l\ col\ %c\|\ %m | |
augroup local-asyncrun | |
au! | |
au User AsyncRunStop copen | wincmd p | |
augroup END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
call altr#remove_all() | |
call altr#define('src/%.cpp', 'include/%.hpp', 'test/%.test.cpp', 'include/%.h', 'test/%.cxx') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"configurations": { | |
"Launch": { | |
"adapter": "vscode-cpptools", | |
"configuration": { | |
"name": "unit-test", | |
"type": "cppdbg", | |
"request": "launch", | |
"program": "${workspaceRoot}/XXX-test", | |
"args": [], | |
"cwd": "${workspaceRoot}", | |
"environment": [], | |
"externalConsole": false, | |
"MIMode": "lldb" | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment