1

I would like to define the following keys in Cmder:

Alt+Up -> move to parent directory (Ctrl+Alt+U)

Alt+Left -> move to previous directory (the one I was in before the last cd)

Alt+Right -> move to next directory


Any help ?

kofifus
  • 308

1 Answers1

2

As you said AutoHotKeys is not acceptable, it is difficult to move to previous and next directory, but it can be done. I have added one way to achieve it, but moving up the directory is pretty simple.

  • Press Windows+Alt+P for settings and goto the Keys and Macros Section.
  • Select the Macros from the dropdown.
  • Select an empty Macro and Assign Alt+Up
  • Next in the GUI Macro, set the value as print("cd ..\n"). This will set the go back to parent directory. The \n in the print statement mimics an Enter keypress.

One way you can achieve to go back to the previous directory is by setting pushd as an alias to cd. For example, if you are using , you can set the alias like this: remove-item alias:\cd ; set-alias "cd" "pushd"

Now, you can set the Alt+Left key to print("popd\n") to go back to the previous location.