Syntax highlighting for go in vim

Source: Internet
Author: User

Test environment: Ubuntu 14.04 version Kylin


Vim itself does not have golang syntax highlighting


Solution:


In the/usr/share/vim/vim74/



There are so few folders: syntax, Ftplugin, indent, compiler, etc.,


We see syntax can see there are gcc.vim and other grammar files, but no go.vim, fortunately we can download from the source code


Http://www.golangtc.com/download Download go1.3.3.src.tar.gzgo1.3.3 (source only), unzip,

Copy the syntax, Ftplugin, indent, compiler files in the go/misc/vim/of the download directory to the go.vim corresponding directory, The Ftdetect folder includes files that are copied to Vim74 .


Additional settings are as follows:

$/usr/share/vim$ Vim VIMRC

Syntax on
22
Set number "Displays line numbers
Set Cursorline "highlight when moving forward
Set tabstop=4 "Tab key width
26
27 "Unified Indent is 4
Softtabstop=4 Set
Set shiftwidth=4


Complete.




Syntax highlighting for go in 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.