Vim configuration and pre-preparation

Source: Internet
Author: User
Tags imap word wrap

1. Install vim gcc make clang

2. Copy the following code into your. VIMRC

"----------------------------------------" Vim Configuration "----------------------------------------" Set No Compatible "be improved, requiredfiletype off" required "set the runtime path to include V Undle and initialize set Rtp+=~/.vim/bundle/vundle.vim call Vundle#begin () Plugin ' Gmarik/vundle.vim ' Plugin ' Taglist.vim ' Plugin ' minibufexpl.vim ' Plugin ' Winmanager ' Plugin "Clang-complete ' Plugin ' supertab ' Plugin ' scrooloose/ Syntastic ' Plugin ' lokaltog/vim-powerline ' Plugin ' wolfgangmehner/vim-plugins ' Bundle ' altercation/ Vim-colors-solarized ' Call Vundle#end () "Required"----------basic settings----------------------filetype plugin indent on Syntax on "Use syntax highlighting set Autoread" using incompatible VI mode set Autoindent "setting Auto Align (indent) set smartindent "Smart alignment set wrap" word wrap set LineBreak "line wrap set Cinden            T "set backspace=2 using the automatic indentation method of the C + + language   "Set Backspace key available set mouse=a" Use mouse set number "show line numbers set cul" displays the current             Line underline set tabstop=8 "Set tab (tab) Width set softtabstop=8" Set the width of the soft tab set Expandtab "Tab Replace space scriptencoding utf-8" setting encoding set Cursorline "Highlight current line set nobackups ET noswapfile "Disable generate temporary file set wildmenu" complete command set scrolloff=4 "cursor moves to BUF When the top and bottom of the Fer remain at 3 lines, and then move down the page, the cursor and the last line always remain 4----------------tags----------------------------------------------- ----------""--------------------minibufferexplorer settings----------------------let g:minibufexplmapwindownavvim=1 "press Under CTRL+H/J/K/L, you can switch to the current window up and down the left and right window let G:minibufexplmapwindownavarrows=1 "press CTRL + ARROW, you can switch to the current window up and down the left and right window let G:MINIBUFEXPLM Apctabswitchbufs=1 "Ctrl+tab move to the next window, ctrl+shift+tab to the previous window let G:minibufexplmodseltarget=1" do not edit the contents of the window Port (e.g. TagList window), open the selected buffer "set the split-screen browse let Tlist_show_one_file=0let tlist_exit_onlywindow=1let g:winmanagerwindowlayout= ' FileExplorer| TagList ' Nmap wm:wmtoggle<cr> "------------clang-complete-----------------"-------------------------------- --------------set Completeopt=longest,menulet g:clang_auto_select=1let g:clang_complete_select=1let g:clang_ Complete_copen=1let G:clant_periodic_quickfix=1let g:clang_snippets=0 let g:clang_close_preview=1 let G:clang_use_ Library=1 "-------------Set Super Tab completion--------------let G:supertabretaincompletiontype=0let g: Supertabdefaultcompletiontype= "<C-X><C-U>" "------------------------------------------------" "----- --------------Powerline Configuration-------------------Set Nocompatibleset laststatus=2set encoding=utf-8set t_co=256set Guifont=powerlinesymbols\ for\ let g:powerline_symbols= ' Unicode ' to g:powerline_stl_path_style= ' full '------------ ------------------------------------syntax enableset background=darkcolorscheme solarizedset foldenable "Allow collapse set FD M=markerset foldcolumn=0Set foldlevel=3 "Some settings about folding, but do not understand" press F5, recursively generate tag file in current directory map <F5>:!ctags-r--c++-kinds=+p--fields=+ias--extra=+q <cr><cr>imap <F5> <esc>:!ctags-r--c++-kinds=+p--fields=+ias--EXTRA=+Q&LT;CR&GT;&LT;CR > "Vim starts automatically loading the following tags file set tags=tagsset tags+=./tags" to build, go to put "set Tags+=/usr/local/src/linux-3.12.6/tagsset tags+= /usr/include/linux/tagsset tags+=/usr/include/tagsset tags+=/usr/include/sys/tagsset tags+=./tags "QuickFix plug-in Settings" Press F6 to execute the make compiler and open the Quickfix window to display the compilation information map <F6>:make<cr><cr><cr>:copen<cr><cr> "Press F7, the cursor moves to the row where the previous error map <F7>:cp<cr>" Press F8, the cursor moves to the next error line map <F8>:cn<cr> "Press F9, do Cleanmap <F9>: Make clean<cr><cr><cr> "The following mapping is to enable the above shortcut keys in the Insert mode can also use IMAP <F6> &LT;ESC&GT;:MAKE&LT;CR ><CR><CR>: Copen<cr><cr>imap <F7> <esc>:cp<cr>imap <F8> <esc >:cn<cr>imap <F9> <esc>:make clean<cr><cr>< Cr> "C,c++ Press F2 compile run map <F2>: Call COMPILERUNGCC () <cr>func! COMPILERUNGCC () Exec "W" if &filetype = = ' C ' exec "!gcc-g%-o%<" exec ": Copen" Elsei           F &filetype = = ' cpp ' EXEC "!g++%-o%<" exec "! ./%<" elseif &filetype = = ' java ' Exec "!javac%" exec "!java%<" elseif &filetype = = ' sh ':!. /% ElseIf &filetype = = ' py ' exec '!python% ' exec '!python%< ' endifendfunc ' non-recursive mappings in insert mode, auto-fill Full mapping Inoremap <C-F> <C-X><C-D> "Prevent hand cnoremap q! Q!cnoremap Q1 q!command q qcommand Wq wqcommand Wq Wqcommand w W

3. Exit. Re-enter, and enter Plugininstall on the command line to press the first few letters and then follow the table auto-complete Lookup

4. Wait for the download to complete

5. End

Vim configuration and pre-preparation

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.