Problem:
Ubuntu does not have Vim installed by default and appears:
[email protected]: ~$ vim test.c
The program ' Vim ' can is found in the following packages:
* VIM
* Vim-gnome
* Vim-tiny
* Vim-athena
* VIM-GTK
* Vim-nox
Try:sudo apt-get Install <selected package>
Solve:
Command line input: sudo apt-get install vim then installs, when confirmation occurs, enter Y to confirm the line
Configuration: If you want to be more powerful, please go to http://www.cnblogs.com/ma6174/archive/2011/12/10/2283393.html
The version of Vim used in ubuntu12.04 does not support configurations such as syntax highlighting and file type detection
#sudo Apt-get Install Vim
Vim's default configuration is not satisfactory and requires its own configuration.
The default configuration file is:/ETC/VIM/VIMRC
We can set up our own configuration file in the home directory
Switch home directory #cd ~
Touch a file named. VIMRC (starting with a. Hide file)
#vi. VIMRC
Enter the following configuration:
Set nocompatible does not use the VI default keyboard layout
Setnumber Display Line numbers
Set autoindent Auto Align
Set SmartindentSmartSnap To
Set Showmatch bracket matching pattern
Setruler Display Status lines
Set Incsearch query is very convenient, such as to find the book word, when input to/b, will automatically find the first B word, when input to/bo, will automatically find the first Bo start Word, and so on, when you find, use this setting will quickly find the answer, when you find to When matching words, don't forget to enter.
Set tabstop=4 Tab key is 4 spaces
Set shiftwidth=4 4 spaces between rows when swapping rows
Set softtabstop=4 setting (Soft) tab width is 4
Set CindentClanguageFormat alignment
Set Nobackup do not back up files
Set clipboard+=unnamed shared clipboard with Windows
Ubuntu installation Vim