dedicated buffers - chimay/wheel Wiki

Introduction

The available actions depend on the buffer type :

Wrapping up things

In normal mode, the keys j/k and <up>/<down> wrap the buffer :

Filtering

In most dedicated buffers, the first line is left empty : it is used as an input line to filter the buffer. You can go to insert mode and filter the elements with each pattern you enter on the input (first) line. Typing <space>, <esc> or <enter> will update the candidates. Note that <C-c> is not mapped, in case you need to go to normal mode without triggering the filter function.

A space between two patterns is a logical and. So, one two will display lines containing both one and two.

A pipe | in the middle of a pattern is a logical or. So, one|two will display lines containing one or two.

A bang ! beginning a filtering pattern is a logical not : all lines matching this pattern will be removed from the buffer.

Here, one and two can be any vim regex. Most of the time, they are simply part of the result you want.

For example, if you have the completion list small flower, big flower, small fruit and big fruit :

Input history

An input history is available in insert mode. You can insert the previous/next input with <Up>/<Down> or <M-p>/<M-n>.

The keys <PageUp>/PageDown or <M-r>/<M-s> will insert the previous/next input matching the beginning of the inserted line, until the cursor.

Action

The main keys are :

Select entries

Some dedicated buffers will act on selected entries. You can hit :

Reload

Press r and the dedicated buffer will reload its content.

Available on most dedicated buffers.

Quit

Press q to quit the dedicated buffer. It is not lost : you can reopen it any time with <m-w><end>.

Buffer ring

Wheel manages a dedicated buffers ring. You can :

A wheel dedicated buffer is also called a mandala.

Layer ring

Each dedicated buffer has its own layer ring.

Each time you launch a wheel function involving a dedicated buffer, a new associated layer is added to a stack local to the buffer. You can see it as a kind of dedicated buffer history. You can :

The maximum size of the layer ring is determined by g:wheel_config.maxim.layers

So, there are two levels :

A layer in a dedicated buffer is also called a leaf.

Menu

You can filter the menu lines by entering patterns in insert mode.

Action

In menu buffers, <tab> is a synonym for <enter> : trigger action.

Since there is no need to select multiple elements, <space> is a shortcut for g<enter> : launch action and leave the menu opened.

Main menu

The main menu is triggered with <M-w><M-m> by default. From there, you can launch an action by pressing <enter> on its line. Same thing for g<enter>, but it will leave the dedicated buffer opened.

The available actions are grouped by themes and folded. Just open a fold to access its content.

Meta menu

Press <M-w>= to open the meta menu : each line in this buffer will launch a sub-menu. Each sub-menu holds actions of the same category :

In these sub-menus, you can use the keys :

Context menus

Some dedicated buffers have context menu support. In that case, pressing <tab> will open a menu where you can choose the action you want to apply to the selected or cursor line(s).

If you change your mind and wish to come back, just press <backspace>.

Navigation

The navigation buffers allow you to quickly switch to a Wheel location by pressing <enter> on the matching line. The buffer will be opened in previous used window. You can also use the keys :

Same keys as above, but leave the navigation buffer opened :

The navigation buffers also have context menus support. See the context menus.

Mappings

The default mappings launching navigation buffers are :

Menus

The navigation buffers can also be launched from the main & meta menus.

Folding

The map <M-w><M-x> opens a dedicated buffer where folds are used to reflect the tree structure of the Wheel : toruses, circles and locations.

Filtering in that buffer will keep surrounding folds ; only non mathing empty folds will be removed.

Selection

Pressing <Space> will toggle the selection of the current line. If a line is selected, it will begin with an asterisk. You can then open all selected files in tabs, splits or vertical splits.

Within the wheel

The dedicated buffers that allow us to navigate in the wheel are :

Locate

Search files with locate.

The default mapping is <M-w>l.

Find

Search files with glob().

If you enter pattern at the prompt, the glob used to find files will be :

**/*pattern*

If you enter several words at the prompt, say word-1 word-2 , the glob used to find files will be : >

**/*word-1*word-2*

The default mapping is <M-w>f.

Async find

Search files with find in async mode.

If you enter pattern at the prompt, the glob used to find files will be :

*pattern*

