Vim configuration file in Mac

Source: Internet
Author: User

"Configuration file for vimset modelines = 0" CVE-2007-2438 "normally we use vim-extensions. if you want true vi-compatibility "Remove change the following statementsset nocompatible" use Vim defaults instead of 100% VI compatibilityset backspace = 2 "more powerful backspacing" ======== ========================================================== ======================================= "Description: suitable for your own vimrc files, for Linux/Windows, G UI/console "" last change: 2014.7.10 "" version: 1.80 "" ============================================ ============================================ set nocompatible "close VI compatibility mode syntax on "automatic syntax highlighting colorscheme darkblue" Desert Molokai set color scheme set number "display row number set cursorline" highlight current row set ruler "Open Status Bar ruler set shiftwidth = 4" set <and> the width of the command to 4 set softtabstop = 4 ". When you press the return key, you can delete four spaces at a time. Set tabstop = 4" set the tab length to 4 set nobackup. "Reply When creating a file, do not back up set autochdir. "automatically switch the current directory to the directory where the current file is located. filetype plugin indent on" Enable Plug-In set backupcopy = yes "set the backup behavior to overwrite set ignorecase 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, jump to matching brackets for a short time "set matchtime = 2" to jump to matching parentheses for a short time Set magic "set magic set den" 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" hidden menu bar set smartindent ". When the new feature is enabled, it uses 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 the information displayed in the status line set foldenable" Start folding Set foldmethod = Syntax "set syntax fold set foldcolumn = 0" set the width of the fold area setlocal foldlevel = 1 "set the number of fold layers to" set foldclose = all "set to auto close fold" 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" endifendfunction "user directory variable $ vimfilesif mysys () =" Windows "let $ vimfiles = $ vim. '/vimfiles' elseif mysys () = "Linux" let $ vimfiles = $ home. '/. vim 'endif "sets the DOC file directory let helptags = $ vimfiles. '/doc' "Set Font and Chinese support if has (" Win32 ") set guifont = inconsolata: H12: cansiendif" Configure multilingual environment if has ("multi_byte ") "UTF-8 encoding set encoding = utf-8set termencoding = utf-8set formatoptions + = mmset fencs = UTF-8, gbkif V: lang = ~? '^ \ (Zh \) \ | \ (JA \) \ | \ (Ko \)' set ambiwidth = doubleendifif has ("Win32") Source $ vimruntime/delmenu. vimsource $ vimruntime/menu. vimlanguage messages zh_CN.utf-8endifelseechoerr "sorry, this version of (g) Vim was not compiled with + multi_byte" endif "buffers operation shortcut! Nnoremap <C-RETURN>: bnext <CR> nnoremap <C-S-RETURN>: bprevious <CR> "tab operation shortcut! Nnoremap <C-TAB>: tabnext <CR> nnoremap <C-S-TAB>: tabprev <CR> "about the tab shortcut" map TN: tabnext <CR> "map TP: tabprevious <CR> "map TD: tabnew. <CR> "map te: tabedit" map TC: tabclose <CR> "when the window is 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> hnnoremap <c-j> <c-W> jnnoremap <c-k> <c-W> knnoremap <c-l> <c-W> L "some good ing conversion syntaxes (useful if different languages are mixed in a file) nnoremap <leader> 1: SE T 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 count 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>" enables tohtml to generate HTML with CSS syntax "syntax/2html. Vim, which can be used: runtime! Syntax/2html. vimlet html_use_css = 1 "general settings of the python file, for example, autocmd filetype Python set tabstop = 4 shiftwidth = 4 expandtabautocmd 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. dictautocmd filetype CSS set dictionary = $ vimfiles/dict/CSS. dictautocmd 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 the Windows system. Let tlist_ctags_cmd = '/usr/bin/ctags' endifn Noremap <silent> <F4>: tlisttoggle <CR> let tlist_show_one_file = 1 "displays tags of multiple files at the same time, only show the current file's let tlist_exit_onlywindow = 1 "if the taglist window is the last window, exit vimlet records = 1. In the right window, the taglist window is displayed. Let records = 1. The method list of the current non-edited file is automatically folded. Let tlist_auto_open = 0let tlist_auto_update = 1let records = 1let tlist_enable_fold _ 0let tlist_process_file_always = 1 Let tlist_display_prototype = 0let tlist_compact_format = 1 "plugin" Plugin-mark. Vim marks different colors for various tags, which is convenient for viewing and 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], cou below Cu cursor NT 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 line, and enter 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 is a document generated by annotations and can quickly generate standard function comments "--------------------------------------------------------------- Let G: doxygentoolkit_authorname =" asins-asinsimp Le 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 = 1let G: Drawing = 1let G: neocomplcache_smartcase = 1let G: Drawing = 1let G: neocomplcache_enableinfo = 1let G: Drawing = 1let G: Drawing = 3let G: neocomplcache_enableskipcompletion = 1let G: neocomplcache_skipinputtime = '0. 5'let G: neocomplcach E_snippetsdir = $ vimfiles. '/snippets' "<tab> completion. inoremap <expr> <tab> pumvisible ()? "\ <C-N>": "\ <tab>" "snippets expand keyimap <silent> <c-e> <plug> (neocomplcache_snippets_expand) SMAP <silent> <c-e> <plug> (neocomplcache_snippets_expand) "don't write backup file if Vim is being called by" crontab-e "au bufwrite/private/tmp/crontab. * Set nowritebackup "don't write backup file if Vim is being called by" chpass "au bufwrite/private/etc/PW. * Set nowritebackup


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.