一、插件集

本次安装的插件集共有16种,这些插件足以调出IDE的界面。慢慢摸索吧!

Plugin 'VundleVim/Vundle.vim'
Plugin 'altercation/vim-colors-solarized'
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'scrooloose/nerdtree'
Plugin 'jistr/vim-nerdtree-tabs'
Plugin 'scrooloose/syntastic'
Plugin 'tpope/vim-dispatch'
Plugin 'szw/vim-tags'
Plugin 'majutsushi/tagbar'
Plugin 'ctrlpvim/ctrlp.vim'
Plugin 'Shougo/neocomplete.vim'
Plugin 'airblade/vim-gitgutter'
Plugin 'tpope/vim-fugitive'
Plugin 'Raimondi/delimitMate'
Plugin 'ntpeters/vim-better-whitespace'

二、安装插件管理器

和在sublime text中安装插件前要安装package control插件管理器一样,要在vim中安装插件也要安装相应的插件管理器(当然不安装插件管理器也行,只是每次要安装插件时都要自己手动下载并配置,并且插件更新,删除也很麻烦,所以还是要借助插件管理器),本文中介绍的vim插件管理器为Vundle.vim。

Vundle.vim插件管理器工程托管在github上,链接为:
https://github.com/VundleVim/Vundle.vim
所以安装起来很方便,只要在终端下运行如下git命令即可:
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim

三、修改.vimrc文件

该文件配置示意如下,不可复制(有些内容被markdown编辑器转义),该文件可在本人资源页中下载。

” File: .vimrc
” Source: http://blog.jez.io/2015/03/03/vim-as-an-ide/
” Author: Jake Zimmerman jake@zimmerman.io
” Modifier: Yan Facai yarc18@gmail.com

” How I configure Vim :P

” Gotta be first
set nocompatible

filetype off

set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()

“” 插件管理
Plugin ‘VundleVim/Vundle.vim’

” —– Making Vim look good ——————————————
“” 色彩方案
Plugin ‘altercation/vim-colors-solarized’

“” 状态栏
Plugin ‘vim-airline/vim-airline’
Plugin ‘vim-airline/vim-airline-themes’

” —– Vim as a programmer’s text editor —————————–
“” 路径目录
Plugin ‘scrooloose/nerdtree’
“”” making NERDTree feel like a true panel, independent of tabs.
Plugin ‘jistr/vim-nerdtree-tabs’

“” 语法检查
Plugin ‘scrooloose/syntastic’

“” 异步编译
Plugin ‘tpope/vim-dispatch’

“” 标签
“”” 自动生成标签
Plugin ‘szw/vim-tags’
“”” 标签侧栏
Plugin ‘majutsushi/tagbar’

“” 模糊文件检索
Plugin ‘ctrlpvim/ctrlp.vim’

“” 自动补全
Plugin ‘Shougo/neocomplete.vim’

” —– Working with Git ———————————————-
“” 显示变动行
Plugin ‘airblade/vim-gitgutter’
“” 绑定git命令
Plugin ‘tpope/vim-fugitive’

” —– Other text editing features ———————————–
“” 配对符号补全
Plugin ‘Raimondi/delimitMate’

” Highlight and strip trailing whitespace
Plugin ‘ntpeters/vim-better-whitespace’

” Latex
“Plugin ‘VOoM’

call vundle#end()

filetype plugin indent on
syntax on

set textwidth=79 ” Maximum width of text that is being inserted. A longer
” line will be broken after white space to get this width.

“set formatoptions=tcqmM ” line break can follow an Asian Char and DO NOT insert space before
” or after an Asian Char

“vimdiff auto wrap long line
“autocmd FilterWritePre * if &diff | setlocal wrap< | endif
au VimEnter * if &diff | execute ‘windo set wrap linebreak nolist’ | endif

” — General settings —
set tabstop=4
set shiftwidth=4 ” numbers of spaces to (auto)indent
set softtabstop=4 ” backspace del 4 charac
set backspace=2 ” make backspace could del line breaks, indentation and so on
” make “tab” insert indents instead of tabs at the beginning of a line
set smarttab

” always uses spaces instead of tab characters
set expandtab

set scrolloff=3
set history=500
set showcmd
set ruler
set encoding=utf-8
set fileencodings=utf-8,gb2312,gbk,gb18030,iso-2022-jp,euc-jp,cp932,ucs-bom
set ffs=unix,dos

set hlsearch
set incsearch
set showmatch ” match when indicator is over them

set autoindent

set autoread

set number

set title ” change the terminal’s title

set visualbell ” don’t beep
set noerrorbells ” don’t beep

” Disable swap file
set nobackup
set noswapfile

