54

enter image description here

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!

laurent
  • 88,262
  • 77
  • 290
  • 428
Tathagata
  • 1,955
  • 4
  • 23
  • 39

5 Answers5

114

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.

nhkode
  • 1,286
  • 1
  • 9
  • 5
  • I have changed my OS, and haven't been using mc. So sorry for the delay in accepting this as the appropriate answer. – Tathagata Aug 02 '14 at 01:42
12

Does Home, Enter count as a keyboard shortcut?

Pablo Bianchi
  • 1,824
  • 1
  • 26
  • 30
AndreKR
  • 32,613
  • 18
  • 106
  • 168
7

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)

Petrucio
  • 5,491
  • 1
  • 34
  • 33
  • Sheesh! Anyway to map a key combinations? – Tathagata Feb 26 '12 at 22:53
  • My gnome terminal overrides the controls of `Ctrl+PageUP` and switches to the other tab that is opened. `alt+home` on the other has the same effect of taking it to top of directory listing `..`. Need to hit enter and go up ... Thanks for the answer anyway ... – Tathagata Mar 01 '12 at 16:33
5

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.

Pablo Bianchi
  • 1,824
  • 1
  • 26
  • 30
0

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.

regs
  • 1
  • 1
  • 2