Vim configuration in Linux

Source: Internet
Author: User
Tags imap
[Color = Blue] Set nocompatible "Disable VI compatibility mode syntax on" auto syntax highlight colorscheme Molokai "set color scheme set number" display row number set cursorline "highlight current row set rcategory" Open status Bar ruler set shiftwidth = 4 "set <and> the width of the command to move is 4 set softtabstop = 4" so that four spaces can be deleted at a time when you press the return key set tabstop = 4" set the tab length to 4 set nobackup. Do not back up set autochdir when overwriting files. automatically switch to The filetype plugin indent on directory where the current directory is located. "Enable Plug-In set backupcopy = yes" when setting backup to overwrite set ignoreca. Se smartcase "Case Insensitive during search, however, when one or more uppercase letters exist, the set nowrapscan is case sensitive. You are not allowed to re-search the set incsearch when both ends of the file are found. The search result set hlsearch is displayed when you enter the search content. set noerrorbells "Disable Error message ring set novisualbell" Disable use of visual bell instead of call set t_vb = "Terminal code for empty error ringtone" set showmatch "insert parentheses, briefly jump to the matching parentheses "set matchtime = 2" briefly jump to the matching parentheses time set magic "set magic set hidden" allows you to switch the buffer when there are unsaved changes, in this case, VIM is responsible for saving set guioptions-= T "hidden toolbar set guioptions-= M "hide the menu bar set smartindent" use smart automatic indent set backspace = indent, EOL, start "is not set in the insert status. The return key and delete key cannot be used to delete the carriage return character set into Height = 1" set the number of lines in the command line to 1 Set laststatus = 2 "display the status bar (default value: 1, unable to display status bar) set statusline = \ % <% F [% 1 * % m % * % N % R % H] % = \ % Y \ % 0 (% {& fileformat} \ % {& amp; encoding} \ % C: % L/% L %) \ "set foldenable" start to fold set foldmethod = Syntax "set syntax fold set foldcolumn = 0" set the width of the fold area setlocal foldlevel = 1 "set the number of folds set Foldclose = all "set to auto-disable folding" nnoremap <space >@= (foldclosed (line ('.') <0 )? 'Zc': 'Z') <CR> "use the space key to switch and collapse" Return OS type, eg: windows, or Linux, Mac, ET. St... function! Mysys () If has ("Win16") | has ("Win32") | has ("win64") | has ("Win95 ") return "Windows" elseif has ("Unix") Return "Linux" endif endfunction "user directory variable $ vimfiles if mysys () =" Windows "let $ vimfiles = $ vim. '/vimfiles' elseif mysys () = "Linux" let $ vimfiles = $ home. '/. vim 'endif "sets the DOC file directory let helptags = $ vimfiles. '/doc' "font setting and Chinese support if has (" Win32 ") set guifont = inconsolata: H12: cansi endif" multi-language environment Configuration If has ("multi_byte") "UTF-8 encoding set encoding = UTF-8 set termencoding = UTF-8 set formatoptions + = mm set fencs = UTF-8, GBK if V: lang = ~? '^ \ (Zh \) \ | \ (JA \) \ | \ (Ko \)' set ambiwidth = Double endif if has ("Win32") Source $ vimruntime/delmenu. vim source $ vimruntime/menu. vim language messages zh_CN.utf-8 endif else echoerr "sorry, this version of (g) Vim was not compiled with + multi_byte" endif "window split, the shortcut key for switching needs to be connected twice, for example, moving the cursor from the lower window to the upper window requires <c-W> K, which is very troublesome. Now, REMAP to <c-k>, switching will become very convenient. nnoremap <c-h> <c-W> H nnoremap <c-j> <c-W> J nnoremap <c-k> <c-W>- W> K nnoremap <c-l> <c-W> L "some good ing conversion syntaxes (useful if different languages are mixed in a file) nnoremap <leader> 1: Set filetype = XHTML <CR> nnoremap <leader> 2: Set filetype = CSS <CR> nnoremap <leader> 3: set filetype = JavaScript <CR> nnoremap <leader> 4: Set filetype = php <CR> "set fileformats = UNIX, DOS, Mac" NMAP <leader> FD: se fileformat = dos <CR> "NMAP <leader> Fu: se fileformat = UNIX <CR> "use Ctrl + [L | n | p | CC] to list | next | previous | jump to CO Unt the result "Map <c-x> L <ESC>: CL <CR>" Map <c-x> n <ESC>: CN <CR> "Map <c-x> P <ESC>: CP <CR>" Map <c-x> C <ESC>: CC <CR> "generate HTML with CSS syntax for tohtml" syntax/2html. vim, which can be used: runtime! Syntax/2html. Vim let html_use_css = 1 "general settings of the python file, for example, do not tab autocmd filetype Python set tabstop = 4 shiftwidth = 4 expandtab autocmd filetype Python Map <F12> :! Python % <CR> "Ctrl + C in selected state copy vmap <c-c>" + Y "Open JavaScript collapse Let B: javascript_fold = 1 "Open JavaScript to support DOM, HTML, and CSS. Let javascript_enable_domhtmlcss = 1" set the dictionary ~ /. Vim/dict/file path autocmd filetype JavaScript set dictionary = $ vimfiles/dict/JavaScript. dict autocmd filetype CSS set dictionary = $ vimfiles/dict/CSS. dict autocmd filetype PHP set dictionary = $ vimfiles/dict/PHP. dict "-----------------------------------------------------------------" Plugin-bufexplorer. vim buffers switch "\ be full screen view all open file list" \ BV left and right view \ BS up and down view "--------------------------------------- -------------------------- "-----------------------------------------------------------------" Plugin-taglist. vim to view the function list, you need the ctags program "F4 open the hidden taglist window" ------------------------------------------------------------- if mysys () = "Windows" "sets the ctags program location in windows. Let tlist_ctags_cmd = '"'. $ vimruntime. '/ctags.exe "' elseif mysys () =" Linux "" sets the location of the ctags program in Windows system. Let tlist_ctags_cmd = '/usr/ Bin/ctags 'endif nnoremap <silent> <F4>: tlisttoggle <CR> let tlist_show_one_file = 1 "the tag of multiple files is not displayed at the same time, only show the current file's let tlist_exit_onlywindow = 1 "if the taglist window is the last window, exit Vim let tlist_use_right_window = 1 ". In the right window, the taglist window is displayed. Let tlist_file_fold_auto_close = 1". The list of methods for automatically folding the current non-edited file is displayed. Let tlist_auto_update = 1 1 Let tlist_enable_fold_column = 0 let tl Ist_process_file_always = 1 Let tlist_display_prototype = 0 let tlist_compact_format = 1 "plugin" Plugin-mark. Vim tags different colors for various tags, allowing you to conveniently view the debugging plug-ins. "\ M mark or unmark the word under (or before) the cursor" \ r manually input a regular expression. used for search. "\ n clear this mark (I. e. the mark under the cursor), or clear all highlighted marks. "\ * next to the current markword \ # previous to the current markword" \/next to all markwords \? The previous "plugin" --------------------------------------------------------------------- "Plugin-nerd_tree.vim browses the files and directories in the system in tree mode": erdtree opens nerd_tree: nerdtreeclose close nerd_tree "O open close file or directory t open in the tab" t open in the background tab! Run the "P to the upper directory P to the root directory" K to the first node J to the last node "u to open the upper directory m to display the file system menu (add, delete, and move operations)) "R recursively refresh current directory R recursively refresh current root directory" failed "F3 nerdtree switchover Map <F3>: nerdtreetoggle <CR> imap <F3> <ESC>: nerdtreetoggle <CR> "plugin" Plugin-nerd_commenter.vim used to annotate the code, "[count], add comments (7, CC) row by row under the CC cursor count" [count ], Cu cursor following count line by line uncomment (7, Cu) "[count], CM cursor below count line tries to add block comment (7, CM )", CA inserts/**/at the end of a row and enters the insert mode. This command is convenient for writing comments. "NOTE: The Count parameter is optional, if none, the selected row or the current row is selected by default. "Let nerdspacedelims = 1" leaves a space between the annotator and the statement. Let nerdcompactsexycoms = 1 "multi-line comments look better" comment "-----------------------------------------------------------------" plugin-doxygentoolkit. vim generates a document from the annotation and can quickly generate the function standard annotation "--------------------------------------------------------------- Let G: doxygentoolkit_authorname =" asins- Asinsimple at gmail dot com "Let G: doxygentoolkit_brieftag_funcname =" yes "Map <leader> da: doxauthor <CR> Map <leader> DF: Dox <CR> Map <leader> DB: doxblock <CR> Map <leader> dc a/**/<left> "---------------------------------------------------------------" Plugin-zencoding. vim cool plug-in, HTML code generation "plug-in latest version: http://github.com/mattn/zencoding-vim" Common commands can be seen: http://nootn.com/blog/Tool/23 "-------- --------------------------------------------------------- "-------------------------------------------------------------" Plugin-checksyntax. vim JavaScript common syntax error check "Default shortcut: F5" ------------------------------------------------------------------- Let G: checksyntax_auto = 0 "do not automatically check" plugin "Plugin-neocomplcache. vim auto-completion plug-in "---------- Let G: Drawing = 1 Let G: Drawing = 1 Let G: neocomplcache_smartcase = 1 Let G: neocomplcache_tagsautoupdate = 1 Let G: neocomplcache_enableinfo = 1 Let G: Drawing = 1 Let G: neocomplcache_minsyntaxlength = 3 Let G: neocomplcache_enableskipcompletion = 1 Let G: neocomplcache _ Skipinputtime = '0. 5' Let G: neocomplcache_snippetsdir = $ vimfiles. '/snippets' "<tab> completion. inoremap <expr> <tab> pumvisible ()? "\ <C-N>": "\ <tab>" "snippets expand key imap <silent> <c-e> <plug> (neocomplcache_snippets_expand) SMAP <silent> <c-e> <plug> (neocomplcache_snippets_expand) "-------------------------------------------------------------" Plugin-matchit. vim expands the % command to redirect between nested labels and statements "% forward match g % reverse match" [% first part of positioning] % last part of positioning "plugin" plugin "Plugin-vcscommand. vim extends the % command so that the "SVN/git management tool" ----------------------------------------------------------------------- "plugin" Plugin-A can be redirected between nested labels and statements. vim "----------------------------------------------------------------- [/color]

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.