Ubuntu installation Vim

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.