vim配置

  1. " An example for a vimrc file.  
  2. "  
  3. " Maintainer:   Bram Moolenaar <[email protected]>  
  4. " Last change:  2006 Nov 16  
  5. "  
  6. " To use it, copy it to  
  7. "     for Unix and OS/2:  ~/.vimrc  
  8. "         for Amiga:  s:.vimrc  
  9. "  for MS-DOS and Win32:  $VIM\_vimrc  
  10. "       for OpenVMS:  sys$login:.vimrc  
  11.  
  12. " When started as "evim", evim.vim will already have done these settings.  
  13. if v:progname =~? "evim" 
  14.   finish  
  15. endif  
  16.  
  17. " Use Vim settings, rather then Vi settings (much better!).  
  18. " This must be first, because it changes other options as a side effect.  
  19. set nocompatible  
  20.  
  21. " allow backspacing over everything in insert mode  
  22. set backspace=indent,eol,start  
  23.  
  24. if has("vms")  
  25.   set nobackup      " do not keep a backup file, use versions instead  
  26. else 
  27.   set nobackup      " keep [NO] backup file  
  28. endif  
  29. set history=250     " keep 250 lines of command line history  
  30. set ruler       " show the cursor position all the time  
  31. set showcmd     " display incomplete commands  
  32. set incsearch      " do incremental searching  
  33. set nu  
  34.  
  35. " For Win32 GUI: remove 't' flag from 'guioptions': no tearoff menu entries  
  36. " let &guioptions = substitute(&guioptions, "t", "", "g")  
  37.  
  38. " Don't use Ex mode, use Q for formatting  
  39. map Q gq  
  40.  
  41. " In many terminal emulators the mouse works just fine, thus enable it.  
  42. set mouse=a  
  43.  
  44. " Switch syntax highlighting on, when the terminal has colors  
  45. " Also switch on highlighting the last used search pattern.  
  46. if &t_Co > 2 || has("gui_running")  
  47.   syntax on  
  48.   set hlsearch  
  49. endif  
  50.  
  51. " Only do this part when compiled with support for autocommands.  
  52. if has("autocmd")  
  53.  
  54.   " Enable file type detection.  
  55.   " Use the default filetype settings, so that mail gets 'tw' set to 72,  
  56.   " 'cindent' is on in C files, etc.  
  57.   " Also load indent files, to automatically do language-dependent indenting.  
  58.   filetype plugin indent on  
  59.  
  60.   " Put these in an autocmd group, so that we can delete them easily.  
  61.   augroup vimrcEx  
  62.   au!  
  63.  
  64.   " For all text files set 'textwidth' to 78 characters.  
  65.   autocmd FileType text setlocal textwidth=78  
  66.  
  67.   " When editing a file, always jump to the last known cursor position.  
  68.   " Don't do it when the position is invalid or when inside an event handler  
  69.   " (happens when dropping a file on gvim).  
  70.   autocmd BufReadPost *  
  71.     \ if line("'\"") > 0 && line("'\"") <= line("$") |  
  72.     \   exe "normal! g`\"" |  
  73.     \ endif  
  74.  
  75.   autocmd VimLeave *  
  76.     \ if has("mksession") && exists("v:this_session") && v:this_session != "" |  
  77.     \   exec "mksession!" v:this_session |  
  78.     \ endif  
  79.  
  80.   augroup END  
  81.  
  82. else 
  83.  
  84.   set autoindent        " always set autoindenting on  
  85.  
  86. endif " has("autocmd")  
  87.  
  88. " Convenient command to see the difference between the current buffer and the  
  89. " file it was loaded from, thus the changes you made.  
  90. command DiffOrig vert new | set bt=nofile | r # | 0d_ | diffthis  
  91.         \ | wincmd p | diffthis  
  92.  
  93. " Add by Journeylee to make things more easily  
  94. set softtabstop=4  
  95. set shiftwidth=4  
  96. set tabstop=4  
  97. set noexpandtab  
  98. set smarttab  
  99. set showmatch  
  100. set foldenable  
  101. set autoindent  
  102. set smartindent  
  103. set cindent  
  104. set foldmethod=marker  
  105. set background=dark  
  106. set nobackup  
  107. set encoding=utf-8  
  108. language en_US.utf8  
  109. set fileencodings=ucs-bom,utf-8,gbk,latin1  
  110. set fileformats=unix,dos,mac  
  111. set fileencoding=utf-8  
  112. set fileformat=unix  
  113.  
  114. set fileformat=unix  
  115. set matchtime=15  
  116.  
  117. " Make shift-insert work like in Xterm  
  118. map <S-Insert> <MiddleMouse>  
  119. map! <S-Insert> <MiddleMouse>  
  120.  
  121. " let xterm16_brightness = 'default'     " Change if needed  
  122. " let xterm16_colormap = 'allblue'       " Change if needed  
  123. " colo xterm16   
  124. "不使用swap文件  
  125. map <F5> :!php -l %<CR>  
  126. "set runtimepath+=/home/zhoubc/opt/vim/doc  
  127. "autocmd BufNewFile,Bufread *.ros,*.inc,*.php set keywordprg="help"  
  128.  
  129. let g:winManagerWindowLayout='TagList|FileExplorer' 
  130. let g:winManagerWidth=30  
  131. nmap  wm :WMToggle
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章