Skip to content

Commit

Permalink
basics: add register type summary
Browse files Browse the repository at this point in the history
  • Loading branch information
practicalli-johnny committed Jan 22, 2024
1 parent d3487db commit d0e1c26
Showing 1 changed file with 30 additions and 2 deletions.
32 changes: 30 additions & 2 deletions docs/neovim-basics/registers.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ The name of a register is a number, alphabetical or special character.

`SPC f r` lists the values of registers in a telescope popup


!!! EXAMPLE "Yank and paste commit message"
Select the text of the commit message

Expand All @@ -18,8 +17,33 @@ The name of a register is a number, alphabetical or special character.

++double-quote++ ++"m"++ ++"p"++ pastes the register text into the commit message buffer

## Special Registers

## Registers

!!! INFO "Neovim help - registers"
```shell
:help registers
```

++double-quote++ the unnamed register, used by Neovim normal commands, e.g. `c` `d` `p` `s` `x` `y`, etc.

++0++ to ++9++ numbered registers containing yank and delete history

++minus++ small delete register for text smaller than a line

++"a"++ to ++"z"++ named registers manually selected, ++"A"++ to ++"Z"++ to append to the text already in the register

++colon++ ++period++ and ++"%"++ read-only registers use with put commands (last inserted, current file name, recent command)

++"#"++ alternate buffer file name

++equal++ expression register for the result of runing a Neovim command expression

++plus++ and ++"*"++ selection registers for GUI

++underscore++ black hole register does not store text, use when normal commands shouldnt update other registers

++slash++ last search pattern register used


## Find Registers
Expand All @@ -28,3 +52,7 @@ The name of a register is a number, alphabetical or special character.

![AstroNvim Find Registers - telescope view](https://github.com/practicalli/graphic-design/blob/live/editors/neovim/screenshots/neovim-find-registers-telescope-popup-light.png?raw=true#only-light){loading=lazy}
![AstroNvim Find Registers - telescope view](https://github.com/practicalli/graphic-design/blob/live/editors/neovim/screenshots/neovim-find-registers-telescope-popup-dark.png?raw=true#only-dark){loading=lazy}


!!! HINT "Registers in insert mode"
`C-r` in insert mode pastes the content of the given register, e.g. `C-r a` to paste the content of `"a`

0 comments on commit d0e1c26

Please sign in to comment.