Getting started with Vim
Edit, navigate, open multiple tabs and windows

I am a developer from Toronto, Canada and I enjoy writing about JavaScript, Angular and the .NET framework.
Search for a command to run...
Edit, navigate, open multiple tabs and windows

I am a developer from Toronto, Canada and I enjoy writing about JavaScript, Angular and the .NET framework.
No comments yet. Be the first to comment.
In this series, I will share on how to use vim, from editing, navigation to using powerful plugins.
Installing plugins to vim
What does 99.99% mean?

Using Projections - getting related data

Expose an entity using HotChocolate

Reactive programming is somewhat of a shift in thinking on how you get values from a source of data. Instead of you asking the source every few seconds for an update, the source sends you data you are interested in over time. In other words, we are t...

Learn to create your own tags like control

Vim is a power tool to edit files, and in this series, I want to share tips on using it. This is especially important if you are going to connect to a linux system to do troubleshooting or just general editing. Furthermore, you can use this editor on any operating system (including Windows!)
In this post however, I will go over basic commands. In upcoming posts I will focus on some plugins that I have found to be quite useful for my daily coding.
If you have never used Vim, you should know that it has two modes - COMMAND and INSERT.
COMMAND mode is the default mode you will usually be in when you open vim. To enter this mode, you press the escape key. Some commands in this mode require typing the whole command and pressing enter - this is where the colon comes first (you can see some of these commands below). INSERT mode is the mode that allows you edit the file and can be entered by pressing the letter 'i' or pressing the insert key.
Here are some basic commands (commands that need to be typed with ESC key first will be in bold - you will notice they are also the ones that start with a colon):
Apart from commands above, one of my favorite is to switch to the terminal temporarily to do something else and then get back to the vim editor (with everything preserved the way it was left):
Another thing that you can do with vim is to check the diff between files. Just type the following:
vi -d file1 file2
This will open files side by side. To navigate between the files, you can just use Control + ww. Make sure you are in COMMAND mode.
To open multiple files in tabs, type in the following on the terminal:
vi -p file1 file2 file3
To switch tabs, use tab+gt. If you want to switch to the second tab, press 2gt in COMMAND mode.
To open files as windows so you can see their contents (instead of tabs), use the following:
vi -o file1 file2
This will open files with file1 at the top, and file2 at the bottom. If you use a capital letter O, it will open file1 on the left, and file2 on the right.
Navigation is similar to tabs. Use the combination of Control + ww to go through all windows one at a time, or, Control + w, [h or j or k or l]. Recall cursor navigation uses similar keys (h = left, j = down, k = up, l = right).