DEV Community

Discussion on: How To Use Vim Mode On The Command Line In Bash

Collapse
 
gettingpaid profile image
m

"There is no up and down on the command line so j and k don't do anything."
well they do cycle throw the history for me [bash version 5.0.17]

Collapse
 
brandonwallace profile image
brandon_wallace • Edited

Thank you. j and k do indeed move through the command history. I have updated the article to include the new information.

I use this a lot in my .bashrc

function hg() {
    history | grep $1;
}
Enter fullscreen mode Exit fullscreen mode

and this to run the second to last command

$ !-2
Enter fullscreen mode Exit fullscreen mode

Now I can use the j and k keys.