Vim in cloud, part 1
But why?
Let me share my experience with using vim in the cloud, specifically on Google Cloud Platform (GCP) and GitHub’s Codespaces.
There is plenty of places where you can learn vi/vim basics, all its modes which confuses beginners – I’m assuming you’ve already figured it out.
For many years I’ve been using vim as a go-to tool for any unix flavor. And again today, I found it was good investment! I’m new to cloud but I’m little more relaxed finding known tool… and honestly, GCP’s text editor (has it a name?) is like Windows Notepad missing the features:
- to present non-printing characters,
- to diff between files,
- to lock editing,
- regular expressions.
- but It’s featured with a terrible behave saving everything you type (even unintentionally).
- …
And as you can’t ask for Notepad++, vi/vim rulez for me 😏
Important keybinding
So vim is present! But the basic challenge running it in Cloud Workstation (“codespace” in CoPilot) might be keybinding of a web browser.
Lets say you need to compare two sql-scripts and you want to use: $ vim -d ddl_invoices.sql ddl_insurances.sql
optional: $ vimdiff ddl_invoices.sql ddl_insurances.sql
.
You are now in vim’s windows1. The sequence [Ctrl]+[W], [L] should transfer you to the buffer on right side.
[Ctrl]+[W], [H]
[Ctrl]+[W], [J]
[Ctrl]+[W], [K]
[Ctrl]+[W], [L]
⇦ jump to window left
⇩ to window below (if you split veritcal – perfect for long scripts)
⇧ to window above (as for below)
⇨ to right
Instead, depending on the browser you use, you immediately leave the workbench or at the best, you get a warning you are about. I couldn’t find the easy way to redefine browser shortcut. Luckily vim provides the map-command.
Press [Esc] to see vim prompt (‘:’) and input
:map <C-B> <C-W>
(press [Enter])
which means that [Ctrl]+[B] is now the alias for [Ctrl]+[W]. Just memorize the new keybinding and you can navigate between windows same as at linux terminal.

the user is mapping the alias [Ctrl]+[B] for original keybinding [Ctrl]+[W]
to be continued…
- vim’s windows – we are discussing here the feature you can learn from the help
([ESC]:help windows
):
Editing with multiple windows and buffers. windows buffers
The commands which have been added to use multiple windows and buffers
…
↩︎
Archives
Calendar
M | T | W | T | F | S | S |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |