bjackfly
bjackfly

Reputation: 3336

Trying to get vim command keystrokes in gdb 7.5

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.

Upvotes: 3

Views: 1735

Answers (2)

craigster0
craigster0

Reputation: 525

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.)

Upvotes: 1

FDinoff
FDinoff

Reputation: 31449

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.

Upvotes: 6

Related Questions