Today, I reconfigured vim and configured it as a complete IDE. Includes auto-completion, file list, function list, etc.
Take a picture first:
Here is the file configuration:
Set Shortmess=ati "does not show that assistance for Ugandan children at startup set Nu" Display line number syntax on "syntax highlighting set ruler" Show Ruler set Showmodeset showcmdset hlsearchset nocompatible "get rid of nasty about VI consistency mode, avoid some bugs and limitations of previous versions set Cursorcolumn" vertical lines highlight set CU Rsorline "Current rampage highlighting set Foldmethod=syntax" set folding set Foldlevelstart=99set autoindent "Auto indent set Tabstop=2set Softtabst Op=2set shiftwidth=2set relativenumber "Set relative line number" color scheme set T_co=256syntax enableset background=darkcolorscheme Molokailet Mapleader= ";" Nmap <leader>q:q<cr>nmap <leader>w:w<cr>nmap <leader>qa:qa<cr>nmap <Leader >wq:wq<cr>nmap <leader>a zanmap <leader>j <c-w>jnmap <Leader>k <C-W>knmap < Leader>h <c-w>hnmap <leader>l <c-w>lnmap <leader>g:te<space>nmap <Leader>t Gtnmap <leader>f gfnmap <C-U> <c-v>0dnmap <C-K> <C-v> $dnmap <CR> Gnmap < backspace> Gginoremap JK <Esc>Inoremap (() <left>inoremap [[]<left>inoremap {<cr><tab>{<cr>}<esc>o<tab >function Headerpython () call Setline (1, "#coding: Utf-8") Call Append (1, "\ #Created time:". Strftime ('%y-%m-%d% T ', localtime ())) call Append (2, "") normal gendffunction Headersh () call Setline (1, "\################################ ######################################### ") Call Append (1," \ #File Name: ". Expand ("% ")) call Append (2," \ #Created time: ". Strftime ('%y-%m-%d%T ')) call append (3," \###################################################################### # # # ") Call Append (4," \#!/bin/bash ") call Append (5," ") normal gendffunction headercpp () call Setline (1,"/*************** Call Append (1, "File Name:". Expand ("%")) is call append (2, "Created Time:". Strftime ('%y-%m-%d%T ')) call append (3, "********************************************************/") call Append (4, " \ #include <iostream> ") Call Append (5," using namespace std; ") CAll append (6, "") normal gendfautocmd bufnewfile *.py call Headerpython () autocmd bufnewfile *.sh call Headersh () Autocmd buf NewFile *.cpp Call Headercpp () Map <F5>: Call COMPILERUNGCC () <cr>func! COMPILERUNGCC () Exec "W" if &filetype = = ' C ' exec "!g++%-o%<" exec "! ./%<" ElseIf &filetype = ' cpp ' EXEC "!g++%-o%<" exec "! ./%<" elseif &filetype = = ' sh ':!. /%elseif &filetype = = ' python ' exec "!python%" Endifendfunc "Pluginset nocompatible" be improved, required FileType off "required" set the runtime path to include Vundle and Initializeset Rtp+=~/.vim/bundle/vund Le.vimcall Vundle#begin () "Alternatively, pass a path where vundle should install plugins" Call Vundle#begin (' ~/some/path/ Here's ' Let Vundle manage Vundle, Requiredplugin ' Gmarik/vundle.vim ' Plugin ' scrooloose/nerdtree ' Plugin ' valloric/ Youcompleteme ' Plugin ' Vim-scripts/a.vim ' "All of your Plugins must be added before the following Linecall Vundle#end () "Requiredfiletype plugin indent on" required "to ignore plugin indent changes, instead use:" FileType plugin onlet g: ycm_global_ycm_extra_conf = ' ~/.vim/bundle/youcompleteme/cpp/ycm/.ycm_extra_conf.py ' "NERDTreemap <C-N>: Nerdtreetoggle<cr>let Nerdtreeshowbookmarks=1 "Show bookmarks let nerdtreedirarrows=0" directory Arrow 1 show arrows 0 traditional +-| number "Autocmd VimEnter * nerdtree "autocmd vimenter * wincmd P" autocmd vimenter * if!ARGC () | Nerdtree | endif "Taglistmap <C-L>: Tlist<cr>let tlist_show_one_file=0 let tlist_ctags_cmd="/usr/bin/ctags "will Tagli ST is associated with ctags let tlist_exit_onlywindow=1 "last window when quit let Tlist_use_right_window=1let tlist_file_fold_auto_close=1" let Tlist_auto_open=1 "Ctagsmap <F9>:!ctags-r--c++-kinds=+p--fields=+ias--extra=+q .<cr>
Explain some of the above configuration files slightly
Color scheme: This need to go to Molokai official website to download a molokai.vim file, put in ~/.vim/colors folder (if not, please create a new)
Plugin:
This section directly after writing the code to the ~/.VIMRC file, re-enter: Vim, and then enter::P lugininstall wait for the installation is good (probably longer)
Nerdtree:
Just the plugin part has been installed, the direct input configuration is good
Taglist:
This section needs to download a Taglist.vim file to the TagList website and put it into the ~/.vim/plugin folder (no new). The above configuration is then entered into the. VIMRC
Ctags
This is done directly by typing: apt-get install CATGS, then configure it.
Finally say complete plug-in Youcompleteme, error can refer to Ubuntu under the installation of Youcompleteme plugin this article to solve
When adding new features, this blog will continue to update, please look forward to
Change vim to IDE (not periodically updated)