How to insert Powers of number symbol in Vim?

Often we want to insert powers of number like square, cube of a number. We do the following shortcut “23^2” to denote the square and “34^3” in editors. But vim provides digraphs for these as well
The Powers of a Number symbol, example square can be inserted in Vim using the characters ‘2S’

  1. Open Vim
  2. Press i to enter Insert mode
  3. Enter the number (E.g. 23)
  4. Press CTRL+k
  5. You will see a Question mark symbol
  6. Enter the two letters ‘2S’
  7. And you will see the square 23²

Note that the S is in Capital letters. For other powers

  1. 1S ¹
  2. 2S ²
  3. 3S ³
  4. 4S
  5. 5S
  6. 6S
  7. 7S
  8. 8S
  9. 9S
  10. nS

When you enter small ‘s’, it becomes a suffix

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s