Chinaunix首页 | 论坛 | 博客
  • 博客访问: 31149
  • 博文数量: 10
  • 博客积分: 10
  • 博客等级: 民兵
  • 技术积分: 115
  • 用 户 组: 普通用户
  • 注册时间: 2012-10-21 20:10
个人简介

for free, for linux

文章分类

全部博文(10)

文章存档

2013年(10)

我的朋友

分类: LINUX

2013-03-19 10:36:05

First, let`s have a glance at the vimrc file:


点击(此处)折叠或打开

  1. " maintainer: zaxbbun
  2. " last change: 2012 Nov 19
  3. "
  4. " to use it, copy it to
  5. " for Unix and OS/2: ~/.vimrc
  6. " for Amiga: s:.vimrc
  7. " for MS-D
  8. " for Unix and OS/2: ~/.vimrc
  9. " for Amiga: s:.vimrc
  10. " for MS-DOS and Win32: $VIM\_vimrc
  11. " for OpenVMS: sys$login:.vimrc


  12. "--general settings--
  13. "
  14. set nocompatible
  15. set autoread
  16. set fenc=utf-8
  17. set encoding=utf-8

  18. "--file type--
  19. "
  20. filetype on
  21. filetype plugin on
  22. filetype plugin indent on

  23. set number
  24. set magic
  25. if has('mouse')
  26. set mouse=a
  27. set selection=exclusive
  28. set selectmode=mouse,key
  29. endif
  30. set ruler
  31. set previewwindow

  32. set completeopt=longest,menu,menuone
  33. set updatetime=2
  34. set history=40
  35. set lazyredraw

  36. " Only do this part when compiled with support for autocommands.
  37. if has("autocmd")
  38. " Enable file type detection.
  39. " Use the default filetype settings, so that mail gets 'tw' set to 72,
  40. " 'cindent' is on in C files, etc.
  41. " Also load indent files, to automatically do language-dependent indenting.
  42. filetype plugin indent on

  43. " Put these in an autocmd group, so that we can delete them easily.
  44. augroup vimrcEx
  45. au!

  46. " For all text files set 'textwidth' to 78 characters.
  47. autocmd FileType text setlocal textwidth=78

  48. " When editing a file, always jump to the last known cursor position.
  49. " Don't do it when the position is invalid or when inside an event handler
  50. " (happens when dropping a file on gvim).
  51. " Also don't do it when the mark is in the first line, that is the default
  52. " position when opening a file.
  53. autocmd BufReadPost *
  54. \ if line("'\"") > 1 && line("'\"") <= line("$") |
  55. \ exe "normal! g`\"" |
  56. \ endif
  57. augroup END
  58. else
  59. set autoindent " always set autoindenting on
  60. endif " has("autocmd")

  61. "--indent--
  62. "
  63. set smartindent
  64. set autoindent
  65. set cindent
  66. set cinoptions={0,1s,t0,n-2,p2s,(03s,=.5s,>1s,=1s,:1s

  67. "--tab--
  68. "
  69. set noexpandtab
  70. set smarttab

  71. set softtabstop=4
  72. set tabstop=4
  73. set shiftwidth=4
  74. set backspace=eol,start,indent

  75. "--line break--
  76. "
  77. set whichwrap=b,s,<,>,[,],h,l
  78. set linebreak

  79. "--alpha case--
  80. "
  81. set ignorecase
  82. set smartcase

  83. "--search--
  84. "
  85. if &t_Co > 2 || has("gui_running")
  86. syntax on
  87. set hlsearch
  88. endif
  89. set incsearch

  90. "--show options--
  91. "
  92. set wildmenu
  93. set wildmode=list:full
  94. set showcmd
  95. set showmode
  96. set showmatch
  97. set matchtime=2

  98. "--backups and buffer--
  99. "
  100. set nowb
  101. set nobackup
  102. set noswapfile
  103. set bufhidden=hide
  104. set confirm


  105. "--ctags settings--
  106. "
  107. map :!ctags --links=yes --languages=c,c++ -I "__THROW __nonnull __wur __attribute__ __attribute_pure__ __attribute_deprecated__" --c-kinds=+lpx --c++-kinds=+lpx --fields=+nltiasS --extra=+q --tag-relative=no . :TlistUpdate
  108. imap

  109. set tags=tags
  110. set tags+=./tags
  111. set tags+=/usr/src/tags
  112. set tags+=/usr/include/c++/tags


  113. "--OmniCppComplete settings--
  114. "
  115. imap
  116. imap

  117. let OmniCpp_MayCompleteDot = 1 " autocomplete with .
  118. let OmniCpp_MayCompleteArrow = 1 " autocomplete with ->
  119. let OmniCpp_MayCompleteScope = 1 " autocomplete with ::

  120. let OmniCpp_GlobalScopeSearch=1 " enable the global scope search
  121. let OmniCpp_NamespaceSearch = 2 " search namespaces in this and included files
  122. let OmniCpp_DefaultNamespaces=["std"]

  123. let OmniCpp_DisplayMode=1
  124. let OmniCpp_ShowAccess=1
  125. let OmniCpp_ShowPrototypeInAbbr = 1 " show function prototype in popup window
  126. let OmniCpp_SelectFirstItem = 2 " select first item (but don't insert)


  127. "--taglist settings--
  128. "
  129. let Tlist_Auto_Open=1
  130. let Tlist_Process_File_Always=1
  131. let Tlist_Show_One_File=1
  132. let Tlist_Use_SingleClick=1
  133. let Tlist_File_Fold_Auto_Close=1
  134. let Tlist_Exit_OnlyWindow=1


  135. "--winManager settings--
  136. "
  137. map :BottomExplorerWindow
  138. map :FirstExplorerWindow
  139. map :WMToggle

  140. let winManagerWindowLayout='BufExplorer|FileExplorer,TagsExplorer,TagList'

Then u can download the latest plugins(code_complete, OmniCppComplete, taglist, bufexplorer, vim-autocomplpop,  winManager) from the website.
or u can just visit the following link to get them all from my box:


as stl completion, u can download the modified stl source files from: ; then ctags it to tags file which u needed to be added into the tags var in the vimrc file.

If you have any suggestions, welcome to contact me with zaxbbun@gmail.com
阅读(803) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~