Macro editor: insert <c-r> literally

Fixes #78.
This commit is contained in:
Marco Hinz 2016-02-08 19:46:23 +01:00
parent d0afeaece2
commit cafc275bbe

View File

@ -1768,11 +1768,14 @@ register.
I often use this to correct typos I did while recording a macro. I often use this to correct typos I did while recording a macro.
```vim ```vim
nnoremap <leader>m :<c-u><c-r>='let @'. v:register .' = '. string(getreg(v:register))<cr><c-f><left> nnoremap <leader>m :<c-u><c-r><c-r>='let @'. v:register .' = '. string(getreg(v:register))<cr><c-f><left>
``` ```
Use it like this `<leader>m` or `"q<leader>m`. Use it like this `<leader>m` or `"q<leader>m`.
Notice the use of `<c-r><c-r>` to make sure that the `<c-r>` is inserted
literally. See `:h c_^R^R`.
#### Quickly jump to header or source file #### Quickly jump to header or source file
This technique can probably be applied to many filetypes. It sets _file marks_ This technique can probably be applied to many filetypes. It sets _file marks_