An essential convenience feature every reasonable shell provides is command / file name completion (usually triggered by pressing Tab). I miss it heavily when I use command line in Midnight Commander. Is there a way to use it (other than by hiding the panels with Ctrl+O)?
Asked
Active
Viewed 1.1k times
3 Answers
31
You just need to prepend it with Esc: Esc-Tab does completion, and it will even give you a tiny dropdown if you do it twice. (That being said, you probably won't get the more fancy expansion possibilities of some shells.)
Ulrich Schwarz
- 15,669
- 4
- 47
- 58
-
5This makes mc effectively unusable. You can switch panels with ctrl-u, so why can't they just leave the tab key alone? Or make panels switch with cursor right/left. – weberjn Jan 22 '18 at 15:30
-
@weberjn Ctrl-u does *not* switch panels, it *swaps* panels and you are still in the same panel. – Marcel Nov 12 '21 at 17:34
-
It's also `alt-tab`, or `m-tab`, whichever makes sense to you (depending on your OS). Esc is usually a reliable way when you don't have `alt` or `meta`. – KFL Jul 10 '22 at 06:31
8
There was a fix in MC 4.8.19 which makes redefining tab work
https://midnight-commander.org/ticket/3672
This config sample from the fix makes simple Tab work:
[main:empty-cmdline]
ChangePanel = tab
[main]
ChangePanel =
[input]
Complete = tab; alt-tab
weberjn
- 181
- 1
- 3
-
1put those lines into ~/.config/mc/mc.keymap https://midnight-commander.org/ticket/3664 – Winand Oct 14 '20 at 19:34
-
The mentioned feature is not implemented. The task is still new. (Tested with 4.8.24) So the solution **does not work as expected**. Just the lower assignment take precedence and tab now always invokes auto completion. You are no longer able to switch panels by keyboard anymore. – Marcel Nov 12 '21 at 18:24
-
@Winand and weberjn - using `mc 4.8.19`. works a treat. thanks, excellent. – J Evans Apr 17 '22 at 23:05