Vim copy breakpoint for gdb
I love gdb, but setting breakpoints can be a hassle without a large plugin. I use this in vim to copy to my clipboard:
" vim beakpoint format to clipboard
func! CopyAsBreakpoint()
let s:pos=expand('%:p') . ':' . line('.')
call system("xclip", s:pos)
endfunc
" map to a key
map <F5> :call CopyAsBreakpoint()<cr>
It will put something like this in your clipboard: /tmp/teh.go:7
As far as I know xclip is Linux only, other platforms will need something that sends stdin to your clipboard.
Written by Marin
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Vim
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#