1. Install the UBUNTU14, enter the desktop, ctrl+alt+t into the terminal.
To get root privileges:
$sudo passwd Root
Enter password
(Note: The input does not appear as it does under Windows, although the input is OK.) Check whether the NumLock light is on or off, press, and digital input)
Set Password
Confirm Password
Updated successfully?
$su//Get root permission to display "[Email protected]:home/mrwang#"? Note that this is the last # number.
or $su root.
or Su-root pay attention to the difference oh.
2. Installation Configuration VI
$sudo apt-get Remove Vim-common//Remove the tiny version of the default installation first to remove it?
My reason is: when entering VI editing, keyboard some key functions
Not fit.
$sudo apt-get Install VIM//installation vim? Installation Complete
$?sudo VIM/ETC/VIM/VIMRC//Open VI directory configuration file, press "I" to enter the edit mode,
Pull down to the bottom, in the bottom 3 line probably, can't remember clearly.
There are many rows of "set". Enter the following simple few.
More rich configuration, online search it, Daniel many.
Set nu//The line number is displayed on the left and the set does not add "number" and is a separate line.
Set tabstop=4//tab length to 4
Set nobackup//Overwrite files without backup
Set Cursorline//Highlight when forward
Set ruler//display status line at cursor position in lower right corner
Set autoindent//Auto Indent
Set Smartindent
When you are finished, press "ESC" and then "shift+:?" Input Wq, enter save exit, this vim configuration is complete.
Find an example to try the effect:
$CD/home/mrwang/lianxi//Enter the Lianxi directory?
$vim lianxi_1.c//Create a. c file into the VIM environment
Press "I" to enter edit mode, you can write code.
#include "stdio.h"
void Man ()
{
int i=0;
i=i+1;
? printf ("%d\n", I);
printf ("Test play \ n");
}?
After writing the code, press "ESC", "shift+:", Wq, enter
$GCC-O lianxi_1 lainxi-1.c//edit, compile C file
$./lianxi_1? Run the. out file in the current directory
This completes the test. You see the effect of configuring VI in the process of writing your code
At the same time familiar with the basic operation of Gcc,vi. As for Gcc,vi Many instructions on the Internet to find, slowly practice.
Linux Learning one: Install/configure VI, familiar with GCC/VI