Vim Recall繁體中文

Calculate into your text

<C-r>=6*7<CR>

Example

Insert mode after “Total: ”, including its trailing space.

Before
Total: 
  1. <C-r>= Expression prompt opens
  2. 6*7<CR> Total: 42 · stays in Insert mode
After
Total: 42
Details & Vim help

Evaluate a Vim expression and insert its result.

Fill in a computed value without switching to a calculator.

This uses Vim’s expression language. Only evaluate expressions you understand; function calls may have side effects.

Insert-mode cursor starts at the end of the line.

Try it in Vim

  1. In Insert mode, press Ctrl-r and then =.
  2. Type 6*7 at the expression prompt.
  3. Press <CR> to insert the result.