Skip to contents

First it’s nice to know you can have a very quick start up

Then we’ll talk through some of examples to give you some ideas which you can pick, ignore and tweak as you please.

Build from a template

A few simple examples are provided in the basic.vimrc. You can see the example at the rsvim_example_path() and you can use it to start building your own config with:

This function takes the basic examples, writes it to a .virmc file and opens it for you to make your own edits. You can also specify the files to copy to and from:

rsvim_use_template(
  to = "path/to/your/.virmc",
  from = "path/to/another/template/.vimrc"
)

Basic Example

See the full example config
" home-row exit from insert mode
inoremap jk <Esc>

" paste from yank register
" for multiple replacements with original yank
noremap \p "0p

" create a new line and stay in normal mode
noremap \o o<Esc>
noremap \O O<Esc>
  1. Home row exit from insert mode - inoremap jk <Esc>

You might have seen enough of this example by now, but we’re covering it anyway. In i insert mode, we non-recursively noremap map the key chain jk to the key chain <Esc>. Esc is a standard way to exit from insert to normal mode, so this gives as a home row way to do the same. That can be pretty neat, by do consider whether you’re likely to be typing jk while in insert mode. We use non-recursive mapping for safety, so for instance if you map Esc to something else, jk will still have the expected default Esc behaviour. Note there iNULLs also the Ctrl+[ method for leaving insert mode, that might be sufficiently convenient compared to Esc.

  1. Multiple replace paste - noremap \p "0p

  2. New line in normal mode

noremap \o o<Esc> noremap \O O<Esc>

Full example

A lot more examples are given in the full example, which you can build from with

rsvim_use_template(from = rsvim_example_path("full_example"))