Difference between revisions of "Command-line and alike modes"
(→Completion: Describe wild menu) |
(→Treating / (forward slash) specially: Expand TODO) |
||
Line 52: | Line 52: | ||
===== Treating <code>/</code> (forward slash) specially ===== | ===== Treating <code>/</code> (forward slash) specially ===== | ||
+ | |||
+ | Sometimes matches on completing directory names end with a | ||
+ | slash (<code>/</code>). At this point one often wants to: | ||
+ | |||
+ | * pick current match and end completion; | ||
+ | * or pick current match and continue by typing file name after already filled in directory name. | ||
+ | |||
+ | To allow doing both of this conveniently and without leaving strange looking | ||
+ | double slash Vifm skips slash character in completion mode ''if'' there is | ||
+ | already a slash at cursor position and stops completion at the same time. So | ||
+ | it actually doesn't matter how file name is written as <code>name</code> or | ||
+ | <code>/name</code> because both will yield same results. | ||
===== <code>:help</code> argument completion exception ===== | ===== <code>:help</code> argument completion exception ===== |
Revision as of 20:36, 22 August 2014
Command-line editing
Assuming that most of users know at least some of Emacs-like shortcuts usually available on command-line prompt. And also considering them to be quite convenient (and familiar due to the first statement) for single line editing. As well as listening to common sense claims that Vim-like editing of the command-line of Vim-like file manager would be overkill caused adding of shell shortcuts to Vifm's command-line mode.
They are basically can be divided into two categories:
- navigation;
- editing;
- recalling parts of previous commands (see section on history below);
- pasting various information into current cursor position (see section that covers Ctrl-X shortcuts).
TODO: add table for navigation commands.
TODO: add table for editing commands.
TODO: add short table for history commands.
TODO: add short table for Ctrl-X commands.
TODO: refer to "Recalling previous commands" for detailed description of Alt-..
Completion
TODO: describe Tab and Shift-Tab shortcuts.
One of good developments of completion is displaying of matches so that user
doesn't need to remember the most recent ones and could see what's comming next
at the same time. It's also useful to see that you're actually completting
something rather then just editing command line. Vifm supports one of possible
ways of such matches preview called "wild menu" (same can be found in Vim).
It's disabled by default and is controlled by 'wildmenu'
boolean
option. So it can be enabled like this:
:set wildmenu
There is also related highlight group that can be customized in color schemes
WildMenu
.
And here is an example of how it looks like:
TODO: add screenshot with active wild menu.
Treating /
(forward slash) specially
Sometimes matches on completing directory names end with a
slash (/
). At this point one often wants to:
- pick current match and end completion;
- or pick current match and continue by typing file name after already filled in directory name.
To allow doing both of this conveniently and without leaving strange looking
double slash Vifm skips slash character in completion mode if there is
already a slash at cursor position and stops completion at the same time. So
it actually doesn't matter how file name is written as name
or
/name
because both will yield same results.
:help
argument completion exception
TODO: describe that it checks for presence of substring not that match starts with it.
Recalling previous commands
TODO: History (Ctrl-N/Ctrl-P/Down/Up).
TODO: Alt-. command.
Pasting runtime context into command-line
TODO: describe Ctrl-X mappings.
Editing command-line externally
TODO: describe Ctrl-G shortcut.
Useful Vim-plugin additions
TODO: describe cursor column positioning. TODO: describe automatic insertion mode. TODO: describe handling of Enter.