“Custom key binding
” change the mapleader from \ to ,
let mapleader=”,”

” Toggle paste mode on and off
set pastetoggle=p

” Clear highlight text
nmap h :nohlsearch

” Reload vimrc
“nmap r :source ~/.vimrc

” move by rows, not linenumber
nnoremap j gj
nnoremap k gk

” Command + c, copy to system clipboard
vmap “+yi

” —– Plugin-Specific Settings ————————————–

” —– altercation/vim-colors-solarized settings —–
set t_Co=256 ” 256 color support
” use solarized color scheme
set background=dark
colorscheme solarized

” —– bling/vim-airline settings —–
” Always show statusbar
set laststatus=2

” Fancy arrow symbols, requires a patched font
” To install a patched font, run over to
” https://github.com/abertsch/Menlo-for-Powerline
” download all the .ttf files, double-click on them and click “Install”
” Finally, uncomment the next line
let g:airline_powerline_fonts = 0

” Show PASTE if in paste mode
let g:airline_detect_paste=1

” Show airline for tabs too
“let g:airline#extensions#tabline#enabled = 1

” —– jistr/vim-nerdtree-tabs —–
” Open/close NERDTree Tabs
map n NERDTreeTabsToggle
” NERDTree close on startup
let g:nerdtree_tabs_open_on_console_startup = 0

” —– scrooloose/syntastic settings —–
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*

let g:syntastic_always_populate_loc_list = 1
let g:syntastic_loc_list_height = 5
let g:syntastic_auto_loc_list = 1
“let g:syntastic_auto_jump = 3

let g:syntastic_check_on_open = 0
let g:syntastic_check_on_wq = 0

” —– tpope/vim-dispatch settings —–
” Compiler

” —– szw/vim-tags settings —–
let g:vim_tags_use_vim_dispatch = 1

” —– majutsushi/tagbar settings —–
” Open/close tagbar with \b
nmap b :TagbarToggle
” Uncomment to open tagbar automatically whenever possible
“autocmd BufEnter * nested :call tagbar#autoopen(0)

” ctrlp settings
let g:ctrlp_map = ‘’
let g:ctrlp_cmd = ‘CtrlP’
let g:ctrlp_working_path_mode = ‘ra’
let g:ctrlp_root_markers = [‘pom.xml’, ‘.p4ignore’]

” eclim
let g:EclimCompletionMethod = ‘omnifunc’

” neocomplete setting
” Disable AutoComplPop.
let g:acp_enableAtStartup = 0
” Enable at startup
let g:neocomplete#enable_at_startup = 1
” Use smartcase.
let g:neocomplete#enable_smart_case = 1
” Minimum syntax keyword length
let g:neocomplete#sources#syntax#min_keyword_length = 3
let g:neocomplete#lock_buffer_name_pattern = ‘*ku*’

