Issue #166 open

Some key bindings are missing in command line

Lintaro INA
created an issue

I found that some key bindings available on command line in Vim such as {{{C-r}}} (register content insertion) are missing in Evil. {{{:help ex-edit-index}}} tells the list of key bindings available on command line in Vim.

Comments (7)

  1. Frank Fischer repo owner
    • changed status to open

    The main reason for not having these key-bindings is that the command line (and also the search command line in evil-ex-search) is a usual Emacs minibuffer. And many of the Vim bindings may conflict with the standard Emacs bindings for minibuffers (e.g. C-a in Emacs corresponds to C-b in Vim and C-a in Vim has a different meaning, similarly C-h). I have no idea what to do in the case of a conflict. IMO this is somehow different to other situations: The typical emacs user (using evil or not) has to deal with several minibuffers. And it may be convenient to have the same compatible bindings in all minibuffers and not to have different in bindings in evil specific ones.

    But additional keybindings can be defined in evil-ex-completion-map (and evil-ex-search-keymap). So feel free to add some bindings if you need them. For example, C-r could be defined as

    (define-key evil-ex-completion-map "\C-r" #'evil-paste-from-register)
    

    Please note that (currently) evil is not enabled in the minibuffer, so some commands may not work as expected.

  2. Frank Fischer repo owner

    It would be nice if you could create a list of the missing keybindings, then we can decide which should go (possibly modified if the conflict with Emacs bindings) to evil-ex-completion-map.

  3. Lintaro INA reporter

    Here is a list of keys in Vim's command line. The first column indicates conflicts with key bindings in make emacs command line.

    an empty cell
    undefined key in make emacs
    =
    the same meaning in make emacs
    ~
    the same meaning in make emacs except some minor differences
    x
    some other meaning in make emacs (but not necessarily meaningful in command line)
    ? Key Meaning in Vim's command line
    x C-a do completion and insert all matches
    x C-b move cursor to the beginning of command line
    x C-c the same as ESC
    x C-d list completions
    = C-e move cursor to the end of command line
    x C-f open the command line window
    = BS delete a character backward
    x {char1} BS {char2} enter digraph (when 'digraph' is on)
    x C-h the same as backspace
    = TAB do completion (when 'wildchar' is <Tab>)
    S-TAB go to previous match of completion
    = C-i the same as TAB
    = C-j the same as RET
    = RET execue entered command
    x C-k {char1} {char2} enter digraph
    x C-l do completion and insert the longest common part
    = C-m the same as RET
    ~ C-n after completion with multiple matches go to next match, otherwise the same as Down
    ~ C-p after completion with multiple matches go to previous match, otherwise the same as Up
    ~ C-q the same as C-v
    x C-r [0-9a-z"%#*:=] insert the contents of a register as if typed
    x C-r C-f insert the contents of a register as if typed
    x C-r C-p insert the contents of a register as if typed
    x C-r C-w insert the contents of a register as if typed
    x C-r C-a insert the contents of a register as if typed
    x C-r C-r [0-9a-z"%#*:=] insert the contents of a register literally
    x C-r C-r C-f insert the contents of a register literally
    x C-r C-r C-p insert the contents of a register literally
    x C-r C-r C-w insert the contents of a register literally
    x C-r C-r C-a insert the contents of a register literally
    x C-u remove all characters
    x C-v insert next non-digit literally, insert three digit decimal number as a single byte
    x C-w delete a word backward
    x C-y copy modeless selection
    x ESC abandon command-line without executing it
    x C-[ the same as ESC
    x C-\ C-n go to normal mode, abandon command line
    x C-\ C-g go to mode specified with 'insertmode', abandon command-line
    x C-\ e {expr} replace the command line with the result of ```{expr}````
    x C-] trigger abbreviation
    x C-^ toggle use of :lmap mappings
    x C-_ change language (Hebrew, Farsi) (when 'allowrevins' is on)
    = DEL delete a character forward
    = Left move cursor left
    x S-Left move cursor one word left
    = C-Left move cursor one word left
    = Right move cursor right
    x S-Right move cursor one word right
    = C-Right move cursor one word right
    ~ Up recall previous command line from history that matches pattern before cursor
    = S-Up recall previous command-line from history
    ~ Down recall next command line from history that matches pattern before cursor
    = S-Down recall next command-line from history
    = Home move cursor to the beginning of command line
    = End move cursor to the end of command line
    = PageDown the same as S-Down
    x PageUp the same as S-Up
    = Insert toggle insert/overstrike mode
  4. Frank Fischer repo owner

    Add several key-bindings for ex command line.

    All completion-like bindings run tab-completion. Simple commands are bound to their Emacs equivalences.

    C-h is not bound because it is too usefull for accessing Emacs help.

    This addresses #166.

    → <<cset 4147534b7116>>

  5. Frank Fischer repo owner

    Implement digraphs by {char} backspace {char}.

    If the variable `evil-backspace-digraph' is set to non-nil (default nil), then such a command in sequence in insert state or ex state inserts a digraph.

    This addresses #166.

    → <<cset 8790482413af>>

  6. Log in to comment