The process of upgrading vim under MAC and configuring Vim Yourself

Source: Internet
Author: User
Tags set background



1. Upgrade Vim



My own MacBook Pro system is still 10.11, with its own vim version of 7.3, which we upgraded to the latest version:



Using homebrew:


Install vim--with-lua--with-override-system-vim


This will download the latest VIM version and replace the Vim that comes with the system.



Restart the terminal after installation, update the environment variables, and enter VIM after the VIM version is the latest version.



If you want to update the Vim version later, the direct input to brew upgrade Vim can be upgraded quickly.



Want to add Python3 support, the above command based on the addition of-with-python3.






2. Configure your own. vimrc file



Vim's configuration file in the root directory of the. vimrc file, if not, create one yourself.



Open the. vimrc file, enter the configuration, and my configuration is as follows:


"Show line number
set nu

"Hide assistance hint at startup
set shortmess = atI

"Syntax highlighting
syntax on

"Use vim's keyboard mode
set nocompatible

"No backup required
set nobackup

"Confirmation pops up when not saved or read-only
set confirm

"Mouse available
set mouse = a

"tab indent
set tabstop = 4
set shiftwidth = 4
set expandtab
set smarttab

"File Automatically Detect External Changes
set autoread

"c file indent automatically
set cindent

"Automatic alignment
set autoindent

"Smart Indent
set smartindent

"Highlight Find Match
set hlsearch

"Show matches
set showmatch

"Show the ruler, which is the cursor position in the lower right corner
set ruler

"Remove vi consistency
set nocompatible

"Set keyboard mapping, set folds with spaces
nnoremap <space> @ = ((foldclosed (line (‘.‘) <0)? ’zc‘: ‘zo’)) <CR>
"" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "
"Don't blink
set novisualbell

"Start showing status line
set laststatus = 2

"Light color shows the current line
autocmd InsertLeave * se nocul

"Highlight the current line with a light color
autocmd InsertEnter * se cul

"Show entered commands
set showcmd

"Blank between split windows
set fillchars = vert: /
set fillchars = stl: /
set fillchars = stlnc: /

"vundle environment settings
filetype off
set rtp + = ~ / .vim / bundle / Vundle.vim
"The list of plugins managed by vundle must be between vundle # begin () and vundle # end ()
call vundle # begin ()
Plugin ‘VundleVim / Vundle.vim’
Plugin ‘altercation / vim-colors-solarized’
Plugin ‘tomasr / molokai’
Plugin ‘vim-scripts / phd’
Plugin ‘Lokaltog / vim-powerline’
Plugin ‘octol / vim-cpp-enhanced-highlight’
Plugin ‘Raimondi / delimitMate’
"End of plugin list
call vundle # end ()
filetype plugin indent on

" coloring scheme
set background = dark
colorscheme solarized
"colorscheme molokai
"colorscheme phd

"Suppress menus and toolbars
set guioptions- = m
set guioptions- = T

"Always show status bar
set laststatus = 2

"Prohibition
set nowrap

"Set the status bar theme
let g: Powerline_colorscheme = ‘solarized256’

syntax keyword cppSTLtype initializer_list

"Code folding based on indentation or syntax
"set foldmethod = indent
set foldmethod = syntax
"Close folding code when starting vim
set nofoldenable

"Allow deleting characters with backspace
set backspace = indent, eol, start

"Encoding settings
set encoding = utf-8

"Share Clipboard
set clipboard = unnamed 





The VIM plugin uses Vundle management:



Install Vundle:


git clone https://github.com/vundlevim/vundle.vim.git ~/.vim/bundle/vundle.vim


As shown in my profile, Plugin ' plugin address ' is the add plugin, such as:


' Dyng/ctrlsf.vim '


Install the plugin, first find its address in github.com, and then add the configuration information to it. VIMRC in the call Vundle#begin () and call Vundle#end (), and finally into vim execution:


:P Lugininstall


Install the completed plugin.



To remove a plugin, simplyPlugin ‘插件地址‘ 删除或者注释掉,再进入 vim 执行:


:P Luginclean


Remove the plugin.



To upgrade the plugin, go to vim execution:


:P luginupdate


To complete the upgrade.






The process of upgrading vim under MAC and configuring Vim Yourself


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.