Sample Header Ad - 728x90

remap '-' key in BASH vi normal mode to "cd .."

0 votes
2 answers
65 views
I just discovered vi mode in bash that I enable with set -o vi in my .bashrc. Now I was quite excited to remap the "normal mode" equivalents to some handy functionality. First and foremost I wanted to remap the dash-key to change directory one up from the current. I tried this:
# Remap "-" key to "cd .." in vi normal mode
bind -m vi-command '"-": "cd ..\n"'
but it doesn't seem to be working. Where did I go wrong and how to accomplish that?
Asked by glades (117 rep)
Sep 5, 2024, 05:45 AM
Last activity: Sep 24, 2024, 03:37 PM