Vim in Mac OS X turns on color matching and git completion

Source: Internet
Author: User
Tags git commands

Problem Origin: Git under Mac can't complete command, color scheme is imperfect

Mac OS Yosemite 10.10.3

git version 2.3.2 (Apple Git-55)

Processing results: Git commands can be complete, the color scheme is still not perfect, but the vim color can be

Steps to enter:

1. Vim Syntax highlighting

Enter the. vimrc file in the user's home directory, and if not, create a

$ VI ~/.VIMRC

Add a row

Syntax on

Save exit, OK syntax highlighting get√

(Before using Vi/vim to open a similar. py file, there is no syntax highlighting, and the Linux vim is there, maybe OS X vim by default highlighting off)

2.git [Tab] Completion

2.1 First Install Bash-completion

$ Brew Install Bash-completion

After the installation is complete there will be a

If [-F $ (brew--prefix)/etc/bash_completion]; Then        . $ (Brew--prefix)/ETC/BASH_COMPLETIONFI

Add this segment to ~/.bash_profile (if not, create a new one)

2.2 Found Git-completion

$ git clone https://github.com/git/git.git

CD to the "contrib/completion/" directory, the Git-completion.bash Copy to the user home directory and rename the. Git-completioin.bash (hidden)

CP Git-compeltion.bash ~/.git-completion.bash

2.3 Open ~/.bash_profile Again, add a row

$ source ~/.git-completion.bash

Note: The reference and many of the tips are in the file ~/.BASHRC (if not a new one) added in this line, tried invalid, Linux inside is. BASHRC and Mac is. Bash_profile

Save exit, OK Git[tab] Complete get√

ref1:http://elf8848.iteye.com/blog/1582137

ref2:http://www.xiaomeiti.com/note/3613

Vim in Mac OS X turns on color matching and git completion

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.