Midnight Commander

From miki
Revision as of 21:59, 1 July 2010 by Mip (talk | contribs) (moved from Linux Commands page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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

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 Meta-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 with Options... → Learn Keys... (e.g. use Ctrl-N as in Vim).
  • Frequently used keyboard shortcut
key description
F10 Exit Midnight Commander
Esc-Tab
Ctrl-N
Auto-Complete
Auto-Complete (custom)
Ctrl-O open sub-shell (with selected tab as current directory)
Ins select highlighted file and move to next
Ctrl-\ Open directory menu
Ctrl-X D Compare directories
Ctrl-R Rescan (refresh panel contents)
Ctrl-O Hide panels
Meta-* Reverse selection
Alt-? Find file
Ctrl-X Q Quick view
Ctrl-X C Change file and directory rights - chmod
Ctrl-X O Change file and directory owner - chown
Ctrl-X S Make symlink
  • Other frequently used keyboard shortcuts (custom shortcuts defined with Learn Keys... are underlined)

General:

C-k
C-l

Down
Up

Shell Command Line

A-Enter
C-S-Enter
E-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

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

Directory panels

Tab
Insert 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

External links: