Configure Vi syntax display in Ubuntu

Source: Internet
Author: User
Method 1: Modify the Vi/etc/vim/vimrc file in Ubuntu. Method 2: add the touch. vimrc file in the user directory. The content is as follows: setsyntax = on "highlighted syntax setfenc = UTF-8" sets default decoding setfencs = UTF-8, usc-bom, euc-jp, gb18030, gdk, gb2312, cp93

Configure Vi syntax display in Ubuntu

Method 1: Modify the vi/etc/vim/vimrc file.

Method 2: add the touch. vimrc file in the user directory.

The content is as follows:

Set syntax = on "highlight syntax
Set fenc = UTF-8 "set Default Decoding
Set fencs = UTF-8, usc-bom, euc-jp, gb18030, gdk, gb2312, cp936
Set nocp "or set nocompatible is used to disable the compatibility mode of VI.
Set number "display row number
Set ai "or set autoindent vim uses automatic alignment to apply the alignment format of the current row to the next row.
Set si "or set smartindent intelligently selects Alignment Based on the alignment format above
Set tabstop = 4 "set the tab key to 4 spaces
Set sw = 4 "or set shiftwidth sets four spaces when the rows are staggered
Set rcursor "sets the status line at the cursor position in the lower right corner during editing.
Set incsearch "to set incremental search. This query is smart.
Set showmatch "highlight matching parentheses
Set matchtime = 5 "matching bracket highlighting time (unit: 1/10 s)
Set ignorecase "Case Insensitive during search

Another problem is that the highlighted syntax is not supported by vi and is supported by the new vim. Therefore, you cannot download and install vim as follows:

Sudo apt-get install vim

Recommended reading:

Vim Learning Guide http://www.linuxidc.com/Linux/2013-08/89096.htm

Quick learn Vi editor http://www.linuxidc.com/Linux/2013-08/88586.htm

Powerful Vim editor http://www.linuxidc.com/Linux/2013-07/87544.htm

Build a Vim Development Environment http://www.linuxidc.com/Linux/2013-07/87363.htm on CentOS 6.2

Vim 7.4a release, new and faster http://www.linuxidc.com/Linux/2013-07/87035.htm for regular expression Engines

CentOS 5.4 installation highlighted Vim editing tool http://www.linuxidc.com/Linux/2013-06/86508.htm

Vim tips: C language http://www.linuxidc.com/Linux/2012-12/77124.htm settings

Set Vim row http://www.linuxidc.com/Linux/2012-12/75485.htm in Ubuntu

Vim editor use basic tutorial http://www.linuxidc.com/Linux/2013-05/84031.htm

For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2

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.