MAC 安装vim并配置

brew

brew install vim
   Kom:~ ren$ brew list vim
/usr/local/Cellar/vim/8.1.0600/bin/ex
/usr/local/Cellar/vim/8.1.0600/bin/rview
/usr/local/Cellar/vim/8.1.0600/bin/rvim
/usr/local/Cellar/vim/8.1.0600/bin/vi
/usr/local/Cellar/vim/8.1.0600/bin/view
/usr/local/Cellar/vim/8.1.0600/bin/vim
/usr/local/Cellar/vim/8.1.0600/bin/vimdiff
/usr/local/Cellar/vim/8.1.0600/bin/vimtutor
/usr/local/Cellar/vim/8.1.0600/bin/xxd
/usr/local/Cellar/vim/8.1.0600/share/man/ (153 files)
/usr/local/Cellar/vim/8.1.0600/share/vim/ (1673 files)
cd /usr/local/Cellar/vim/8.1.0600/share/vim/vim81/
cat vimrc_example.vim >> ~/.vimrc

添加配置内容 vim ~/.vimrc

set fenc=utf-8
set fencs=utf-8,usc-bom,euc-jp,gb18030,gbk,gb2312,cp936
set nocompatible

syntax on
set wrap
set number
set laststatus=2

set mouse=a
set completeopt=longest,menu 
set autoindent
set smartindent
set tabstop=4
set softtabstop=4
set shiftwidth=4
autocmd FileType c,cpp,python set shiftwidth=4 | set expandtab

set incsearch
set clipboard=unnamed

if version >= 603
    set helplang=cn
    set encoding=utf-8
endif

以下是共享 剪贴板
set clipboard=unnamed

你可能感兴趣的:(linux)