Vim Bindings for Google Colab

Now that I have started on the journey to explore features offered by Google Colab I might as well dive into Vim Bindings which aren’t obviously exclusive to Google Colab but all the Jupyter Notebooks

How to enable Vim bindings?

Vim is the most useful thing you’ll ever learn, it’s omnipresent. 

This was the advice given to me by my mentor when I was interning. Vim is omnipresent and using it for Google Colab really helped me speed things up (even for a few seconds)

You can turn vim bindings on by going to Keyboard Shortcuts in Tools. 

Some important shortcuts

  • esc + I – insert
  • 5G – go to line 5
  • h moves the cursor one character to the left
  • j or Ctrl + J moves the cursor down one line
  • k or Ctrl + P moves the cursor up one line
  • l moves the cursor one character to the right
  • 0 moves the cursor to the beginning of the line
  • $ moves the cursor to the end of the line
  • ^ moves the cursor to the first non-empty character of the line
  • w move forward one word (next alphanumeric word
  • dd delete line
  • yy copy current line into storage buffer
  • p paste storage buffer after current line
  • P paste storage buffer before current line
  • u undo the last operation
  • Ctrl+r redo the last undo
  • /search_text search document for search_text going forward
  • :%s/original/replacement/g Search and replace all occurrences of the string “original” with “replacement”
  • ~ Switch case
  • :wq Save the file and quit Vim

A glance


P.S I will keep updating this post

Leave a Reply

%d bloggers like this: