This is an imported old blog, may have a timeliness problem.
1. Install Homebrew (Package Manager, used to install vim)
& /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
2.安装Vim(系统自带的Vim不是最新版)
& brew install wget
3.建立并编辑配置文件 (不使用任何插件情况下一些有用的配置)
& CD ~
& Touch. VIMRC
& Vim. VIMRC
Edit the configuration file as:
Input: Make compiles and runs the set makeprg=clear;gcc\%\ &&\./a.out
"Current row highlighted au Winleave * set nocursorline nocursorcolumnau winenter * Set Cursorlineset cursorline
ColorScheme Default Color theme
Syntax enable parse shading set tabstop=4 set tab space Number set softtabstop=4 "Set Input TA Number of spaces represented by B set expandtab "tab as several spaces
Set backspace=2 "Setting backspace key available Set number" displays line numbers
Set ShowCmd "show full command set Hlsearch" in the lower right corner to highlight all results when searching for strings: Nohlsearch Suppress highlighting
4. Install Vundle (Vim plugin manager)
& Git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/vundle.vim
& Vim. VIMRC
Add the following configuration at the beginning of the configuration file:
"---START of vundle---set Nocompatiblefiletype off set Rtp+=~/.vim/bundle/vundle.vimcall vundle#begin () Plugin ' Vundlevim/vundle.vim ' "Plugins start" Plugins endcall vundle#end () filetype plugin indent on "---end of vundle---
5. General process for installing plug-ins with Vundle
Find the plugin on GitHub and write down the name.
& Vim. VIMRC
In the configuration file "Plugins Start and End comments, add:
Plugin ' [plugin name] '
: Wq
& Vim. VIMRC
:P Lugininstall
The commands to clear plugins not in this list are:
:P Luginclean
6. Install the color theme with Vundle Molokai
In the configuration file, add:
Plugin ' Tomasr/molokai '
and installation (see 5th).
ColorScheme the default line in the configuration file to read:
ColorScheme Molokai
7. Install the Youcompleteme plugin with vundle (for C + +)
& Xcode-select--install
& Brew Python
& Pip Install Future
& Brew CMake
In the configuration file, add:
Plugin ' Valloric/youcompleteme '
and installation (see 5th).
& CD ~/.vim/bundle/youcompleteme
&./install.py--clang-completer
In the configuration file---END of vundle---note, add:
Let g:ycm_global_ycm_extra_conf = ' ~/.vim/bundle/youcompleteme/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py '
Mac configuration vim from zero