Using Howl completions


Howl is strongly in favor of completions, and will offer them whenever and wherever possible. This section aims to provide an overview of Howl completions work, and how to use them for best effect. Alternatively, if you consider auto-completions a nuisance and would like to cut down on them you’ll learn how to do that here as well.

Using completions

Interacting with completions

There are currently two different places where you’ll encounter completions: In editors while editing text, and in the command line while entering commands. While the completions offered differs as one would expect, the way you interact with a completion list is the same:

When completing, Howl will try to match your input string against the available completions in two ways: Exact matching and boundary matching. An exact match means that your input string is found as-is in the completion. A boundary match means that all parts of your input string matches at one or more boundaries in the completion, typically defined as underscores, slashes, etc. The below image illustrates the two different types of matches for a completion list:

Completion types

In the above example we can see that “aa” matches “attr_accessor” as a boundary match, while “mraardvark” is an exact match. The order of the completions above is no coincidence - boundary matches are preferred over exact matches.

Finally, a note about a gotcha:

As long as a completion list is showing, the accept key (enter or tab) will always select the active completion. This is typically what you want. However, at times you just want add a new line or a tab. To avoid selecting the completion, enter escape to close the completion list first. If you want to keep the current word as is and continue with another one, just press space as you would normally do.

Configuring completions

Here are some configuration variables you might want to tweak in order to control completions:

Controls the mode of how completions are started. This is of interest particularly if you want turn off automatically shown completion lists. If you turn it off, you will have to explicitly request completions using the editor-complete command for editors (bound to ctrl_space by default) or by pressing tab in the command line.

Controls the number of completions shown in the completion list.

Whether a selected completion will replace the current word or not.

When auto-complete is one, this variable controls after how many characters the completion list should pop up after.

This variable, unset by default, contains a list of style patterns where the completion list should not automatically pop up.

For the in-buffer completer, this controls the number of open buffers that are consulted for completions.

For the in-buffer completer, this controls whether only open buffers with the same mode as the current one is consulted or not.

Controls what key accepts the current option for popup menus, such as the completion list. Valid values are ‘enter’ (the default) and ‘tab’.

Next: Working with files