"/ can be set explicitly
Closed this issue · 6 comments
As described in both :help "/
and :help @/
, the last search register can be modified using :let
.
Where do I mention that it's readonly?
EDIT: Ah, you mean the "implicitly". Will fix!
How about:
Type | Character | Filled by.. | Contains text from.. |
---|---|---|---|
Unnamed | " |
vim | Last yank or deletion. (d , c , s , x , y ) |
Numbered | 0 to 9 |
vim | Register 0 : Last yank. Registers 1 : Last deletion. Register 2 : Second last deletion. And so on. Think of registers 1 -9 as a read-only queue with 9 elements. |
Small delete | - |
vim | Last deletion that was less than one line. |
Named | a to z , A to Z |
user | If you yank to register a , you replace its text. If you yank to register A , you append to the text in register a . |
Read-only | : , . , % |
vim | Register : : Last command. Register . : Last inserted text. Register % : Current filename. |
Alternate buffer | # |
vim | Most of the time the previously visited buffer of the current window. See :h alternate-file . |
Expression | = |
user | Evaluation of the VimL expression that was yanked. E.g. do this in insert mode: <c-r>=5+5<cr> and "10" will be inserted in the buffer. |
Selection and Drop | + , * , ~ |
vim or user | * and + are the clipboard registers. Register ~ : From last drag'n'drop. |
Black hole | _ |
vim | If you don't want any other registers implicitly affected. E.g. "_dd deletes the current line without affecting registers " , 1 , + , * . |
Last search pattern | / |
vim or user | Last pattern used with / , ? , :global , etc. |
(The impicitly
/explicitly
is too easy to mix up, that's why I changed it to vim
/user
.)
Yeah, not sure where I got "readonly" from. :) I meant it can be set by the user, not just implicitly.
I don't have an opinion about implicit/explicit vs. vim/user.
Okay, I changed the table (click) to include columns for "filled by" and "readonly" and added a sentence how to set non-readonly registers manually.
Thanks for the feedback!
FYI, the alternate buffer is user settable, too. :)
Oh, I tried and just saw an error and gone on. cough It even uses the input as a pattern, so when your only loaded buffer is path/README.md
, then :let @# = 'R'
will use that filename. Nice.
Thanks again!