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:
parent
e5f2fb0318
commit
a9efbede25
1 changed files with 8 additions and 0 deletions
8
nvim/.config/nvim/after/plugin/gdb_helper.vim
Normal file
8
nvim/.config/nvim/after/plugin/gdb_helper.vim
Normal 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>
|
Loading…
Reference in a new issue