Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow use of registers #279

Open
oolonc opened this issue Apr 30, 2024 · 0 comments
Open

Allow use of registers #279

oolonc opened this issue Apr 30, 2024 · 0 comments

Comments

@oolonc
Copy link

oolonc commented Apr 30, 2024

Problem description

In the Vi mode built-in to ZSH " is bound to vi-set-buffer in the vicmd map. It would be convenient to be able to store sections of a command into a register to quickly rearrange things. Would it be possible to have this functionality in ZVM?

Expected behavior

According to zshzle(1):

vi-set-buffer (unbound) (") (unbound)

Specify a buffer to be used in the following command. There are 37 buffers that can be specified: the 26 ‘named’ buffers "a to "z, the ‘yank’ buffer "0, the nine ‘queued’ buffers "1 to "9 and the ‘black hole’ buffer "_. The named buffers can also be specified as "A to "Z.

When a buffer is specified for a cut, change or yank command, the text concerned replaces the previous contents of the specified buffer. If a named buffer is specified using a capital, the newly cut text is appended to the buffer instead of overwriting it. When using the "_ buffer, nothing happens. This can be useful for deleting text without affecting any buffers.

If no buffer is specified for a cut or change command, "1 is used, and the contents of "1 to "8 are each shifted along one buffer; the contents of "9 is lost. If no buffer is specified for a yank command, "0 is used. Finally, a paste command without a specified buffer will paste the text from the most recent command regardless of any buffer that might have been used with that command.

When called from a widget function by the zle command, the buffer can optionally be specified with an argument. For example,

zle vi-set-buffer A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant