免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12345
最近访问板块 发新帖
楼主: lovesaka
打印 上一主题 下一主题

[共享交流]请交出你的vimrc [复制链接]

论坛徽章:
0
41 [报告]
发表于 2006-10-13 17:30 |只看该作者

我的vimrc.vim

更多请参见: http://blog.chinaunix.net/u/13329/article.php?frmid=21649


  1. $cat ~/.vim/plugin/vimrc.vim
  2. "set syntax on
  3. :syntax on

  4. "set no compatible
  5. :set nocompatible

  6. "set backspace
  7. :set backspace=indent,eol,start

  8. "set autoindent
  9. :set ai

  10. "set cautoindent
  11. :set cindent

  12. "set shiftwidth
  13. :set shiftwidth=4

  14. "set soft tab width
  15. :set softtabstop=4

  16. "change tab to spaces
  17. :retab

  18. "set line numbers
  19. :set nu

  20. "set show match (showmatch)
  21. :set sm

  22. "set foldmethod
  23. :set fdm=syntax

  24. "set extend tab
  25. :set et

  26. "set foldmarker
  27. :set foldmarker={{{,}}}

  28. "set match options
  29. :set matchpairs=(:),{:},[:],<:>

  30. :set complete+=k

  31. "set the visualbell
  32. :set visualbell

  33. "set history length
  34. :set history=50

  35. "set the ruler
  36. :set ruler

  37. "set fileencoding=gb2312

  38. "set show command line
  39. :set showcmd

  40. :set incsearch

  41. "set tags file  path
  42. :set tags=~/.vim/_tags

  43. "auto add *, when write /*...*/
  44. :set  formatoptions=tcro

  45. "show tab and spaces
  46. set  listchars=tab:>-,trail:~
  47. set  list
  48. syntax    match Trail " +$"
  49. highlight def link Trail Todo


  50. """"""""""""""""""""""""Maps""""""""""""""""""""""""

  51. if version >= 600

  52.    "find the current word
  53.    map <F3>    /<c-r><c-w><CR>

  54.    "Type List
  55.    map <F2>    :Tlist<CR>

  56.    "remove the space end of a line
  57.    map  ;m     :%s/ *$//g<CR>

  58.    "使用X调用Minmax()函数
  59.    map   X   :call Minmax() <CR>

  60.    "使用T调用MinmaxHeight()函数
  61.    map   T   :call MinmaxHeight() <CR>

  62.    "v%zf
  63.    :map ;c  v%zf

  64. endif
复制代码

论坛徽章:
0
42 [报告]
发表于 2006-10-16 01:44 |只看该作者
" 我的 _vimrc 部份設定

" 使用環境:windows XP
" vim 版本:7.0-134

" 編輯 _vimrc
map ,v :e!$vim/_vimrc<CR>

" 開啟個人備忘錄
map ,m :e!D:\117\Cbackup\memo\MEMO.TXT<CR>
" 押日期(map: 命令模式  imap: 搜入模式)
map <F7> a<C-R>=strftime("%c")<CR>
imap <F7> <C-R>=strftime("%c")<CR>

" 檔案瀏覽(開啟的目錄為目前編輯檔案所在之目錄)
map ,e :e <C-R>=expand("%:p:h")<CR><CR>   

" set hidden 始可使用以下二個命令(注意!有修改未存檔之陷阱。)
" 切換檔案編輯
map <F8> :bn<CR>
" 查詢編輯中的檔案編號,在:b後輸入編號即可編輯該檔;:bd!輸入編號可強行刪除buffer檔案
map ,r :ls<CR>:b

" set hlsearch, 字串搜尋吻合者高亮度提示,很好!
" 但用完她還亮著不肯離去,礙眼著很!所以,就 ...
map ,h :nohl<CR>

" set wrap 一眼看盡全行,她棒得很!
" 但想要比對上下行時,下行在下邊那一列呢?這時,就 ...
map ,w :set wrap!<CR>

" set nu 看著行號變大,成就感猶然而生。
" 但在成就之後的落寞時,不再需要閑雜人等,此時,就 ...
map ,n :set nu!<CR>

" set cursorline & set cursorcolumn 人近五十視茫眼瞎,浩瀚字海那點游標,找得辛苦!
" 幸好有了這帖清目丸!
map ,s :set cursorline!<CR>:set cursorcolumn!<CR>

" run perl script
map ;r :w<CR>:!perl -w "%:p"<CR>
" debug perl script
map ;d :w<CR>:!perl -d "%:p"<CR>Sample Text

[ 本帖最后由 jing18 于 2006-10-16 01:47 编辑 ]

论坛徽章:
1
2015年迎新春徽章
日期:2015-03-04 09:49:03
43 [报告]
发表于 2010-03-22 01:35 |只看该作者
还有其他人的vimrc 吗?

想看看

谢谢

论坛徽章:
0
44 [报告]
发表于 2010-03-28 18:52 |只看该作者

  1. syntax on
  2. set nocompatible
  3. set number
  4. "set autoindent
  5. "set smartindent
  6. set expandtab   
  7. set ts=4
  8. set shiftwidth=4
  9. set cursorline
  10. set nobackup
  11. " just for encode
  12. set fileencodings=utf-8,gb2312,gbk,gb18030
  13. set termencoding=utf-8
  14. set fileformats=unix
  15. set encoding=prc
  16. set hlsearch
  17. " set foldmethod
  18. set fdm=indent
复制代码

论坛徽章:
0
45 [报告]
发表于 2010-03-28 22:13 |只看该作者
600多行了,就不放了,会出事的

论坛徽章:
0
46 [报告]
发表于 2010-07-30 17:45 |只看该作者
  1. "颜色方案
  2. colorscheme desert256

  3. "禁止响铃
  4. set noerrorbells
  5. set autochdir

  6. nnoremap <silent> <F2> :Tlist<CR>
  7. let Tlist_Use_Right_Window=1
  8. let Tlist_File_Fold_Auto_Close=1
  9. "查找 -R ./* 为当前目录
  10. nnoremap <silent> <F3> :Grep<CR>
  11. "退出
  12. nnoremap <silent> <F4> :wall<CR> :qall<CR>
  13. imap <F4> <Esc>:wall<CR> :qall<CR>
  14. "写文件
  15. nnoremap <silent> <F5> :wall<CR> :make<CR>
  16. imap <F5> <Esc>:wall<CR> :make<CR>
  17. "cc和h互换
  18. nnoremap <silent> <F6> :A<CR>
  19. imap <F6> <Esc>:call CppToHFunc()<CR>
  20. func! CppToHFunc()
  21.         "保存文件
  22.         :w
  23.         "头文件和cc文件转化
  24.         :A
  25. endfunc
  26. "打开文件浏览器
  27. nnoremap <silent> <F8> :NERDTreeToggle<CR>
  28. imap <F8> <ESC>:NERDTreeToggle<CR>
  29. "保存所有文件
  30. nnoremap <silent> <F10> :wall<CR>
  31. imap <F10> <Esc>:wall<CR>

  32. imap <C-s> <Esc>:wa<CR>i<Right>
  33. nmap <C-s> :wa<CR>

  34. "保存文件并执行标签脚本
  35. nnoremap <silent> <F11> :call AutoTagsFunc()<CR>
  36. imap <F11> <Esc>:call AutoTagsFunc()<CR>
  37. func! AutoTagsFunc()
  38.         :wall
  39.         :!/home/autotags.sh
  40.         ":cs add /home/CDB/cscope.out
  41.         :cs reset
  42. endfunc
  43. "编译游戏代码
  44. set makeprg=/home/mymake.sh
  45. let &errorformat="%f:%l:%c: %t%*[^:]:%m,%f:%l: %t%*[^:]:%m," . &errorformat
复制代码

论坛徽章:
0
47 [报告]
发表于 2010-08-14 22:11 |只看该作者
刚开始一个月的菜鸟路过学习!!

论坛徽章:
0
48 [报告]
发表于 2010-11-01 13:02 |只看该作者
回复 1# lovesaka


    偶的vimrc   环境 ubuntu   主要用来code, C/C++ php 等  

    个人觉得比较方便。
  1. syntax on

  2. " If using a dark background within the editing area and syntax highlighting
  3. " turn on this option as well
  4. "set background=dark

  5. " Uncomment the following to have Vim jump to the last position when
  6. " reopening a file
  7. "if has("autocmd")
  8. "  au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
  9. "    \| exe "normal g'\"" | endif
  10. "endif

  11. " Uncomment the following to have Vim load indentation rules according to the
  12. " detected filetype. Per default Debian Vim only load filetype specific
  13. " plugins.
  14. "if has("autocmd")
  15. "  filetype indent on
  16. "endif

  17. " The following are commented out as they cause vim to behave a lot
  18. " differently from regular Vi. They are highly recommended though.
  19. "set showcmd                " Show (partial) command in status line.
  20. "set showmatch                " Show matching brackets.
  21. "set ignorecase                " Do case insensitive matching
  22. "set smartcase                " Do smart case matching
  23. "set incsearch                " Incremental search
  24. "set autowrite                " Automatically save before commands like :next and :make
  25. "set hidden             " Hide buffers when they are abandoned
  26. "set mouse=a                " Enable mouse usage (all modes) in terminals

  27. " Source a global configuration file if available
  28. " XXX Deprecated, please move your changes here in /etc/vim/vimrc
  29. filetype plugin on
  30. if filereadable("/etc/vim/vimrc.local")
  31.   source /etc/vim/vimrc.local
  32. endif
  33. syntax on
  34. set tabstop=4
  35. set autoindent shiftwidth=4
  36. set tabstop=4
  37. set shiftwidth=4
  38. let mapleader=","
  39. map <silent><leader>w :w<cr>
  40. map <silent><leader>qa :qa<cr>
  41. map <silent><leader>qq :q!<cr>
  42. map <silent><leader>wq :wq<cr>
  43. "Taglist
  44. map <silent><leader>tl :TlistToggle<cr>
  45. let Tlist_Ctags_Cmd = '/usr/bin/ctags'
  46. let Tlist_Show_One_File = 1
  47. let Tlist_Exit_OnlyWindow = 1
  48. let Tlist_Use_Right_Window = 1
  49. set nohlsearch
  50. set fileencodings=cp936,ucs-bom,utf-8,
  51. set fileencoding=cp936
  52. set encoding=cp936
  53. let &termencoding=&encoding
  54. "colorscheme desert
  55. "colorscheme molokai
  56. " cscope
  57. if has("cscope")
  58.         set csprg=/usr/bin/cscope
  59.         set csto=1
  60.         set cst
  61.         set nocsverb
  62.         " add any database in current directory
  63.         if filereadable("cscope.out")
  64.                 cs add cscope.out
  65.         endif
  66.         set csverb
  67. endif
  68. nmap <C-\>s :cs find s <C-R>=expand("<cword>")<CR><CR>
  69. nmap <C-\>g :cs find g <C-R>=expand("<cword>")<CR><CR>
  70. nmap <C-\>c :cs find c <C-R>=expand("<cword>")<CR><CR>
  71. nmap <C-\>t :cs find t <C-R>=expand("<cword>")<CR><CR>
  72. nmap <C-\>e :cs find e <C-R>=expand("<cword>")<CR><CR>
  73. nmap <C-\>f :cs find f <C-R>=expand("<cfile>")<CR><CR>
  74. nmap <C-\>i :cs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
  75. nmap <C-\>d :cs find d <C-R>=expand("<cword>")<CR><CR>
  76. " bufexploer
  77. map <silent><leader>be :BufExplorer<cr>
  78. map <silent><leader>bs :BufExplorerHorizontalSplit<cr>
  79. map <silent><leader>bv :BufExplorerVerticalSplit<cr>
  80. " quickfix
  81. nmap <F6> :cn<cr>
  82. nmap <F7> :cp<cr>
  83. nmap <F5> :make<cr>
  84. nmap <F8> :cw<cr>
  85. " press control + s to save
  86. "imap <C-c> <ESC> :w<cr>
  87. "nmap <C-c> <ESC> :w<cr>
  88. " quick jump between splits
  89. map <C-j> <C-w>j<C-w>_
  90. map <C-k> <C-w>k<C-w>_
  91. map <C-l> <C-w>l<C-w>_
  92. map <C-h> <C-w>h<C-w>_

  93. " A.vim
  94. map <silent><leader>a :A<cr>
  95. " NERD_tree
  96. map <silent><leader>t :NERDTreeToggle<cr>
  97. " another explorer
  98. map <silent><leader>e :Ex<cr>
  99. " only one window
  100. map <silent><leader>m :only<cr>
  101. " omnicppcomplete
  102. set completeopt=menu
  103. let OmniCpp_SelectFirstItem = 0
  104. map <F12> :!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q .<CR>
  105. set tags+=/home/listar/cppstltags
  106. " pydiction
  107. filetype plugin on
  108. let g:pydiction_location = '/home/listar/.vim/tools/pydiction/complete-dict'
  109. "php set
  110. "au FileType php source /usr/share/vim/vim72/colors/murphy.vim
  111. let g:phpColor = "murphy"
  112. let g:defaultColor = "desert"
  113. "au! FileType * exe ":colorscheme " . g:defaultColor
  114. "au! FileType php exe ":colorscheme " . g:phpColor
  115. " neocomplcache
  116. " Disable AutoComplPop.
  117. let g:acp_enableAtStartup = 0
  118. " Use neocomplcache.
  119. let g:neocomplcache_enable_at_startup = 1
  120. " Use smartcase.
  121. let g:neocomplcache_enable_smart_case = 1
  122. " Use camel case completion.
  123. let g:neocomplcache_enable_camel_case_completion = 1
  124. " Use underbar completion.
  125. let g:neocomplcache_enable_underbar_completion = 1
  126. " Set minimum syntax keyword length.
  127. let g:neocomplcache_min_syntax_length = 3
  128. let g:neocomplcache_lock_buffer_name_pattern = '\*ku\*'
  129. colorscheme murphy
复制代码
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP