> For the complete documentation index, see [llms.txt](https://timhwang21.gitbook.io/index/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://timhwang21.gitbook.io/index/cli/vim/ctrl-r.md).

# \<Ctrl-r>

In insert and command mode, `<Ctrl-r>` followed by a sequence inserts an object.

Insert mode usage mainly deals with manipulating registers. However, in command mode, `<Ctrl-r><Ctrl-*>` inserts special objects for certain `*`:

* `F`: Current filename under cursor
* `P`: Current filename with expanded path under cursor
* `W`: Word under cursor
* `A`: WORD under cursor
* `L`: Line under cursor

For more, `:help c-^r`.

## Insert word under cursor

Very useful with `:Ag`, or when doing find/replace.

```bash
:Ag <Ctrl-r><Ctrl-w>
:%s/<Ctrl-r><Ctrl-w>/replacement-string
```
