QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1112|回复: 1

原创 linux下vimrc配置文件 for开发者

[复制链接]
发表于 2004-3-29 12:16:45 | 显示全部楼层 |阅读模式
无双 无双小站mushuang.forumer.com loveunix.net
http://mushuang.forumer.com/index.php?showtopic=61

set nocompatible
syntax on

filetype plugin indent on
let Tlist_Ctags_Cmd = '/usr/bin/ctags'
let Tlist_WinWidth=25

set backupdir=/tmp
set dir=/tmp

"set guifont=-misc-fixed-medium-r-normal-*-16-120-100-100-c-90-gb2312.1980-0
set guifont=FixedsysTTF:h16   "如果没有这个字体那就不要加
set tabstop=8
"colorscheme blue               "在gvim下可以看到有多少coloscheme
colorscheme ps_color          "如果没有 那修改成desert 我觉得这个也不错

set wmnu                            "按tab时可以显示出匹配命令
set sw=4      " shiftwidth   
set softtabstop=4
set et        " expandtab
set wm=8      " wrapmargin
set bs=2      " backspace
set ru        " ruler
set ic        " ignorecase      "忽略大小写 但是输入中有大写的话不忽略
set is        " incsearch
set scs       " smartcase: override the 'ic' when searching
set magic
"     if search pattern contains uppercase char
set vb t_vb=  " set visual bell and disable screen flash
set backup    " enable backup and define the backup file
set backupext=.bak
set hlsearch  " hlsearch
" allow backspacing over everything in
" the insert mode
set backspace=indent,eol,start
set dir=/tmp
" 设置swap文件的目录上面
set backupdir=/tmp
"设置备份文件的目录上面 我不喜欢看到每个目录下都有备份 因为一般备份用不到
" some nice options for cindenting  by FOLKE
"set cinoptions={.5s,+.5s,t0,n-2,p2s,(03s,=.5s,>1s,=1s,:1s



" ----------------------------------------------------------------
" $Id: .vimrc.html,v 1.3 2003/06/16 23:29:15 thouveni Exp $
"
"
" Download <URL:http://touv.ouvaton.org/documents/MyDotFiles/.vimrc>
"
" ----------------------------------------------------------------

" -----------------------------------------------------------
" {{{ 1. General setup
" -----------------------------------------------------------

" Active les plugins et les indeantaions par type de fichier

" Quand on tape un ), vim montre furtivement le ( correspondant.
set showmatch

" ??? use full featured format-options. see "help fo-table for help
       set formatoptions=tcrqn2

" define what are comments
set com&amp; " reset to default
set com^=sr:*\ -,mb:*\ \ ,el:*/ com^=sr://\ -,mb://\ \ ,el:///

" Ajoute une marge ????gauche pour afficher les +/- des replis
set foldcolumn=2

"set cinoptions=:.5s,&gt;1s,p0,t0,(0,g2 " :.5s = indent case statements 1/2 shiftwidth
    " &gt;1s = indent 1 shiftwidth
    " p0 = indent function definitions 0 spaces
    " t0 = indent function return type 0 spaces
    " (0 = indent from unclosed parantheses
    " g2 = indent C++ scope resolution 2 spaces

"set cinwords=if,else,while,do,for,switch,case " Which keywords should indent

set formatoptions=tcqor " t=text, c=comments, q=format with "gq", o,r=autoinsert comment leader
"set cindent    " indent on cinwords
" }}}




" -----------------------------------------------------------
" {{{ 3. Searching, Substituting
" -----------------------------------------------------------

" !!! use 'g'-flag when substituting (subst. all matches in that line, not only first)
" to turn off, use g (why is there no -g ?)
" set gdefault

" -----------------------------------------------------------
" {{{ 4. Statusline, Menu
" -----------------------------------------------------------

" ignore some files for filename completion
set wildignore=*.o,*.r,*.so,*.sl,*.tar,*.tgz

" some filetypes got lower priority
set su=.h,.bak,~,.o,.info,.swp,.obj

" remember last 2000 typed commands
set hi=2000

" show cursor position below each window
set ruler

" shows the current status (insert, visual, ...) in statusline
set showmode

" use shortest messages
set shm=a

" show always statusline of last window
set laststatus=2

" }}}


" -----------------------------------------------------------
" {{{ 5. window handling
" -----------------------------------------------------------

" focus follows mouse
set mousef

" minimal number of lines used for the current window
set wh=1

" minimal number of lines used for any window
set wmh=0

" make all windows the same size when adding/removing windows
set noequalalways

"a new window is put below the current one
set splitbelow

" }}}


" -----------------------------------------------------------
" {{{ 6. file, backup, path
" -----------------------------------------------------------

set     path+=.,./include,../include,/usr/include,/usr/include/**,/usr/X11R6/include,/usr/local/include

" change to directory of current file automatically
autocmd BufEnter * lcd %:p:h

" }}}






set diffexpr=MyDiff()
function MyDiff()
  let opt = ''
  if &amp;diffopt =~ 'icase' | let opt = opt . '-i ' | endif
  if &amp;diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
  silent execute '!diff -a ' . opt . '"' . v:fname_in . '" "' . v:fname_new . '" &gt; "' . v:fname_out . '"'
endfunction

"自动完成的
iab #i #include
iab #d #define
" Date/Time stamps
" %a - Day of the week
" %b - Month
" %d - Day of the month
" %Y - Year
" %H - Hour
" %M - Minute
" %S - Seconds
" %Z - Time Zone
iab YDATETIME &lt;c-r&gt;=strftime(": %a %b %d, %Y %H:%M:%S")&lt;cr&gt;
map ,L mz1G/Last modified:/e&lt;Cr&gt;CYDATETIME&lt;Esc&gt;`z
map ,date :let @z=strftime("%A %b %d, %Y")&lt;Cr&gt;"zpa
map ,time :let @z=strftime("%H:%M:%S %Z")&lt;Cr&gt;"zpa



nnoremap &lt;silent&gt; &lt;F3&gt; :Tlist&lt;CR&gt;
" Make &lt;F8&gt; diff the current buffer with it's file on disk.
nmap &lt;F8&gt; :w !diff -w -B -c5 -p - % &gt;tmp.diff&lt;CR&gt;:sp tmp.diff&lt;CR&gt;
" Window Manager.  下面的插件到vim.sf.net上下载 分别是taglist
"winmanager
unmap &lt;F1&gt;
nn  &lt;F1&gt; :Tlist&lt;CR&gt;
nn  &lt;F2&gt; :WMToggle&lt;CR&gt;
nn  &lt;F3&gt; zO
nn  &lt;F4&gt; zC
nn  &lt;F5&gt; zR
nn  &lt;F6&gt; zM

"下面是设置自动folder的 而且是根据写C代码设置的 如果你不喜欢使用folder那么可以省略掉 folder就是vs.net里面的折行功能
au BufReadPost *.c,*.cpp    syn region myFold start="{" end="}" transparent fold
au BufReadPost *.c,*.cpp    syn sync fromstart
au BufReadPost *.c,*.cpp    set foldmethod=syntax
"set foldlevel=0
发表于 2004-3-31 00:38:44 | 显示全部楼层
支持一下。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-11-6 21:40 , Processed in 0.042519 second(s), 16 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表