3

Hi I am using gdb version 7.5. Can someone tell me how I can get the vim keystrokes to work inside the gdb? The up and down arrow keys work for history but I want the k and j to work similar to when I am in a bash shell and have things set as set -o vi from the shell then my vim keystrokes work for command history. I used to have this set up using gdb in a previous linux instance. Currently running ubuntu 13.04.

David G
  • 94,763
  • 41
  • 167
  • 253
bjackfly
  • 3,236
  • 2
  • 25
  • 38

2 Answers2

6

gdb uses readline. So you just need to put the following command into ~/.inputrc to turn the editing mode to vi.

set editing-mode vi

Note: all programs that use readline will be affected by this setting this includes bash.

FDinoff
  • 30,689
  • 5
  • 75
  • 96
1

Over in this question about ndk-gdb I learned that C-M-j will cause gdb to enter vi mode. I tried that with gdb 7.4.1 and it worked, but I don't know about gdb 7.5. (Note: C-M-j means "Alt-Ctrl-j" for those not used to emacs nomenclature or "Esc Ctrl-j" if you don't have an Alt key.)

Community
  • 1
  • 1
craigster0
  • 483
  • 3
  • 9