用linux装逼->我的vim配置(不定时更新) – c

把装逼进行到底!提高生活质量,多用键盘,不买鼠标!

我的vimrc插件大致如下:c/c++查找ctags(一般自带) +cscope函数提示echofunc窗口taglist + WinManager + quickfix(一般自带) + nerdtree + MiniBufExplorer智能补全supertab + omnicppcomplete画图drawit + sketch没装上vimgdb

————————————————————————————————————————–

配置文件夹在http://download.csdn.net/detail/c_o_o_l_u_l_u/4599052,

即我的帐号下载栏目叫:coolulu的vim插件配置文件夹(我的WinManager插件的目录栏是在右边的)

我的vimrc

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Copycat: lulu" Version: 3.2.3" Install: 在linux和windows下无需改动配置文件的内容,对应配置文件夹是vim_3"          在linux下在 ~/ 目录下,配置文件名改成 .vimrc,路径为 ~/.vimrc"                  配置文件夹名改成 .vim,路径为 ~/.vim"          在windows下在 $(vim)/ 目录下,配置文件名改成 _vimrc,路径为 Vim/_vimrc"                          配置文件夹名改成 vimfiles,路径为 Vim/vimfiles" NoBugs:  windows下 taglist使用有问题已修复" Time:    2012.8.3""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 文本格式和排版"set formatoptions=tcrqn " 自动格式化set autoindent " 继承前一行的缩进方式,特别适用于多行注释set smartindent " 为C程序提供自动缩进set cindent " 使用C样式的缩进set smarttab " 在行和段开始处使用制表符"set tabstop=4 " 制表符为4"set softtabstop=4 " 统一缩进为4"set shiftwidth=4"set noexpandtab " 不要用空格代替制表符"set nowrap " 不要换行"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 搜索和匹配 "set showmatch " 高亮显示匹配的括号set matchtime=5 " 匹配括号高亮的时间(单位是十分之一秒)set scrolloff=10  " 光标移动到buffer的顶部和底部时保持10行距离set novisualbell " 不要闪烁set hlsearch " 高亮搜索set nowrapscan " 查找到文件头或文件尾时停止"set incsearch " 边输入边查找"set laststatus=2 " 总是显示状态行"set ignorecase " 在搜索的时候忽略大小写"set statusline=%F%m%r%h%w\[POS=%l,%v][%p%%]\%{strftime(\”%d/%m/%y\ -\ %H:%M\”)} " 我的状态行显示的内容(包括文件类型和解码)"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 文件设置"set shortmess=atI " 启动的时候不显示那个援助索马里儿童的提示`set report=0 " 通过使用: commands命令,告诉我们文件的哪一行被改变过set noerrorbells " 不让vim发出讨厌的滴滴声set fillchars=vert:\ ,stl:\ " 在被分割的窗口间显示空白,便于阅读 ,stlnc:\(加了这个wm分割兰有\\\\\\\\\\\\\)set mouse=a " 可以在buffer的任何地方使用鼠标(类似office中在工作区双击鼠标定位)set selection=exclusiveset selectmode=mouse,key"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 一般设置"set viminfo+=! " 保存全局变量set history=300 " history文件中需要记录的行数set nocompatible " 不要使用vi的键盘模式,而是vim自己的set foldmethod=syntaxset foldlevel=100  " 启动vim时不要自动折叠代码set nuset fileencodings=utf-8,gbkset rulerset showmatch " 高亮显示匹配的括号 filetype on " 侦测文件类型 set nobackup " 不要备份文件(根据自己需要取舍) "set backupsyntax enablesyntax on " 语法高亮 set magic " 设置正表达式set backspace=indent,eol,start " 这指明在插入模式下在哪里允许 <BS> 删除光标前面的字符。" 逗号分隔的三个值分别指:行首的空白字符,换行符和插入模式开始处之前的字符。set showcmd " 在 Vim 窗口右下角,标尺的右边显示未完成的命令" :inoremap ( ()<ESC>i" :inoremap { {<CR>}<ESC>O" :inoremap [ []<ESC>i" :inoremap " ""<ESC>i" :inoremap ' ''<ESC>i"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" GUI"if has("gui_running") " 如果是图形界面   set guioptions=m " 关闭菜单栏set guioptions=t " 关闭工具栏"set guioptions=L " 启动左边的滚动条"set guioptions+=r " 启动右边的滚动条"set guioptions+=b " 启动下边的滚动条set clipboard+=unnamed " 共享剪贴板if has("win32")       colorscheme torte " torte配色方案       set guifont=Consolas:h11 " 字体和大小endifendif """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" taglist "let Tlist_Use_Right_Window = 0 " 在左侧显示窗口let Tlist_Compart_Format = 1 " 压缩方式let Tlist_Exist_OnlyWindow = 1 " 如果只有一个buffer,kill窗口也kill掉bufferlet Tlist_File_Fold_Auto_Close = 0 " 不要关闭其他文件的tagslet Tlist_Enable_Fold_Column = 0 " 不要显示折叠树 (鼠标可以点开)nmap <silent> <leader>tl :Tlist<cr>if has("win32") let Tlist_Ctags_Cmd = '   ctags' "windows下必须空3个字符,否则解析成gs else let Tlist_Ctags_Cmd = '/usr/bin/ctags'endif"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" netrw"let g:netrw_winsize = 35nmap <silent> <leader>fe :Sexplore!<cr>"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" winmanager "let g:winManagerWindowLayout='NERDTree|BufExplorer'"let g:winManagerWindowLayout = 'FileExplorer|TagList'"let g:winManagerWindowLayout = 'FileExplorer'let g:winManagerWidth = 35let g:defaultExplorer = 0nmap wm :WMToggle<cr>nmap <C-W><C-F> :FirstExplorerWindow<cr>nmap <C-W><C-B> :BottomExplorerWindow<cr>autocmd BufWinEnter \[Buf\ List\] setl nonumber"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" omnicppcomplete"set nocpfiletype plugin onlet OmniCpp_DefaultNamespaces = ["std"] "下面的设置用于当用户预先声明namespace时也能自动补全代码(如使用using std::string) "if has("win32") " 设置代码提示窗口的颜色(默认为粉红色) "highlight Pmenu ctermbg=13 guibg=LightGray "highlight PmenuSel ctermbg=7 guibg=DarkBlue guifg=White "highlight PmenuSbar ctermbg=7 guibg=DarkGray "highlight PmenuThumb guibg=Black"endif"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" minibufexpl"let g:miniBufExplMapWindowNavVim = 1 let g:miniBufExplMapWindowNavArrows = 1 let g:miniBufExplMapCTabSwitchBufs = 1 let g:miniBufExplModSelTarget = 1 "let g:miniBufExplorerMoreThanOne=1 "自动打开"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" cscope"if has("cscope")set csto=0set cstset nocsverbif filereadable("cscope.out")" add any database in current directory     cs add cscope.outelseif $CSCOPE_DB != "" " else add database pointed to by environment        cs add $CSCOPE_DBendifset csverb " 这个必须放在后面,不然windows上找不到cscope.outendifnmap <C-\&;s :cs find s <C-R>=expand("<cword>")<CR><CR> :cw<CR>nmap <C-\&;g :cs find g <C-R>=expand("<cword>")<CR><CR> :cw<CR>nmap <C-\&;c :cs find c <C-R>=expand("<cword>")<CR><CR> :cw<CR>nmap <C-\&;t :cs find t <C-R>=expand("<cword>")<CR><CR> :cw<CR>nmap <C-\&;e :cs find e <C-R>=expand("<cword>")<CR><CR> :cw<CR>nmap <C-\&;f :cs find f <C-R>=expand("<cfile>")<CR><CR> :cw<CR>nmap <C-\&;i :cs find i ^<C-R>=expand("<cfile>")<CR>$<CR> :cw<CR>nmap <C-\&;d :cs find d <C-R>=expand("<cword>")<CR><CR> :cw<CR>"nmap <C-_>s :cs find s <C-R>=expand("<cword>")<CR><CR>"nmap <C-_>g :cs find g <C-R>=expand("<cword>")<CR><CR>"nmap <C-_>c :cs find c <C-R>=expand("<cword>")<CR><CR>"nmap <C-_>t :cs find t <C-R>=expand("<cword>")<CR><CR>"nmap <C-_>e :cs find e <C-R>=expand("<cword>")<CR><CR>"nmap <C-_>f :cs find f <C-R>=expand("<cfile>")<CR><CR>"nmap <C-_>i :cs find i ^<C-R>=expand("<cfile>")<CR>$<CR>"nmap <C-_>d :cs find d <C-R>=expand("<cword>")<CR><CR>  " Using 'CTRL-spacebar' then a search type makes the vim window" split horizontally, with search result displayed in" the new window.  nmap <C-Space>s :scs find s <C-R>=expand("<cword>")<CR><CR>nmap <C-Space>g :scs find g <C-R>=expand("<cword>")<CR><CR>nmap <C-Space>c :scs find c <C-R>=expand("<cword>")<CR><CR>nmap <C-Space>t :scs find t <C-R>=expand("<cword>")<CR><CR>nmap <C-Space>e :scs find e <C-R>=expand("<cword>")<CR><CR>nmap <C-Space>f :scs find f <C-R>=expand("<cfile>")<CR><CR>nmap <C-Space>i :scs find i ^<C-R>=expand("<cfile>")<CR>$<CR>nmap <C-Space>d :scs find d <C-R>=expand("<cword>")<CR><CR>  " Hitting CTRL-space *twice* before the search type does a vertical" split instead of a horizontal one  nmap <C-Space><C-Space>s\:vert scs find s <C-R>=expand("<cword>")<CR><CR>nmap <C-Space><C-Space>g\:vert scs find g <C-R>=expand("<cword>")<CR><CR>nmap <C-Space><C-Space>c\:vert scs find c <C-R>=expand("<cword>")<CR><CR>nmap <C-Space><C-Space>t\:vert scs find t <C-R>=expand("<cword>")<CR><CR>nmap <C-Space><C-Space>e\:vert scs find e <C-R>=expand("<cword>")<CR><CR>nmap <C-Space><C-Space>i\:vert scs find i ^<C-R>=expand("<cfile>")<CR>$<CR>nmap <C-Space><C-Space>d\:vert scs find d <C-R>=expand("<cword>")<CR><CR>  """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

使用时:

文件代码很多时输入:

生成索引 !ctags -R –fields=+lS –c++-kinds=+p –fields=+iaS –extra=+q (echofunc) (omnicppcomplete) !cscope -Rbkq

————————————————————————————————————————————-

windows下的把

ctags.exe,

cscope.exe,curses2.dll,regex2.dll放到$(vim)\vim73

还有windows的cscope 不支持 -q选项

—————————————————————————


如果可以,我真想和你一直旅行。或许是某个未开发的荒凉小岛,

用linux装逼-&gt;我的vim配置(不定时更新) – c

相关文章:

你感兴趣的文章:

标签云: