Vim configuration in Mac OS

Source: Internet
Author: User

Starting with IMAC, it took a few days to complete the configuration of the vim environment and record it.

On Mac, I used macvim to open the compressed package. There is an mvim script in it. After running the script, you can call macvim in the command line.

Use plug-ins:

Pathogen, taglist, nerd_tree, snipmate, and nerocomplcache ~~~~

The specific configuration of each plug-in will not be mentioned. It is generally available on the internet, mainly writing two problems in my configuration

1. Apple's default ctags is a bit problematic. You need to recompile it yourself or use port or homebrew to install it. I used homebrew. However, if path is not specified or soft links are used, the ctags provided by Mac are used. I use soft links for implementation.

2. pathogen. Follow the instructions in the evening to create the autoload directory, put pathogen. Vim below, and add

"Pathogen
Call pathogen # runtime_append_all_bundles ()
Call pathogen # helptags ()

Remember before filetype plugin indent on (I don't know why)

Then create a bundle and create a directory for each plug-in under the bundle. In this case, some plug-ins can be used, but some plug-ins have no effect. After a long time, I found that, for example, my minibuf plug-in is configured in this way.

Put minibuf. Vim IN ~ In/. Vim/bundle/minibuf, minibuf is invalid. Compared with other plug-ins ~ /. Vim/bundle/minibuf to create a plugin directory and put minibuf. Vim IN ~ /. Vim/bundle/minibuf/plugin ~~~

Next I will add my vimrc

Set nocompatiblesyntax oncolorscheme desertset guifont = Monaco: H16 "pathogen call pathogen # runtime_append_all_bundles () call pathogen # helptags () If has (" autocmd ") filetype plugin indent on "indent augroup vimrcex Au Based on the file! Autocmd filetype text setlocal textwidth = 78 autocmd bufreadpost * \ If line ("'\" ")> 1 & line ("'\"") <= line ("{1} quot;) | \ exe" normal! G' \ "" | \ endif augroup endelse ": Smart indentation. cindent is used. autoindent can be used to indent various files, however, the effect is worse than that of cindent that only supports C/C ++. However, I have not found that set autoindent "always set autoindenting on endif" has ("autocmd ") if (G: iswindows = 1) "allow the mouse to use" Prevent Linux terminal from copying if has ('mouse ') set mouse = A endif au guienter * simalt ~ Xendifset nuset incsearchset hlsearchmap <F9>: Call do_cstag () <CR> NMAP <c-@> S: CS find S <C-R> = expand ("<cword> ") <CR>: Copen <CR> NMAP <c-@> G: CS find G <C-R> = expand ("<cword> ") <CR> NMAP <c-@> C: CS find C <C-R> = expand ("<cword>") <CR>: coen <CR> NMAP <c-@> T: CS find t <C-R> = expand ("<cword>") <CR>: copen <CR> NMAP <c-@> E: CS find e <C-R> = expand ("<cword>") <CR>: copen <CR> NMAP <c-@> F: CS find F <c -R> = expand ("<cfile>") <CR>: Copen <CR> NMAP <c-@> I: CS find I ^ <C-R> = expand ("<cfile>") <CR> {1} lt; CR>: Copen <CR> NMAP <c-@> D: CS find d <C-R> = expand ("<cword>") <CR>: Copen <CR> function do_cstag () Let dir = getcwd () if filereadable ("tags") Let tagsdeleted = Delete (". /". "tags") if (tagsdeleted! = 0) echohl warningmsg | echo "fail to do tags! I cannot delete the tags "| echohl none return endif if has (" cs1_") silent! Execute "CS kill-1" endif if filereadable ("cscope. Files") Let csfilesdeleted = Delete ("./". "cscope. Files") if (csfilesdeleted! = 0) echohl warningmsg | echo "fail to do cshl! I cannot delete the cscope. files "| echohl none return endif if filereadable (" cscope. out ") Let csoutdeleted = Delete (". /". "cscope. out ") if (csoutdeleted! = 0) echohl warningmsg | echo "fail to do cshl! I cannot delete the cshl. Out "| echohl none return endif if (executable ('ctags ') silent! Execute "! Ctags-r -- c-types = + p -- fields = + S * "" silent! Execute "! Ctags-r -- C ++-kinds = + p -- fields = + IAS -- extra = + q. "endif if (executable ('cs;') & has (" cs;") silent! Execute "! DIR/S/B *. C, *. cpp, *. H, *. Java, *. Cs> cs.pdf. Files "silent! Execute "! Cs1_ B "execute" Normal: "If filereadable (" csute. out ") Execute" CS add cs.pdf. out "endif endifendfunction" taglistlet tlist_show_one_file = 1let tlist_ctags_cmd = 'ctags '"is stored in environment variables, therefore, you can directly execute let tlist_exit_onlywindow = 1let detail = 0let tlist_file_fold_auto_close = 1 "non-current file. Function list folding hides let tlist_exit_onlywindow = 1" When taglist is the last split window, automatic vimmap <F3>: silent! Tlist <CR> "nerd_commenterlet nerdshutup = 1" doxygenmap FG: Dox <CR> Let G: doxygentoolkit_authorname = "dantezhu" Let G: doxygentoolkit_licensetag = "my own license \ <enter>" Let G: doxygentoolkit_undoctag = "doxigen_skip_block" Let G: Login = "@ brief \ t" Let G: doxygentoolkit_paramtag_pre = "@ Param \ t" Let G: doxygentoolkit_returntag = "@ return \ t" Let G: plugin = "no" Let G: doxygentoolkit_maxfunctionprotolines = 30 "minibuflet g: minibufexplmapwindownavvim = 1 "<c-jklh> switch Let G: minibufexplmapctabswitchbufs = 1" <c-tab> switch window let G: minibufexplmodseltarget = 1 "neocomlcachlet G: acp_enableatstartup = 0 "use neocomplcache. let G: neocomplcache_enable_at_startup = 1 "" use smartcase. let G: neocomplcache_enable_smart_case = 1 "" use camel case completion. let G: neocomplcache_enable_camel_case_completion = 1 "" use underbar completion. let G: neocomplcache_enable_underbar_completion = 1 "" set minimum syntax keyword length. let G: neocomplcache_min_syntax_length = 4 "turn off auto completelet G: neocomplcache_disable_auto_complete = 1" use supertablet G: supertabdefacomplecompletiontype = "context" "nerd_treenmap <F4>: nerdtree <CR> let nerdtreewinpos = "right" "where nerd tree window is placed on the screen

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.