How to use vi text editor on Lubuntu

When it comes to console based text editor, vi is the best tool you can get, learning vi is very important, because you could survive on any... thumbnail 1 summary
When it comes to console based text editor, vi is the best tool you can get, learning vi is very important, because you could survive on any unix system once you know how to use it.

The vi text editor is available by default on lubuntu system, you don't need to install, but there is a better version of vi called vim (vi improved). You can install vim if you want.

First of all vi is pronounced vee-eye, in general vi works in two different modes, the command mode and insert mode.

Command mode is where you run vi command, the vi command is usually start with : (colon sign), for example if you want to exit vi without saving, you type this command below.

:q!

There are so many commands that you can use on vi, here's some of them:

CommandFunction
:qexit vi
:q!exit vi without saving
:wqsave and then exit vi
:wsave
:helpshows help for vi
dddelete current line
:10go to spesific line, this case line 10
:=shows total lines
:.=returns line number of current line at bottom of screen
/textsearching the word "text" on current documment, forward search
?textsearching the word "text" on current documment, backward search

That's the command mode, the other is the insert mode, insert mode is where you edit the text file, where you type stuff you want to type.

By default when you open vi, you will be on command mode, to switch to insert mode, simply press i button on your keyboard.

From insert mode, if you want to switch back to command mode, simply press ESC (escape) button on your keyboard.

So you need to understand what mode are you in right now, the best way to do this is to try out for yourself.

This might be confusing for beginners, but once you get used to it, you will be happy editing text with vi or vim all day.


~ hope this help ~

2 nhận xét

  1. A Plain Text Editor
    Plain Text files
    That's right, if you're writer on a budget, you don't need to spend any money buying expensive writing software or apps. Instead, you can use the text editor that comes free with your operating system.
    Just open up Notepad on Windows or TextEdit on a Mac. I like plain text editors for writing something short quickly and easily, without thinking much about it. I wrote a blog post about the benefits of using plain text editors as writing software.
    Use for: writing whatever, wherever

    Trả lờiXóa
  2. A Plain Text Editor
    Plain Text files
    That's right, if you're writer on a budget, you don't need to spend any money buying expensive writing software or apps. Instead, you can use the text editor that comes free with your operating system.
    Just open up Notepad on Windows or TextEdit on a Mac. I like plain text editors for writing something short quickly and easily, without thinking much about it. I wrote a blog post about the benefits of using plain text editors as writing software.
    Use for: writing whatever, wherever

    Trả lờiXóa