1

Doing calculations in VIM

2

Every now and then you have to perform some calculations. The most common use case for me is determining the size of an

3

element. I used to do these by opening a TMUX split and executing something like this:

4

5
expr 73 \* 44
6

7

However, there is an easier way where you can get the result written to your buffer. When in INSERT mode simply hit

8

"CTRL-r" followed by "=" then write your calculation and hit enter. It will insert the result at your cursor position.

8

9

The end

10

I usually tweet something when I've finished writing a new post. You can find me on Twitter

11

by clicking 

normalintroduction.md
||10:118

Recently Edited

Recently Edited

File name

Tags

Time to read

Created at

context

  • go
  • context
8 minutes2024-02-28

circular-buffers

  • go
  • concurrency
  • data processing
5 minutes2024-02-04

go-directives

  • go
  • compiler
  • performance
4 minutes2023-10-21

async-tree-traversals

  • node
  • trees
  • graphs
  • typescript
19 minutes2023-09-10

All Files

All Files

  • go

    5 files

  • node

    2 files

  • typescript

    1 file

  • frontend

    1 file

  • workflow

    7 files