Vcomplete User Manual

Next:   [Contents][Index]

Vcomplete User Manual

Vcomplete provides a minor mode which highlights the completion at point the completion list buffer and (optionally) automatically updates it.

This manual is for Vcomplete version 2.0

Copyright © 2021-2022 Daniel Semyonov

You can redistribute this document and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This document is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Table of Contents


1 Introduction

Vcomplete provides a minor mode which highlights the completion at point the completion list buffer and (optionally) automatically updates it. It builds upon the default completion system, instead of replacing it. As such, it works both when completing in a minibuffer and in normal buffers.


Next: , Previous: , Up: Vcomplete User Manual   [Contents][Index]

2 Installation

Vcomplete can be installed from NonGNU ELPA:

M-x package-install RET vcomplete RET

2.1 Installing a release

Simply download a release (from <https://dsemy.com/projects/vcomplete>), and install it:

M-x package-install-file RET /path/to/download/vcomplete-VERSION.tar RET

2.2 Installing from the Git repository

Clone the repository and build the package archive:

$ git clone https://git.sr.ht/~dsemy/vcomplete
$ cd vcomplete
$ make

Install the package:

M-x package-install-file RET /path/to/clone/vcomplete-VERSION.tar RET

An installable (with package-install-file) archive is built for every commit, available through <https://builds.sr.ht/~dsemy/vcomplete>.


3 Usage

It is recommended for vcomplete-mode to be enabled:

M-x vcomplete-mode RET

You can also add (vcomplete-mode) to your init file, or enable it through the customize interface.

When vcomplete-mode is enabled, the *Completions* buffer appears and updates automatically (by default), and the completion at point in the *Completions* buffer is highlighted, even if completions-highlight-face (Emacs 29+) is nil.

The following key bindings are also made available when completion is in progress:

C-n

Move point to the next displayed completion in the *Completions* window (vcomplete-next-completion or minibuffer-next-completion on Emacs 29+). This command may be used to move multiple completions at a time with a prefix argument.

C-p

Move point to the next displayed completion in the *Completions* window (vcomplete-prev-completion or minibuffer-previous-completion on Emacs 29+). This command may be used to move multiple completions at a time with a prefix argument.

M-RET

Choose the currently highlighted completion in the *Completions* window (vcomplete-choose-completion or minibuffer-choose-completion on Emacs 29+).

You may use these commands without enabling vcomplete-mode (although they won’t be bound by default). See Completion commands for information regarding defining new commands.


4 Customization

All customization, except for defining custom completion commands can be done through the customize interface:

M-x customize-group RET vcomplete RET
User Option: vcomplete-auto-update

Whether the *Completions* buffer should open and update automatically. Non-nil means automatically open and update. Otherwise, operate according to completion-auto-help. By default, t is used. Note that with completions-detailed (introduced in Emacs 28) enabled, the *Completions* buffer takes much more time to display. This is also true for other “annotation providers” such as the Marginalia package. Consider disabling them or this option on slow computers.

User Option: vcomplete-search-range

Range of search for a *Completions* window during completion. A value of t means consider all windows on all frames, visible means consider all windows on all visible frames, 0 (the number zero) means consider all windows on all visible and iconified frames and any other value means consider only the currently selected frame. By default, 0 is used. In Emacs 29+ this option is unavailable since built-in functions and macros are used, which don’t respect its value. The built-in functions use the equivalent of setting this option to 0.


4.1 Completion commands

Completion commands are used to perform actions while completing. They are normal commands (interactive functions) which are bound to a key sequence in vcomplete-command-map.

User Option: vcomplete-no-update-commands

List of commands which shouldn’t cause the *Completions* buffer to update.

Variable: vcomplete-command-map

Key map which holds key bindings to completion commands. This key map should be available whenever completion is initiated when vcomplete-mode is enabled.

Function: vcomplete-current-completion &optional pos

Get the completion candidate at point in the ‘*Completions*’ window. When POS is non-nil, use it instead of point. The completion candidate is returned as a list of the form:

(COMPLETION-STRING . (BEG . END))

Where BEG and END are the beginning and end positions of the completion string in the ‘*Completions*’ buffer. If no completion is found, return nil.

Macro: vcomplete-with-completions-window body...

Evaluate BODY with the *Completions* window temporarily selected. This macro can be used to easily manipulate or access the contents of the *Completions* buffer. If there is no *Completions* buffer or no window displaying it BODY isn’t executed. On Emacs 29+, this macro is an alias to the built-in with-minibuffer-completions-window macro.


Appendix A Keystroke Index

Jump to:   C   M  
Index Entry  Section

C
C-n: Usage
C-p: Usage

M
M-RET: Usage

Jump to:   C   M  

Appendix B Command Index

Jump to:   V  
Index Entry  Section

V
vcomplete-choose-completion: Usage
vcomplete-mode: Usage
vcomplete-next-completion: Usage
vcomplete-prev-completion: Usage

Jump to:   V  

Appendix C Function Index

Jump to:   V  
Index Entry  Section

V
vcomplete-current-completion: Completion commands
vcomplete-with-completions-window: Completion commands

Jump to:   V  

Appendix D Variable Index

Jump to:   V  
Index Entry  Section

V
vcomplete-auto-update: Customization
vcomplete-command-map: Completion commands
vcomplete-no-update-commands: Completion commands
vcomplete-search-range: Customization

Jump to:   V