dotfiles/nvim/.config/nvim/after/plugin/gdb_helper.vim
Sanchayan Maity a9efbede25 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.
2021-10-12 14:16:37 +05:30

9 lines
278 B
VimL

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>