nvim: after/plugin/gdb_helper: Add helper to get breakpoint

This allows us to generate a breakpoint location we can use in the gdb
command file or on command line and also copies it to the clipboard thus
allowing us to easily paste it.
This commit is contained in:
Sanchayan Maity 2021-10-12 11:40:26 +05:30
parent e5f2fb0318
commit a9efbede25

View file

@ -0,0 +1,8 @@
function! CopyBpLocToClipboard() abort
let linenumber = line(".")
let filepath = expand("%")
let breakpoint = "break " . filepath . ":" . linenumber
silent execute "!wl-copy " . breakpoint
endfunction
nnoremap <silent> <Leader>yb :<C-U>call CopyBpLocToClipboard()<CR>