The find command is recursive by default, so you don’t need the double asterisk prefix.

If you enter several words at the prompt, say word-1 word-2 , the glob used to find files will be :

*word-1*word-2*

The default mapping is <M-w>&f.

You can stop the process by using <c-s> in the dedicated buffer.

MRU

Open file in Most Recently Used file list.

The default mapping is <M-w><M-u>.

Fields

This buffer displays the following columns :

date & time of last edit | filename

Buffers

Go to buffer.

The default mapping are :

Fields

This buffer displays the following columns :

buffer number | indicator | line number | filename

Tabs and windows in tree mode

Switch to visible buffer, displayed in a tab or window. Folding mode matching the tree of tabs and windows.

The default mapping is <M-w><M-v>.

Tabs & windows

Switch to visible buffer, displayed in a tab or window.

The default mapping is <M-w><C-v>.

Fields

This buffer displays the following columns :

tab number | window number | filename

Occur

List of lines matching a pattern.

The default mapping is <M-w><M-o>.

Fields

This buffer displays the following columns :

tab number | window number | filename

Grep

The default mapping is <M-w>g.

The navigation mappings are the same as usual : activate a buffer line will open the right file at the right place.

Context menu

The context menu contains :

Fields

This buffer displays the following columns :

error number | line number | column number | filename | line content

Outline

The default mapping is <M-w><C-o>.

An outline buffer is a grep buffer where all your headers are displayed. You can choose between the following header formats :

Fields

This buffer displays the following columns :

error number | line number | column number | filename | line content

Markers

Go to selected marker.

The default mapping is <M-w><M-'>. It is inspired by the normal command 'a.

Fields

This buffer displays the following columns :

mark | line number | column number | filename | line content

Jumps

Go to element in jump list.

The default mapping is <M-w><M-j>.

Fields

This buffer displays the following columns :

buffer number | line number | column number | filename | line content

Changes

Go to element in changes list.

The default mapping is <M-w>;. It is inspired by the normal commands g;.

Fields

This buffer displays the following columns :

line number | column number | line content

Tags

Go to selected tag.

The default mapping is <M-w><M-t>.

Fields

This buffer displays the following columns :

tag type | tag iden | filename | search string

Yank

As usual, you can filter the elements in insert mode. The available local maps are :

List mode

The yank wheel buffer in list mode is launched by <M-w>y.

Each line of the dedicated buffer is one of your yanks, represented as a list, one element per line.

Plain mode

The yank wheel buffer in plain mode is launched by <M-w>p.

All your yanks are concatenated and displayed in the dedicated buffer.

In normal mode, the paste is done linewise or characterwise, depending on the mapping used :

Visual mode

You can also go to visual mode and paste your selection. The paste is done characterwise.

Menus

The yank wheel buffers can also be launched from the main & meta menus.

Reordering

The reordering buffers allow you to quickly reorder Wheel elements by reordering the buffer lines. You can use yank/delete/paste operations to perform the reordering, or sort them with |:sort|.

Please yank/delete entire lines, or your data could loose their integrity.

To validate your change, simply |:write| the buffer.

The number of lines will be checked and, if there is missing or excedent lines, Wheel will refuse to apply your change.

Mappings

The default mappings launching reordering buffers are :

Menus

The reordering buffers can also be launched from the main & meta menus.

Pressed the wrong button ?

If something goes wrong, you can quit the buffer and re-read the wheel variables with <M-w>r.

Renaming

The renaming buffers allow you to batch rename Wheel elements by editing the buffer lines. You can use powerful native tools, like visual block or :substitute operations to perform the renaming.

To validate your change, simply :write the buffer.

The number of lines will be checked and, if there is missing or excedent lines, Wheel will refuse to apply your change.

When dealing with locations, only the location names will be modified : the file names on the file system remain unchanged.

Rename locations & files

This function display two columns : the first one is for the locations, and the second one for the filenames. You can edit both of them.

You can even use it to move your files to another directory ; any non-existent folder will be created if needed.

Mappings

The default mappings launching renaming buffers are :

Menus

The renaming buffers can also be launched from the main & meta menus.

Copy & move

The copy/move buffers allow you to batch copy or move Wheel elements by selecting the buffer lines. To validate your selection, simply |:write| the buffer. It will ask you if you want to copy or move the selection.

