Midnight Commander: Difference between revisions
Line 10: | Line 10: | ||
== Configuration == |
== Configuration == |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
* To use '''vi''' as standard editor/viewer |
* To use '''vi''' as standard editor/viewer |
||
: First menu '''Options''' → '''Configuration...''' → '''uncheck''' ''use internal edIt'' and ''Use internal view''. |
: First menu '''Options''' → '''Configuration...''' → '''uncheck''' ''use internal edIt'' and ''Use internal view''. |
||
Line 24: | Line 20: | ||
</source> |
</source> |
||
* Edit <tt>/etc/mc/mc.keymap*</tt> to use {{kb|C-n}} for '''Auto-Complete''' (instead of {{kb|Alt-Tab}} that does not work in graphical environment) (see [[#Keyboard shortcuts|below]]) |
* Edit <tt>/etc/mc/mc.keymap*</tt> to use {{kb|C-n}} for '''Auto-Complete''' (instead of {{kb|Alt-Tab}} that does not work in graphical environment) (see [[#Keyboard shortcuts|below]]) |
||
* Check |
* Check '''complete: show all''' (so that selection box is shown on first ambiguity) |
||
* To have common history between ''mc'' sub-shell and parent shell: [http://superuser.com/questions/845667/midnight-commander-subshell-sharing-a-history-file-with-the-shell-mc-was-start]: |
* To have common history between ''mc'' sub-shell and parent shell: [http://superuser.com/questions/845667/midnight-commander-subshell-sharing-a-history-file-with-the-shell-mc-was-start]: |
||
<source lang=bash> |
<source lang=bash> |
||
alias mc='PROMPT_COMMAND="history -a; history -r" mc; history -r' |
alias mc='PROMPT_COMMAND="history -a; history -r" mc; history -r' |
||
⚫ | |||
Obsolete configuration (for old version): |
|||
⚫ | |||
⚫ | |||
⚫ | |||
</source> |
</source> |
||
Revision as of 19:32, 24 May 2016
mc or Midnight Commander is a powerful file manager working in a shell terminal.
Links
- Cool review of mc in action
- The GNOME Commander, a X alternative of mc under Gnome
- Krusader, a X alternative of mc under KDE
VirtualFS
- Shell filesystem: /#sh:[user@]machine[:options]/[remote_dir]
Configuration
- To use vi as standard editor/viewer
- First menu Options → Configuration... → uncheck use internal edIt and Use internal view.
- Next, at the end of file .mc/bindings:
default/*
Open=
View=view %f
Edit=%var{EDITOR:vi} %f
- Edit /etc/mc/mc.keymap* to use C-n for Auto-Complete (instead of Alt-Tab that does not work in graphical environment) (see below)
- Check complete: show all (so that selection box is shown on first ambiguity)
- To have common history between mc sub-shell and parent shell: [1]:
alias mc='PROMPT_COMMAND="history -a; history -r" mc; history -r'
Obsolete configuration (for old version):
- mc will only save the option ini file if there is a directory ~/.mc in home directory:
mkdir ~/.mc
Keyboard shortcuts
Frequently used keyboard shortcuts (custom shortcuts defined with Learn Keys... are underlined):
General:
Shell Command Line
|
Directory panels
|
Some work-arounds / advices:
- Gnome-Terminal conflict — Gnome Terminal shortcuts conflict with MC. Disable them in Keyboard shortcuts menu (Terminal menu shortcut key (F10) and Menu Access Keys (A-h).
- Auto-Complete does not work — The auto-complete shortcut M-Tab (i.e. Alt-Tab) doesn't work in graphical environment because it is used for switching between windows. As a replacement, one can use Esc-Tab, or can define a new shortcut like C-n (as in Vim).
Old version — This can be done with Options... → Learn Keys...
Newer version — The learn keys trick does not work anymore. Remove the learn key line from ~/.mc/ini and instead edit all files /etc/mc/mc.keymap* as follows:
- For mc version 4.7:
PanelMoveDown = down ... InputComplete = alt-tab; ctrl-n ... TreeMoveDown = down
- For mc version 4.8 and above:
[panel] ... MoveDown = down ... [input] ... Complete = alt-tab; ctrl-n ...
or via command-line:
sudo sed -ri 's/; ctrl-n//' /etc/mc/mc*.keymap
sudo sed -ri 's/Complete.*/Complete = alt-tab; ctrl-n' /etc/mc/mc*.keymap
- Lynx motion — This is a nice option to enable in the configuration menu. When enabled, enter a directory with right and exit a directory with left.
Official repository
Besides Ubuntu repository, the official one is here. To add it:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F82FBD49
Add file /etc/apt/sources.list.d:
deb http://ppa.launchpad.net/zyv/ppa/ubuntu lucid main deb-src http://ppa.launchpad.net/zyv/ppa/ubuntu lucid main
Then upgrade if needed:
sudo apt-get update
sudo apt-get upgrade