“” use eclim as backend
if !exists(‘g:neocomplete#sources#omni#input_patterns’)
let g:neocomplete#sources#omni#input_patterns = {}
endif
let g:neocomplete#sources#omni#input_patterns.java = ‘\k.\k*’

” 自动关闭预览
let g:neocomplete#enable_auto_close_preview = 1

” —– airblade/vim-gitgutter settings —–
” Required after having changed the colorscheme
“hi clear SignColumn
” In vim-airline, only display “hunks” if the diff is non-zero
let g:airline#extensions#hunks#non_zero_only = 1

” vim-fugitive

” —– Raimondi/delimitMate settings —–
let delimitMate_expand_cr = 1
augroup mydelimitMate
au!
au FileType markdown let b:delimitMate_nesting_quotes = [“"]
au FileType tex let b:delimitMate_quotes = ""
au FileType tex let b:delimitMate_matchpairs = "(:),[:],{:},
:’”
au FileType python let b:delimitMate_nesting_quotes = [‘”’, “’”]
augroup END

” VOoM
“nmap l :Voom latex

” vim-better-whitespace
” strip all trailing whitespace everytime you save the file for all file types.
“autocmd BufWritePre * StripWhitespace

四、安装前的最后准备:检查vim lua

本次安装的很多插件都需要lua的支持,检查vim是否支持lua有两种方式:

  1. 在vim命令模式下执行命令echo has("lua"),如果返回值为1则说明vim已经支持了lua。
  2. 在终端下执行如下命令:
    vim --version | grep "lua"
    如果返回如下结果则说明vim已经支持了lua:
    +dialog_con +lua +rightleft +windows
    Linking: clang -L. -L/usr/local/lib -L/usr/local/lib -o vim -lm -lncurses -liconv -framework Cocoa -L/usr/local/lib -llua -fstack-protector -L/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE -lperl -framework Python -lruby.2.0.0 -lobjc

如果vim中没有支持lua,需要重新安装vim,运行如下命令即可:
brew update
brew install vim --with-lua

五、利用插件管理器安装插件

在终端下执行如下命令即可:
vim +PluginInstall +qall

mac vim IDE插件安装相关推荐

  1. vim常用插件安装及使用

    vim常用插件安装及使用 vim常用插件安装 一. Vim8内置插件管理方案 二.vim插件推荐及安装 2.1 NERDTree插件安装及使用 2.1.1 下载NERDTree插件 2.1.2 NER ...

  2. mac下chrome插件安装位置

    所有的chrome插件都是安装在资源管理库(library)里面的,如果你的记性够好,请记住MAC下插件的安装位置: ~/Library/Application Support/Google/Chro ...

  3. mac上chrome插件安装

    mac上chrome浏览器默认隐藏了拖拽安装插件功能 chrome://flags/#extensions-on-chrome-urls只需打开该设置将Disabled改为Enabled,即可拖入.c ...

  4. mac版idea插件安装位置

    /Users/xxxx/Library/ApplicationSupport/JetBrains/IntelliJIdea2020.3/plugins xxx 替换为自己的用户名

  5. 完美解决Mac系统下Chrome插件安装时程序包无效:CRX_HEADER_INVALID

    Mac下Chrome插件安装方法--亲测有效 下载好插件crx文件后,不要直接拖拽到扩展页面进行添加 先把插件crx文件的后缀改成zip,再拖入到chrome浏览器的扩展应用中,这时就可以添加成功了 ...

  6. Mac下安装vim的插件YouCompleteMe及注意事项

    mac下的YouCompleteMe安装还是很麻烦的,所以我安装完之后写下此篇blog,以供诸位一起学习 此篇借鉴了网上一些文章的情况下结合了我自己的一点心得: 1.基本准备(我默认已经安装好了以下软 ...

  7. mac vim 安装 YouCompleteMe 插件自动补全

    前言 笔者常用vim进行c/c++/go开发,虽说vim也有自带自动补全(control+n,control+p),不过操作上还是比较麻烦,笔者希望可以实现,输入部分单词可以直接弹出下拉框提示所有可能 ...

  8. MAC下 Intellij IDEA GO语言插件安装及简单案例

    MAC下 Intellij IDEA GO语言插件安装及简单案例 GoLang专有IDE GoLand : http://www.jetbrains.com/go/ 下载地址 Intellij IDE ...

  9. linux系统中VIM编辑器推荐安装插件

    k-vim VERSION: 9.0 LAST_UPDATE_TIME: 2015-05-02 作者 wklken (凌岳/pythoner/vim党预备党员) Email: wklken@yeah. ...

最新文章

  1. Django使用心得(二)
  2. Java多层翻页网络爬虫实战(以搜房网为例)
  3. LeetCode 3 Longest Substring Without Repeating Characters 区间,想法 难度:1
  4. 训练集、测试集loss容易出现的问题总结
  5. 375. 猜数字大小 II leetcode java
  6. 微PE系统盘制作 / 重装系统
  7. 计算机键盘上的每一个按键编码,键盘按键修理
  8. IDM移动端功能升级说明
  9. 【机器学习基石】机器学习的种类(三)
  10. 关于P2P资金托管的知识
  11. 后台管理系统色系搭配推荐
  12. 华为服务器安全系统,服务器安全增强系统
  13. 2023 年最佳游戏引擎推荐
  14. 对研究生教育有什么看法_我对研究员特征的看法
  15. 第三方支付-核心交易系统设计
  16. 百度地图网站获取指定地点经纬度坐标方法
  17. 计算机毕业设计 机器视觉智能快递分拣系统
  18. 【Java】中国大陆开源镜像站汇总
  19. 毕业生求职网用例说明文档
  20. 谷歌Chrome App将于2022年6月停用,向PWA应用转型

热门文章

  1. 置换贴图(Displacement map),凹凸贴图(Bump map)与法线贴图(Normal map)的区别
  2. 链表排序算法(Java实现)
  3. conceptd什么时候上市_iPhone12什么时候上市?iPhone12售价多少?
  4. SQL关键字模糊查询
  5. 怎样才能画好漫画人物眼睛里的阴影?
  6. 国产手机参与华为鸿蒙系统,华为鸿蒙OS系统再获力挺!又一国产手机巨头官宣:将联动华为?...
  7. “想象之中”,【玉石雕刻刀】的神奇之处
  8. “拨”出数位上的数字 - 多种思路实现反向输出一个四位数
  9. android ZLib压缩/解压缩
  10. jquery ajax报Uncaught TypeError :Illegal invocation