[ Пред. ] [ Содержание ] [ След. ]

Midnight Commander

[ @mc ]

 


Установка



Основные шорткаты



Настроить перенос строк


В норме перенос на 72 символе, но будет комфортно на 96 символов.


mcedit ~/.config/mc/ini


editor_word_wrap_line_length=96


Принудительный перенос слов в строке (wrap text) делается через "Alt+P"


Пролистывание в стиле Lynx


Переход по каталогам можно упростить:


[F9]
> Настройки
> Настройки панелей
> Навигация
> Навигация в стиле lynx = ДА


Теперь можно переходить на уровень выше клавишей Left. Клавишей Right можно перескакивать обратно.


Настроить внешний вид


Чтобы в будущем не путаться, надо зрительно разделить MC в режиме пользователя и MC в режиме sudo.


Для юзера можно поставить тёмную тему:


[F9]
> Настройки
> Оформление
> Скин = xoria256


Другие варианты:


[F9]
> Настройки
> Сохранить настройки


Для админа нужно что-то «напрягающее»:


sudo mc
> [F9]
> Настройки
> Оформление
> Скин = modarin256root


Другие варианты:


[F9]
> Настройки
> Сохранить настройки


mcedit как основной редактор


Add to your ~/.profile and ~/.bashrc files line


export EDITOR=mcedit


Do not put quotes around 'mcedit' word.


To take effect run


source ~/.profile && source ~/.bashrc


Или дождаться перезагрузки, и переменная подхватится.


Поменять систему отображения размера файлов


F9
> выбрать левую или правую панель
> открыть Listing format... (Формат списка)
> выбрать User defined (Определённый пользователем)
> в предложенной строке уточнить размер — “size:4”


Целиком строка будет выглядеть так:


half type name | size:4 | perm


Такой формат будет удобнее


type | name | size:4 | perm:4


В первой колонке будет указан тип файла/каталога. Если это Симлинки и хардлинки — в первой колонке будет отображаться соответствующий знак.


В правой колонке будут показаны права файла в виде „rwx”.


Размер каждого файла будет округлен вверх. Поначалу выглядит непривычно и очень мешает точному подсчету размера файлов. Но если выставить “size:4” или “size:7” (чем больше число, тем точнее отображаемый размер), то мы будем уходить в сторону битов, что тоже неудобно для восприятия.


Для удобства можно в том же окне формата списка в поле «Строка мини-статуса в формате пользователя» установить параметр “size:6” или “size:8”. А также вывод прав в цифре:


name | size:6 | mode:3


Сохранить настройку:


F9
> Сохранить настройки


Также можно это всё настроить через


mcedit ~/.config/mc/panels.ini


Найти две строки с user_format= entries — одну под [New Left Panel] и вторую под [New Right Panel]. Прописать им


user_format= name | size:4 | perm:4


Для sudo mc все эти настройки надо повторить.


При выделении файлов


через Insert их размер выводится только в байтах.


Теория


*todo MC — перевод


Учесть, что .bashrc should be used only for Bash-specific settings (e.g., shell options, aliases, etc.) while .profile should be used for setting environment variables like EDITOR (which is used by programs such as sudoedit, git, etc.).


a shell is a program designed to start other programs.


Bash is a Bourne-like shell. It reads commands from ~/.bash_profile when it is invoked as the login shell, and if that file doesn't exist¹, it tries reading ~/.profile instead.


Therefore:


~/.profile is the place to put stuff that applies to your whole session, such as programs that you want to start when you log in (but not graphical programs, they go into a different file), and environment variable definitions.


~/.bashrc is the place to put stuff that applies only to bash itself, such as alias and function definitions, shell options, and prompt settings. (You could also put key bindings there, but for bash they normally go into ~/.inputrc.)


~/.bash_profile can be used instead of ~/.profile, but it is read by bash only, not by any other shell. (This is mostly a concern if you want your initialization files to work on multiple machines and your login shell isn't bash on all of them.) This is a logical place to include ~/.bashrc if the shell is interactive. I recommend the following contents in ~/.bash_profile:


On modern unices, there's an added complication related to ~/.profile. If you log in in a graphical environment (that is, if the program where you type your password is running in graphics mode), you don't automatically get a login shell that reads ~/.profile. Depending on the graphical login program, on the window manager or desktop environment you run afterwards, and on how your distribution configured these programs, your ~/.profile may or may not be read. If it's not, there's usually another place where you can define environment variables and programs to launch when you log in, but there is unfortunately no standard location.


Note that you may see here and there recommendations to either put environment variable definitions in ~/.bashrc or always launch login shells in terminals. Both are bad ideas. The most common problem with either of these ideas is that your environment variables will only be set in programs launched via the terminal, not in programs started directly with an icon or menu or keyboard shortcut.