CentOS6 under Vim installation and configuration

Source: Internet
Author: User
Tags function prototype imap

1. The system only installs the Vim-minimal, and executes the following command to install the other two components

Yum Install vim-commonyuminstall vim-enhanced

2. Installing Ctags

Yum Install Ctags

Download linux-2.6.32.27 kernel source and extract to ~/arm/linux-2.6.32.27, enter this directory, generate index file

Ctags-r *

3. Install plugin (basically extract to ~/.vim directory): Taglist/nerdcommenter/omnicppcomplete/echofunc/bufexplorer/winmanager

4. Configuration files

"Turn off the VI keyboard modeSet Nocompatible"Turn off backupSet Nobackup"prohibit generation of temporary filesSet Noswapfile"allows you to use the mouse to locate and selectSet mouse=Aset Selection=Exclusiveset SelectMode=Mouse,key"Show Line NumbersSet number"Prohibit folding linesSet nowrap"Highlight Current Line"Set Cursorline cursorcolumn"automatically save current changes when switching filesSet Autowrite"set what the status bar displays"set statusline=%f%m%r%h%w\ [format=%{&ff}]\ [type=%y]\ [pos=%l,%v][%p%%]\%{strftime (\ "%d/%m/%y\-\%H:%M\") }"settings always show the status bar"Set laststatus=2"Keep 3 lines away when the cursor moves to the top and bottomSet scrolloff=3"Detecting file Typesfiletype Onfiletype plugin on"Set EncodingSet encoding=utf-8Set termencoding=utf-8Set Fileencodings=ucs-bom,utf-8, Gbk,gb2312,cp936set fileencoding=utf-8"Set LanguageSet LANGMENU=ZH_CN. utf-8Set Helplang=cn"set TabSet Noexpandtab"do not expand the tab to a spaceSet tabstop=2    "How many spaces does a tab show ?Set shiftwidth=2 "How many spaces are indented at each levelSet Smarttab"determines how many spaces a tab is based on the number of indent spaces elsewhere in the file"Set IndentSet Nocindent"Turn off cindent indent mode"Set Cindent"Turn on C + +How to indent languages"set Cinoptions={0,1s,t0,n-2,p2s, (03s,=.5s,>1s,=1s,:1s"Set up C + +language specific indentation method set Noautoindent"Turn off autoindent indent modeSet Nosmartindent"Turn off smartindent indent modeifHas ("Autocmd") filetype plugin indent on autocmd filetype text setlocal textwidth= +autocmd FileType Text set nocindent autocmd FileType HTML set formatoptions+=tl autocmd FileType css set smartindent autocmd FileType C,CPP, SLANG,ESQLC set Cindentendif"Syntax Highlightingsyntax Enablesyntax on"Set ColorColorScheme Desert"ColorScheme Darkblue"ColorScheme Peachpuff"Search ignores caseSet ignorecase"Ignore ' ignorecase ' option if search mode contains uppercase lettersSet Smartcase"Search for verbatim FugauliangSet Hlsearchset incsearch"Highlight matching parenthesesSet Showmatch"matches the time of the parentheses highlighting (in a very second)Set Matchtime=1"--ctags settings--Map <F12>:!ctags-r--c++-kinds=+p--fields=+ials--extra=+q .<cr><cr>:tlistupdate<cr>IMAP<F12> <esc>:!ctags-r-c++kinds=+p--fields=+ials--extra=+q .<cr><cr>:TlistUpdate<CR>Set Tags=Tagsset Tags+=~/arm/linux-2.6.32.27/tags"Add the Linux kernel source ' s tags fileSet Tags+=./tags"Add current directory ' s generated tags file"--omnicppcomplete settings--Imap<f3> <C-X><C-O>Set completeopt=menu,menuone"Close the preview window when smart completion is completeLet omnicpp_maycompletedot=1   "autocomplete with.Let omnicpp_maycompletearrow=1 "AutoComplete withLet omnicpp_maycompletescope=1 "autocomplete with::Let omnicpp_selectfirstitem=2  "Select first item, but don ' t insertLet Omnicpp_namespacesearch=2  "Search Namespaces in this and included filesLet omnicpp_showprototypeinabbr=1 "Show function prototype in popup windowLet Omnicpp_globalscopesearch=1 "enable the global scope searchLet omnicpp_displaymode=1       "class scope Completion mode:always show all members"Let omnicpp_defaultnamespaces=["Std"]Let omnicpp_showscopeinabbr=1   "show scope in abbreviation and remove the last columnLet omnicpp_showaccess=1"--taglist settings--Let tlist_ctags_cmd='Ctags'Let Tlist_use_right_window=1Let tlist_show_one_file=0        "a list of functions that allow simultaneous display of multiple filesLet tlist_file_fold_auto_close=1 "non-current file, function list collapse hiddenLet tlist_exit_onlywindow=1      "automatically exits vim when TagList is the last split windowLet tlist_process_file_always=1  "update tags in real timeLet Tlist_inc_winwidth=0Let tlist_winwidth= +"Nmap tl:tlist<cr>"--bufexplorer settings--Let g:bufexplorerdefaulthelp=0      "Don't show default Help.Let G:bufexplorershowrelativepath=1 "Show relative paths.Let g:bufexplorersortby='MRU'       "Sort by most recently used."--winmanager setting--Let g:winmanagerwindowlayout='bufexplorer| FileExplorer' "set up the plugins we want to manageLet g:persistentbehaviour=0 "if all the editing files are closed, exit VILet G:winmanagerwidth= -Nmap Wm:tlisttoggle<CR>:wmtoggle<cr>"--quickfix settings--"map <F7>:make<cr>:copen<cr>"map <F8>:cp<cr>"map <F9>:cn<cr>"IMAP <F7> <ESC>:make<CR>:copen<cr>"IMAP <F8> <ESC>:cp<CR>"IMAP <F9> <ESC>:cn<CR>"--fold settings--function!Togglefold ()ifFoldlevel ('.')==0Normal!LElse        ifFoldclosed ('.') <0. Foldclose!Else. Foldopen!endif endif"Clear Status line    EchoEndfunctionnoremap<space>: Call Togglefold () <CR>functionfoldbrace ()ifGetline (v:lnum+1)[0]=='{'return1endififGetline (V:lnum) =~'{'return1endififGetline (V:lnum) [0]=~'}'return'<1'endif return-1endfunctionifHas ("Autocmd") Autocmd Bufreadpost*.h,*.hh,*.c,*.ec,*.CPP, *.HPP,*.ECPP,*.PC set foldexpr=foldbrace () autocmd bufreadpost*.h,*.hh,*.c,*.ec,*.CPP, *.HPP,*.ECPP,*.PC set foldmethod=ExprAutocmd bufreadpost*.h,*.hh,*.c,*.ec,*.CPP, *.hpp,*.ecpp,*. PC Set FOLDENABLEENDIF"--terminal Color settings--Hi Folded term=standout cterm=bold ctermfg=darkgreen ctermbg=Nonehi incsearch term=bold ctermfg=red ctermbg=Blackhi Search term=bold ctermfg=red Ctermbg=black

CentOS6 under Vim installation and configuration

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.