Welcome back friends after learning text processing and manipulation techniques, we must move to learn about the default text editor of RTL that is Vi Vi or we I am. So let's start let's know more about we I am editor. So, we I am is a text editor or utility on the command line utility, and GBM is the graphical utility for VI. We can perform a wide range of operations on text files, like writing, manipulation, and so on. To create a file or open a file with vi m, we need to write just simply a Command V is paste file name. If the file with file same file name and extension did exist in the same path, it will open the file The command line interface in the Linux terminal otherwise it will create a new file.
Then we can edit it. Remember two keys are shortcut keys, the escape to exit the current mode or press double two times escape to return to command mode. Escape of suppose if what is the mode when we are using command line or language terminal, it is in an interactive mode, we write a command hit enter, it provides the output or ask you another command you can always write but when you are in a vi editor, you are in editing mode. So you are writing text for a file so you could not provide the next command. If you need to provide next command you need to press escape. It will exit the writing mode and move to interactive mode where you can execute decline.
Similarly, if we want to move again back to the editing mode, you can write a type escape one more time. There are various options or arguments that can be used with vi M. editor is more small lie means insert mode, which begins insert mode at the cursor. The many operations could be a capital A for append to end of line, where you can add content, where the string of text file ends. On the last of the after the last line with capital I you can insert at beginning of the line if you want to insert a small a to insert new, a new line or capital O to insert a new line above and below respectively. You can use the exit mode, you can enter x x mode with n to n which creates a command from at bottom left of the screen. You can use three different things is small W to write back or save the data to the file disk.
That is the key that you press W q to write and quit and small q to quit even if changes are there. Don't hesitate when Don't worry when in vi m editor, you could not read back to get back to the command Intel interactive mode. You may type press the Q a small q command or escape. You can move around throughout the string throughout the file text file, using different characters At gkl would act like arrow keys up down left right. Non arrow keys could be useful in remote connection to older systems where arrow keys are not very helpful. Or you can use alternatively alternative to it.
You can move word by word, you can escape one word and move to next word by using W and V, V for right moving right hand side w for moving left hand side, you can move by centers using the opening and closing bracket. You can move by paragraph by opening and closing braces. You can jump to next line with x, g or x Come on, you can jump directly to the end with capital G. Similarly, you can run the tutor or built in help using the Help Help topic or the I am tutor C'mon we have different shortcut keys. Suppose we want to paste certain things you can press B or capital P to put paste or copied data or delete data is small you to undo most recent changes capital you to undo all the changes to the current line since the cursor control or is used to redo the last hundred changes, we a small way to start character oriented highlighting capital V to start line oriented highlighting and you can use a different operation to split the ctrl W to split the screen horizontally Ctrl W to split the screen vertically vertically and Ctrl w with arrow moves between the windows So, this was a brief introduction about vi m a text editor.
You can also use leafpad, OpenOffice or other graphical utilities like PG editors, which will allow you more operations if you are familiar with G wagen. Otherwise you can use a command line interface. That sounds more programmatic. So you can give it a try and keep learning keep moving ahead. We will learn more in the coming videos.