After you feel satisfied with writing in VIM, you can escape out of the insert mode (room) and enter the normal mode (passage way). After entering i you can type anything you want. The main mode in VIM is Insert mode, where the actual typing and text editing takes place, Enter i to enter insert mode. You cannot start inserting text in the file while being in Normal mode but you can replace text and edit the existing text in the file such as substitution or cut/paste in Normal Mode. By default after opening vim you are in Normal mode. You have to enter normal mode before switching to other three modes. Each other mode is accessible via Normal mode. The default mode is the Normal mode where you can navigate in your file ,like a passage way between different rooms. You can also use : and number to jump to a particular line of that number, :12 moves you to the 12th line. Let's say you type 23j, here you will go down 23 lines. If you want to apply certain movements several times you can use numbers before hjkl to move the number of times in that directon. I know its wired but you will get used to it.
To navigate around vim like blazing fast you can use h,j,k and l.
Wait a second, you should learn how to move in vim first but you cannot learn everything at once, So take it bit by bit. This is because are 4 basic modes in Vim, understand it like a room. You won't see anything happening even if you are typing. If you are in Linux or MacOS, then open the terminal and type vim and enter.Īfter you are in Vim, you will surely be trying to type something right? else you are not a geek )
After that open CMD or terminal for windows 10 and type vim and enter. If you are on windows you have to add the vim.exe file's path to the environment variable PATH. įirstly let us understand how to open vim from command line or the terminal To download vim you can go to the official Vim website. It takes time to get used to the commands and key combination of Vim.īut, let us get our feet wet in learning a few commands in Vim. So that being said, vim is not easy to learn, you have to put some effort to reap the fruits of saving time in the longer run. This text editor is preinstalled in most of the Linux distributions and hence you could quickly edit some files without going anywhere. You can run program files from vim itself just by a few keystrokes. That makes it quite a great option to improve your terminal command skills and also for enhancing your Linux knowledge. Vim can be used in the terminal which means it can run terminal commands inside the editor interface. Vim is a text editor, not any text editor but a special and one of the fastest out there, if you use it wisely. Terminal or Command line are quite important to learn and are powerful as well.
We all are asked to use visual studio code and other rich looking editors as a beginners text editor or an IDE but that makes a habit of a rich and pleasing interface of running and debugging programs, and that is the reason we don't feel good to use command line or the terminal.