From a9efbede25970f445df51de3136108596fe0a1d6 Mon Sep 17 00:00:00 2001 From: Sanchayan Maity Date: Tue, 12 Oct 2021 11:40:26 +0530 Subject: [PATCH] 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. --- nvim/.config/nvim/after/plugin/gdb_helper.vim | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 nvim/.config/nvim/after/plugin/gdb_helper.vim diff --git a/nvim/.config/nvim/after/plugin/gdb_helper.vim b/nvim/.config/nvim/after/plugin/gdb_helper.vim new file mode 100644 index 0000000..bc8c778 --- /dev/null +++ b/nvim/.config/nvim/after/plugin/gdb_helper.vim @@ -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 yb :call CopyBpLocToClipboard()