Mappings

The default mappings launching renaming buffers are :

Menus

The copy/move buffers can also be launched from the main & meta menus.

Reorganizing

The reorganizing buffer allows you to quickly reorganize the Wheel elements. All elements of the wheel are represented, and folds are used to reflect the tree structure of the Wheel :

You can :

Please move or copy entire lines, or your data could loose their integrity. Be aware that removing a line will remove the corresponding element from the wheel.

To validate your change, simply |:write| the buffer.

Mappings

The default mapping is <M-w><M-r>.

Menus

The reorganizing buffer can also be launched from the main & meta menus.

Pressed the wrong button ?

If something goes wrong, you can quit the buffer and re-read the wheel variables with <M-w>r.

Reorganize tabs and windows

In this buffer, you can :

To validate your change, simply |:write| the buffer.

Mappings

The default mapping is <M-w><C-r>.

Menus

This buffer can also be launched from the main & meta menus.

From context menu

This buffer can also be launched from the context menu of a tabs & windows navigation buffer.

Grep edit mode

The edit mode will save your search and open a new buffer where you can edit the grep lines. If you write this buffer, the plugin will propagate your changes to the grepped file(s). There are some limitations, however :

Note that :

Default mapping : <M-w><M-g>

Anyway, it's always a good thing to do a backup of your files first, or even better, to work within a VCS repository, like git.

Fields

This buffer displays the following columns :

error number | line number | column number | filename | line content

Narrow current file

This function narrow the current file lines. In the dedicated buffer, you can :

You can narrow down the lines as much as you want before editing them.

To let you edit the buffer as usual :

You can modify the existing lines as much as you want. There is also a limited support to add line with buffer local maps :

If you need to use the first-line filter, it's important to do it before adding new lines, or the numbering could be incorrect.

Just :write the buffer to propagate your changes to the original file.

Be aware that only the visible lines will be reflected to the original file : this is intended.

Default mappings :

Fields

This buffer displays the following columns :

lin number | line content

Substitution

The map <M-s> launch a :substitute wrapper. There are a few advantages to use it instead of a plain :s/.../.../g.

First, only the line contents are modified, the other fields remain intact. If you are curious about how it is done, check /\@<= in vim help.

Second, if the replacing word is already present in the buffer, it will ask you confirmation before running the substitution. So, you can avoid confusion in variable names, for instance.

Narrow all circle files

This function narrow the lines of all circle files. In the dedicated buffer, you can :

This is similar as wheel-dedicated-buffers-grep-edit, but it provides a powerful filter in the first line. You can narrow down the lines as much as you want before editing them.

To let you edit the buffer as usual :

You can modify the existing lines as much as you want, but adding or removing lines is currently not supported.

Just |:write| the buffer to propagate your changes to the original file.

Be aware that only the visible lines will be reflected to the original file : this is intended.

It uses and fill the vim quickfix list under the hood.

Default mapping : <M-w>-c

Fields

This buffer displays the following columns :

buffer number | line number | filename | line content

Substitution

The map <M-s> launch a |:substitute| wrapper. There are a few advantages to use it instead of a plain :s/.../.../g.

First, only the line contents are modified, the other fields remain intact. If you are curious about how it is done, check /\@<= in vim help.

Second, if the replacing word is already present in the buffer, it will ask you confirmation before running the substitution. So, you can avoid confusion in variable names, for instance.

Undo list

In this buffer, you can navigate in the undo tree of the related buffer.

Actions available :

Before playing with this, be sure you have a backup of your file (VCS or so).

Default mapping : <M-w><C-u>

With u, you can go back to the last undo state.

Diff mode

With D, you can visualize a diff split between :

You can even make some modifications in this file with do and dp (or :diffget and :diffput).

With x, you can close the diff split.

Fields

This buffer displays the following columns :

iden | time | written

Command output

You can execute an ex or shell command and display the output in a wheel dedicated buffer. Shell commands must be prefixed by a !.

Default mapping : <M-w>:

Examples :

Async mode

You can run a shell command in async mode and display the output in a dedicated buffer.

Default mapping : <M-w>&&

You can stop the process by using <c-s> in the dedicated buffer.