forked from bergercookie/vim-debugstring
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcpp.vim
More file actions
21 lines (17 loc) · 657 Bytes
/
Copy pathcpp.vim
File metadata and controls
21 lines (17 loc) · 657 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
let g:debugstring_loaded_cpp_vim = 1
function! s:DebugStringFunBase(desc, var)
let l:debug_str = 'std::cout << "' . a:desc
\ . '" << '
\ . a:var
\ . ' << '
\ . 'std::endl;'
if g:debugstringAlwaysIncludeHeader
let l:incStr = '#include <iostream>; '
let l:debug_str = l:incStr . l:debug_str
endif
return l:debug_str
endfunc
command! -buffer -nargs=0 AddDebugString
\ put=s:DebugStringFunBase(g:DebugstringPrefixStr(), g:debugStringCounter)
command! -buffer -nargs=1 AddDebugStringExpr
\ put=s:DebugStringFunBase(<args> . ': ', <args>)