vimplus

:rocket:An automatic configuration program for vim

2 years after

此处输入图片的描述 An automatic configuration program for vim

Intro

I usually use vim to write a C++ program, so in order to allow me to write C++ more enjoyable, I made some vim automatically configured, the following I will be a presentation of my vimplus.

Screenshots

This figure is below a real shot after I configured vim. enter image description here

Installation

Ubuntu x64 Installation(Supported Ubuntu 16.04 LTS)

git clone https://github.com/chxuan/vimplus.git
cd ./vimplus
sudo ./install.sh

Run the install.sh script will automatically install and configure vim, installation takes about 40 minutes, mainly download compiler Valloric/YouCompleteMe time-consuming, please wait until the installation is complete :smile:,if the installation fails, please see Warning.

The installation script will automatically install some software below:

  • vim
  • g++
  • ctags
  • cmake
  • python2
  • python3

and some plugins below:

Centos x64 Installation

git clone https://github.com/chxuan/vimplus.git
cd ./vimplus
sudo ./install.sh

Run the install.sh script will automatically install and configure vim, installation takes about 40 minutes, mainly download compiler Valloric/YouCompleteMe time-consuming, please wait until the installation is complete :smile:,if the installation fails, please see Warning.

The installation script will automatically install some software below:

  • vim
  • g++
  • ctags
  • cmake
  • python2
  • python3

and some plugins below:

Configuration ycm

Run the install.sh script after the installation is complete, HOME directory will exist .ycm_extra_conf.py and .vimrc, the file is YCM implement C++ and other languages syntax completion function profile, I would put a general in the HOME directory, then copy each project a .ycm_extra_conf.py,don't just copy/paste that file somewhere and expect things to magically work; your project needs different flags. Hint: just replace the strings in the flags variable with compilation flags necessary for your project. That should be enough for 99% of projects.

Note

  1. In order to use vim-devicons, you have to set font, if you don't have guifont set and are not running gvim you will need to set the terminal font(you have to set this font:Droid Sans Mono for Powerline Nerd Font Complete).

Shortcuts

  • Directory tree <F3>
  • Display functions, global variables, macro definitions <F4>
  • Display static code analysis <F5>
  • .h .cpp file quickly switch <F2>
  • Go to declaration <, + u>
  • Go to definition <, + i>
  • Open the include file <, + o>
  • Buffer switch <Ctrl + P/Ctrl + N>
  • Cursor position switch <Ctrl + O/Ctrl + I>
  • Fuzzy Find File <Ctrl + f>
  • Surround <ys{motion or text-object}{char}/cs{orig_char}{dest_char}/ds{char}>
  • Comment code <gcc/gcap/gc/,ca/,cA>
  • DirDiff :DirDiff <dir1> <dir2>
  • Repeat .
  • Change the colorscheme <F10/F9>

Features

Syntax completion

YouCompleteMe plugin provides syntax completion function, and YouCompleteMe is a fast, as-you-type, fuzzy-search code completion engine for Vim. 此处输入图片的描述

Full path fuzzy file, buffer, mru, tag

ctrlp plugin provides full path fuzzy file, buffer, mru, tag, ... finder for Vim. 此处输入图片的描述

vim-airline

Lean & mean status/tabline for vim that's light as air. 此处输入图片的描述

vim-surround

Surround a vim text object with a pair of symmetrical chars. We can also remove or change the ones already there. 此处输入图片的描述

vim-commentary

An extremely easy tool to toggle commentary in lines and visual selections. We only need to enter a mapping and a movement to do the action, as simple as that. 此处输入图片的描述

auto-pairs

auto-pairs provides smart auto-completion for delimiters like (), {}, [], "", '', ``. 此处输入图片的描述

incsearch.vim

此处输入图片的描述

vim-devicons

此处输入图片的描述 此处输入图片的描述 此处输入图片的描述

vim-coloresque

此处输入图片的描述

vim-dirdiff

此处输入图片的描述

vim-startify

此处输入图片的描述

Change the colorscheme

change-colorscheme plugin provides quick change theme function. 此处输入图片的描述

Warning


  1. If poor network conditions may fail to install, basically Valloric/YouCompleteMe installation fails, after a failed installation will need to rm -rf ~/.vim/bundle/YouCompleteMe, and then re-execute the install.sh can be re-installed, the program will automatically install the plug-in installation fails,or I have YouCompleteMe.tar.gz,download it and then tar -xvf YouCompleteMe.tar.gz -C ~/.vim/bundle/,then cd ~/.vim/bundle/YouCompleteMe and run python ./install.py --clang-completer.