项目作者: kingofctrl

项目描述 :
:four_leaf_clover: Building vim editor in Linux into an effective C/C++ programming IDE, YouCompleteMe supported
高级语言: Vim script
项目地址: git://github.com/kingofctrl/vim.cpp.git
创建时间: 2016-09-14T09:59:40Z
项目社区:https://github.com/kingofctrl/vim.cpp

开源协议:MIT License

下载


C/C++ IDE

Introduction

Building vim editor in Linux into an effective C/C++ programming IDE, supporting YouCompleteMe as a code-completion engine.

Features

  • Automatic download the latest version of libclang and compile the ycm_core library that YCM needs
  • One-step install
  • Supported all GNU/Linux
  • On-demand loading for faster startup time
  • Semantic auto-completion
  • Syntax checking
  • Syntax highlighting for C++11/14
  • Preservation of historical records
  • Instantly preview markdown files
  • More

Requirements

  • vim 7.4.143+ with Python 2 or Python 3 support
  • npm -g install instant-markdown-d For plugin vim-instant-markdown
  • xdg-utils For plugin vim-instant-markdown
  • nodejs-legacy For Debian-based systems
  • wmctrl Fullscreen needs
  • cmake Compile the ycm_core library
  • ctags For plugin tarbar
  • ack-grep For plugin ctrlsf

Installation

Via curl

  1. curl -o - https://raw.githubusercontent.com/hmybmny/vimrc/master/install-vim-plugins | sh

Via wget

  1. wget -O - https://raw.githubusercontent.com/hmybmny/vimrc/master/install-vim-plugins | sh

Included Plugins

I think you should read the docs of these plugins and .vimrc to use them efficiently.

Colors

Editing

Navigation

View

  • indentLine: display the indention levels with thin vertical lines
  • vim-gitgutter: show a Git diff in the gutter, stage/undo hunks

Linting

  • ale: as-you-type, asynchronous lint engine

Formerly included plugins

These are not included any more, but you can install them manually if you want.

Keymaps

The <leader> key is ;

Basic

Normal mode

  • ;w Write (save) the file, but don’t exit
  • ;q Quit
  • ;Q Quit and throw away changes
  • ;p Paste
  • ;hw Jump to the left window
  • ;jw Jump to the down window
  • ;kw Jump to the up window
  • ;lw Jump to the right window
  • <tab> Jump to the next window
  • <S-tab> Jump to the previous window
  • ]q Jump to next record/match in quickfix list
  • [q Jump to previous record/match in quickfix list
  • <F8> Change color scheme
  • <F11> Fullscreen

Insert mode

  • <C-s> Write (save) the file, but don’t exit
  • <C-h> Move left
  • <C-j> Move down
  • <C-k> Move up
  • <C-l> move right
  • <F8> Change color scheme
  • <F11> Fullscreen

Visual mode

  • ;y Copy

Plugins

Normal mode

  • ;fs Switch between companion source files (e.g. “.h” and “.cpp”)
  • ]b Jump to the next buffer
  • [b Jump to the previous buffer
  • ;ud Toggle Gundo visible
  • <C-f> Search and split a new window to show search result
  • <C-p> Open ctrlp window (alternative :CtrlP)
  • ;md Launch the preview window for current markdown file
  • ;jc Go to declaration
  • ;jd Go to definition
  • <F2> Toogle Tagbar visible
  • <F3> Toogle NERD-Tree visible
  • <F4> Toogle minibufexpl visble
  • <F12> Format your C family code

Insert mode

  • <F2> Toogle Tagbar visible
  • <F3> Toogle NERD-Tree visible
  • <F4> Toogle minibufexpl visble
  • <F9> Show history of previous yanks, changes and deletes
  • <F12> Format your C family code

Visual mode

  • <C-k> Move current line/selections up
  • <C-j> Move current line/selections down

Options

Building vim from source

  • Install all the following libraries

    • Ubuntu

      1. sudo apt-get install libncurses5-dev libgnome2-dev libgnomeui-dev \
      2. libgtk2.0-dev libatk1.0-dev libbonoboui2-dev \
      3. libcairo2-dev libx11-dev libxpm-dev libxt-dev python-dev \
      4. python3-dev ruby-dev lua5.3 lua5.3-dev libperl-dev git
      5. sudo update-alternatives --install /usr/bin/lua lua /usr/bin/lua5.3
      6. sudo update-alternatives --install /usr/bin/luac luac /usr/bin/luac5.3
    • openSUSE

      1. zypper in ruby-devel python-devel python3-devel perl-devel \
      2. lua-devel ncurses-devel libX11-devel gtk2-devel xorg-x11-devel
  • Remove vim if you have it already

  • Building Vim from source

    • Add/remove the flags above to fit your setup. For example, you can leave out enable-luainterp if you don’t plan on writing any Lua.

      1. cd ~
      2. git clone https://github.com/vim/vim.git
      3. cd vim
      4. ./configure --with-features=huge \
      5. --enable-multibyte \
      6. --enable-rubyinterp \
      7. --enable-pythoninterp \
      8. --with-python-config-dir=/usr/lib/python2.7/config \
      9. --enable-perlinterp \
      10. --enable-luainterp \
      11. --enable-gui=gtk2 --enable-cscope --prefix=/usr
      12. make
      13. sudo make install
    • Type the following in Vim: :echo has('python'). If the output is 1, then the version of Vim with Python support. If it’s 0, then get a version of Vim with Python support.

Using vim as a python IDE

Add the following line to your .vimrc.

  1. Plug 'klen/python-mode', { 'for': 'python' }

Install Plugin vim +PlugInstall +qall

Using vim as a Go IDE

Add the following line to your .vimrc.

  1. Plug 'fatih/vim-go', { 'for': 'go' }

Install Plugin vim +PlugInstall +qall

FAQ

Can’t build vim correctly

This wiki Building-vim-from-source may be helpful for you.

Contact

If you have feature suggestions, please open issues or pull requests.

License

MIT