Thursday, September 16, 2010

FreeBSD editor VI

0. Foreword
Before, dating back some three years ago, my first contact with Unix-like systems,
I'm a fan of pico because I was using the system is Mandrake,
At that time I think pico I feel very warm, very powerful features.

After contact with FreeBSD, suddenly discovered that there was no pico, need to be able to obtain the additional installation of pine.
But no harm done, anyway to install soon ...

One day, when I do a lot to replace the action ..
Then .... pico on .... QQ
So I switched to vi ... to understand the rules of his expression,
A simple little trick to solve the tedious work of moments.

Also .. vi are all unix-like editor ... no additional installation
The different systems you can quickly access the situation.

1. An Introduction

If you have not used before the full screen editor, you may even have a problem with some simple editing.
So you may have a little understanding to find a vi user, who is to guide you.

vi is a screen editor, which means that vi is almost used up the screen
Each line of space to display the contents of the file, except the last line of the screen.
This line is used to allow you to send commands to the vi and vi number to give you some relevant file information purposes.

You must understand that the other is a mode of vi-type editor. For example:
You can enter text or execute commands, but you must be able to implement the correct mode.

You are a first edit a file, you are in command mode (command mode).
Some commands allow you to switch to input mode (input mode).
However, only a key input mode allows you to leave, that is left of key keyboard
If you do not know what mode you're currently in, you can continue to press until the vi sound warning you,
So you have returned to command mode. When you try to do some things not allowed vi,
Normally vi will issue a "beep" (local operation)

2. Easy to operate
To start editing a file you can do:
$ Vi file_name

Then enter: set verbose mode
Then vi will remind you:
: Set the mode option may never be turn on

Note: Although this is more for beginners but better than no message alert
After leaving vi assured it will revert to the original noverbose mode

This will allow the vi when you give you an error message more and when you put excessive pressure on key
, The bottom of the screen will display the following message, reminding you to have the command mode.
Already in comman mode

Note: Command are required to implement the command mode.

鈻?Mobile Command Summary
h move the cursor left one character.

j Move the cursor down a line.

k Move the cursor up a line.

l Move the cursor to right one character.

arrow keys should be able to play a role.

Note: If just use Windows built-telent can not use the arrow keys ..
So that the usefulness of nice, too .. hjkl

鈻?Simple search commands
/ Text search for text strings
If today I want to search for panda is / panda, / for the search command.

鈻?mode switching

a new beginning in the cursor can be added after

i can begin to add the text before cursor

o add a line below the cursor, and can start entering text.

O in the cursor above the new line, and can start entering text.

You today with a, i, o, O into the input mode, you can use key back to command mode.

Note: The personal use only remember a few found that mode switching is like the normal input habits
Recommended for beginners to remember a, O like (although in the end you will unconsciously all of them)
O O seems not particularly easy to use, but today if you want to add a line at the top when
This command is really easy recall O Ah ..

鈻?word processing commands
yy Copy the line the cursor.
p next row where the cursor paste the copied information.

dd delete the line the cursor.
x will delete the character that the cursor is located.

Storage file:
: W save the file to the original file name.
: W file_name Save, a file called file_name

: Q from editing and vi, if you have edited your file vi will refuse to leave.
: Q! Forced to leave regardless of the circumstances vi

Note: There may be a so-called line of many lines on the screen (because the screen display a line no less than)
As long as there is no line break would produce a line call, you will understand with the cursor.

4. Summary
These are just based on the vi function, familiar with these, you will have a simple word processing,
Have to gradually get rid of an editor like pico, vi toward the embrace.
After a while, when you gradually learn the powerful vi, 銊?銊?...


BUSINESS is business had to kind


Video Formats

Hong Kong PCCW Privatization Commission will vote by sealed-depth inquiry

Quicktime mkv

Photoshop beauty oily skin making ideas

Do not heat to high speed FULLY Raiders Summer Thunder

GEM Made The Most Rich Of 10

Windows media player vob

Good Text Or Document Editors

Best Astronomy

IPS DETECTION and prevention simultaneously

New Communications Tools

SCO, Sybase, SCO, Sybase,

No comments:

Post a Comment