Midnight Commander: Difference between revisions

From miki
Jump to navigation Jump to search
Line 26: Line 26:
== Keyboard shorcuts ==
== Keyboard shorcuts ==
* '''Gnome-Terminal''' &mdash; To solve the conflicts with '''Gnome Terminal''', disable the ''Terminal menu shortcut key'' (to enable <tt>F10</tt>) and ''Menu Access Keys'' (to enable <tt>A-h</tt>...) in ''Gnome-Terminal''.
* '''Gnome-Terminal''' &mdash; To solve the conflicts with '''Gnome Terminal''', disable the ''Terminal menu shortcut key'' (to enable <tt>F10</tt>) and ''Menu Access Keys'' (to enable <tt>A-h</tt>...) in ''Gnome-Terminal''.
* '''Auto-Complete''' &mdash; The usual shortcut for auto-complete {{kb|M-Tab}} (i.e. {{kb|Alt-Tab}}) doesn't work in graphical environment because it is used for switching between windows. As a replacement, one can use {{kb|Esc-Tab}}, or can define a new shortcut like {{kb|C-n}} (as in ''Vim'').<br/>Old version &mdash; This can be done with <tt>Options... &rarr; Learn Keys...</tt><br/>Newer version &mdash; The learn keys trick does not seem to work anymore. Instead edit all files <tt>/etc/mc/mc.keymap*</tt> as follows:
* '''Auto-Complete''' &mdash; The usual shortcut for auto-complete {{kb|M-Tab}} (i.e. {{kb|Alt-Tab}}) doesn't work in graphical environment because it is used for switching between windows. As a replacement, one can use {{kb|Esc-Tab}}, or can define a new shortcut like {{kb|C-n}} (as in ''Vim'').<br/>Old version &mdash; This can be done with <tt>Options... &rarr; Learn Keys...</tt><br/>Newer version &mdash; The learn keys trick does not seem to work anymore. Remove the learn key line from <tt>~/.mc/ini</tt> and instead edit all files <tt>/etc/mc/mc.keymap*</tt> as follows:
{{pl2|<pre>PanelMoveDown = down
{{pl2|<pre>PanelMoveDown = down
...
...

Revision as of 08:55, 17 September 2010

mc or Midnight Commander is a powerful file manager working in a shell terminal.

Links

VirtualFS

  • Shell filesystem: /#sh:[user@]machine[:options]/[remote_dir]

ini file

  • mc will only save the option ini file if there is a directory ~/.mc in home directory:
mkdir ~/.mc
  • To use vi as standard editor/viewer
First menu OptionsConfiguration...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

Keyboard shorcuts

  • Gnome-Terminal — To solve the conflicts with Gnome Terminal, disable the Terminal menu shortcut key (to enable F10) and Menu Access Keys (to enable A-h...) in Gnome-Terminal.
  • Auto-Complete — The usual shortcut for auto-complete 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 seem to work anymore. Remove the learn key line from ~/.mc/ini and instead edit all files /etc/mc/mc.keymap* as follows:
PanelMoveDown = down
...
InputComplete = alt-tab; ctrl-n
...
TreeMoveDown = down
  • 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.
  • Frequently used keyboard shortcuts (custom shortcuts defined with Learn Keys... are underlined)

General:

C-k
C-l
F10
C-o
C-xd
C-r
C-o
M-*
A-?
C-xq
C-xc
C-xo
C-xs

Down
Up
Exit Midnight Commander
open sub-shell (at current directory)
Compare directories
Rescan (refresh panel contents)
Hide panels
Reverse selection
Find file
Quick view
Change file and directory rights - chmod
Change file and directory owner - chown
Make symlink

Shell Command Line

A-Enter
C-S-Enter
M-Tab or C-n
C-x t
C-x C-t
C-x p
C-x or C-t
A-p
A-n
A-h

Paste current selection
Paste fullpath current selection
Auto-complete
Paste tagged files
Paste tagged files (other panel)
Paste current path
Paste current path (other panel)
Previous command in history
Next command in history
Command history

Directory panels

Tab
Ins or C-t
A-g
A-r
A-j
C-s A-s
A-t
C-\
C-x h
+
\
A-o
A-i
A-y
A-u
A-S-h
PgDn or C-v
PgUp or A-v
Home or A-<
End or A->
C-PgUp
C-PgDn

Panel switch
Tag/untag
Select top file
Select middle file
Select bottom file
Filename search
Toggle current display listing
Show directory hotlist
Quick add to directory hostlist
Group select
Group unselect
Load directory/parent directory in other panel
Duplicate current panel
Previous directory in history
Next directory in history
View history
PgDn
PgUp
Home
End
Cd ..
Cd current selection

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