The vim command

There are several Unix text editors out there, and that they all give specific utilities that may be helpful especially things. During this article, we have a tendency to teach you the fundamentals of the “vim” text editor, which, in our opinion, is that the most versatile and most easy. A good feature of the “vim” command-line tool is that it acknowledges totally different programming languages and syntaxes, enabling it to color in the various blocks in your code, like functions, methods, or variables. While not as established as a language-specific IDE, it will come in handy if you required to create a fast alteration to your code. Type the the command as below, To edit a file using the “vim” text editor :

vim <file>

Using the “vim” command is going to open the file immediately.

To change looking among the file you opened victimisation the “vim” command-line tool, please press the slash (/) button. At the bottom left aspect of the screen, you’re progressing to notice this “slash” showing. You’ll be able to begin writing the string, integer, or the precise excerpt of code you wish. once you area unit done, press the “ENTER” button, and “vim” goes to require you to the primary match. If there are a lot of matches within the file, you’ll be able to press the “n” button, that goes to take you to ensuing prevalence. To change the “editor” mode, please press the “i” button, that stands for “insert“. You’ll navigate through the file using the up, down, left, right arrow keys on your keyboard. Once you are done performing the changes, please press the “ESC” button on your keyboard, which is able to disable this mode. Please type the “:wq!” combination, To save the changes. If you’ve got made an error and you want to discard the changes, please type “:q!” instead.