1

I'd like to use the same keyboard shortcuts for step-debugging in CGDB that Visual Studio uses by default. The main three for me are step over (F10), step in (F11), and step out (SHIFT+F11). I use Ubuntu and have disabled the F10 (menu) and F11 (fullscreen) gnome terminal shortcuts. I can then successfully run CGDB with the following ~/.cgdb/cgdbrc file:

map <F10> :next<CR> # (step over)
map <F11> :step<CR> # (step in)

I have not though been able to succeed with a mapping of SHIFT+F11. I tried both:

map <S-F11> :finish<CR> # (step out)

...and:

map <S-<F11>> :finish<CR> # (step out)

...with no luck. A page on Vim fast keycodes here mentions "terminal keycode", and I used cat to find that the SHIFT+F11 code is ^[[23;2~, but I've not been able to work out how to use that within my cgdbrc file. Can anyone help?

user2023370
  • 10,488
  • 6
  • 50
  • 83
  • [This](https://vi.stackexchange.com/a/17250/6498) should answer your question. – Enlico Mar 07 '20 at 18:49
  • Alas I find that even less helpful than the page on Vim fast keycodes. – user2023370 Mar 08 '20 at 14:07
  • Have you tried putting something `set =^[[23;2~` in your `.vimrc` file? Or maybe in your `cgdbrc` file, which seems to use the same sintax as Vim? You shouldn't type `^[[23;2~` literally in the `.vimrc` file or wherever. You should press Ctrl-V and then Shift-F11, instead. – Enlico Mar 08 '20 at 14:20
  • 1
    Put `nn :normal ihello` in your `.vimrc`, then open a file and hit Shift-F11. What happens? If it does not insert `hello`, try putting `set =^[[23;2~` in the `.vimrc` before the above mapping and try again. What happens? – Enlico Mar 08 '20 at 14:35
  • I put `nn :normal ihello` in my `.vimrc`. I opened a file with vi and hit Shift-F11 in normal mode: `hello` appears. I also added the set command before nn in `.vimrc` (using Ctrl-V), and tried again. This gives the same result. (Whether in `.vimrc` or `.cgdbrc`, there is alas no effect within CGDB.) – user2023370 Mar 31 '20 at 10:58
  • If `hello` appears that's fine. I gave for granted that without `nn :normal ihello` in your `.vimrc` it doesn't. Maybe I was wrong? However I never used VS or VSC, so I cannot be of further help on this. Just one think comes to my mind: does VS expect that `.cgdbrc` be written in vimscript? If so, maybe you want to use non-recursive mappings (such as `nn`), instead of `map`. I hope someone more knowledgeable will help you. – Enlico Mar 31 '20 at 11:07
  • I assume you mean CGDB rather than VS (Visual Studio?). I am only looking to use the shortcuts of Visual Studio, there is no integration here. I tried using `nn` in `.cgdbrc` instead of `map`, but it didn't work. Thanks for all your help Enrico. – user2023370 Mar 31 '20 at 11:51
  • I expect this is impossible. I've just found an ignored CGDB Google groups message from 8 years ago (2012): https://groups.google.com/forum/#!topic/cgdb-users/qREpnoSOT8o – user2023370 Apr 01 '20 at 16:39

0 Answers0