Keyboard shortcut for going onelevel up in midnight commander [mc]
Keyboard ShortcutsMcKeyboard Shortcuts Problem Overview
Is there a keyboard shortcut for going one level up in the directory tree in midnight commander (mc), which will save me from going all the up to the ..
?
As shown below - say I'm in a directory that contains tonnes of stuff, and its painful to scroll all the way up. Its clickable, but nothing beats keyboard shortcuts!
Keyboard Shortcuts Solutions
Solution 1 - Keyboard Shortcuts
If you go to Options->Panel-Options and tick the "Lynx-like motion" option you can use left-arrow to go to the parent directory and right-arrow to enter a directory.
Solution 2 - Keyboard Shortcuts
Does Home, Enter count as a keyboard shortcut?
Solution 3 - Keyboard Shortcuts
Short answer: No.
Longer answer: Ctrl + PageUp goes to the last diretory - not the parent, but this may be what you want in most cases. (https://www.midnight-commander.org/ticket/2420)
Solution 4 - Keyboard Shortcuts
Without changing the default setup Alt + Y and Alt + U go to previous and next directory in history, which may be enough on most cases (Alt + H to see the full history). If not, you always have Home, Enter.
Alt + Arrows are used to move between windows on byobu/tmux.
To add a custom shortcut (like Backspace) to your user config:
echo 'CdParentSmart = backspace' >> ~/.config/mc/mc.keymap # Globally in /etc/mc/mc.keymap
Here more related handy shortcuts.
Solution 5 - Keyboard Shortcuts
In /etc/mc/mc.default.keymap
find and uncomment CdParentSmart
in [Panel]
section. If it's not there, add it. And set a key you want. Behavoir similar to Total/Double Commander would be CdParentSmart = backspace
. So it will backspace command line, if it's not empty. Or will level up from any place, if command line is empty.
The file should be edited when MC is not running, as it is resetting it to currently loaded settings on exit.