免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1165 | 回复: 0
打印 上一主题 下一主题

一个老外的vimrc [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-10-27 14:12 |只看该作者 |倒序浏览
" =======================================================
" Vim configuration file
" Author: Nico Golde
" Homepage: http://www.ngolde.de
" ~/.vimrc
" Latest change: So Aug 12 12:57:06 CEST 2007
" =======================================================
" ========================================
" Settings
" ========================================
" muttng setting
au BufNewFile,BufRead muttng-*-\w\+,muttng\w\{6\},ae\d setf mail
" Temporary reportbug files.
augroup filetype
au BufRead reportbug.*                set ft=mail
au BufRead reportbug-*                set ft=mail
augroup END
" settings for the c language
au FileType c,h           set ai et sw=4 ts=4 noexpandtab cindent omnifunc=ccomplete#Complete
au FileType c,h          color pablo
" no line numbers in mail
au FileType mail set nonu fo=tcrqw
" show the laststatus line always
set laststatus=2
" give cursor position
set ruler
" number of undos
set undolevels=200
" jump to the word you search during you type
set incsearch
set ignorecase
" do i have a fast terminal?
set nottyfast
" german spellfile
set spelllang=de
" highligth search results
set hlsearch
" make no backups
"set nobackup
" we use a dark background
set background=dark
" fuck the beeps
set noerrorbells
" for hidden buffers
set hidden
set smartindent
" continue searching at top when hitting bottom
set wrapscan
"always show the command
set showcmd
" Continue searching at top when hitting bottom
set wrapscan
set smarttab
" show all changes
set report=0
" highlight current line
set cursorline
" Highlight matching parens
set matchpairs=(:),[:],{:},
" no the terminal is not always fast
set nottyfast
" use autoindent
set autoindent
" expand tabs
set expandtab
" how many spaces for indenting
set shiftwidth=4
" fancy menu
set wildmenu
" display utf-8 chars
" set encoding=utf-8
" enumerate Lines
set nu
" substitude tabs with ?and trailing spaces with ?"set list listchars=tab:>?trail:?eol:$
set list listchars=tab:>?trail:?" after 75 characters write a swap file
set uc=75
" tab width
set tabstop=4
" do not behave like vi, vi is dead
set nocompatible
" use color sheme
" color ron
" color pablo
" use the modelines commands
set modeline
" use 3 lines for modelines
set modelines=3
" use , as mapleader variable
let mapleader=","
" Use brighter colors if your xterm has a dark background.
if &term =~ "xterm"
  set background=dark
endif
"========================
" Syntaxhiglighting
"========================
let color = "true"
if has("syntax")
    if color == "true"
        " This will switch colors ON
so ${VIMRUNTIME}/syntax/syntax.vim
    else
        " this switches colors OFF
syntax off
set t_Co=0
    endif
endif
if version>=700
    set pumheight=7
endif
" comment types
set comments=b:#,:%,fb:-,n:),n:> fo=cqrt
" force using hjkl$
noremap        :echoerr "Use k instead!"$
noremap      :echoerr "Use j instead!"$
noremap      :echoerr "Use l instead!"$
noremap     :echoerr "Use h instead!"$,
"fix pasting so you dont get the step down effect
"nnoremap  :set invpaste paste?
" ==========================================================
" Abriviations
" ==========================================================
"
" urls
iab NGOLDE http://www.ngolde.de
iab Wklass http://www.abschlussfotos.de.vu
" spelling mistakes
iab packet paket
iab Packet Paket
iab nat黵lcih nat黵lich
iab felher fehler
iab atle alte
iab paranoit paranoid
iab Standart Standard
iab herran hera
iab ider oder
iab alos also
iab charcter character
iab examlpe example
iab nciht nicht
iab Netwokr     Network
iab Srever      Server
iab Standart    Standard
iab standart    standard
iab SIe         Sie
iab ICh         Ich
iab cih         ich
iab shc         sch
iab amchen      machen
iab amche       mache
iab Linx        Linux
" Jargon File
iab JARGON http://www.catb.org/~esr/jargon/
" usefull for mail formatting
iab sn [...]
" give current date
iab DATE =strftime("%a %b %d %T %Z %Y")
" my name + email address
ab ngg Nico Golde
" ==============================================
" Mappings
" ==============================================
" use Exp for file explorer
" :help 42
" :help holy-grail
" use shell with ctrl-z
map  :shell
map ;0 :'!boxes -d netdata
map ;1 :'!boxes -d boxquote
map ;2 :'!boxes -d peek -a c -s 40x5
map ;3 :'!boxes -d c-cmt
map ;4 :'!boxes -d dog -a c
map ;5 :'!boxes -d simple -a jr
map ;6 :'!boxes -d headline
" delete the text until start of the mail signature with ,k
map k d/^-- $
" line numbering
map ln :%s/^/\=line('.')/
" add a comment
map ,mkc i/*  */
" with ,a give a greeting to the person you write a mail
map a  G/^\* /e+1ye1G}oHallo ",
" change mail subjects
map sw 1G/^Subject: :s/Re:/was:/Wi ($)0Whi
" change the FROM:
map  1G/^From: /e+1CNico Golde
map  1G/^From: /e+1CNico Golde
" : Toggle list (display unprintable characters).
nnoremap  :set list!
" F7: Write a ChangeLog entry.
map  :r !dateA Nico Golde  * |
" search ~/.website
nmap s :r!grep  '' ~/.website
" write and read from and to ftp
nmap r :Nread ftp://
nmap w :Nwrite ftp://
imap  cit
" show trailing white spaces
  nmap Sws :%s/ /?g
  vmap Sws :%s/ /?g
" see the top of this document
  map L  1G/Letzte 膎derung:\s*/e+1CDATE
  map l  1G/Latest change:\s*/e+1CDATE
  map v  1G/Version:\s*/e+1CDATE
" delete all the fzcking ^M's
  map M :%s/\r//g
" show original date of mail if the mail client from the sender sets valid
" msgid's
  map ## 1G/^In-ReyypdWx14lD:s/^\(\d\d\d\d\)\(\d\d\)\(\d\d\)\(\d\d\)\(\d\d\)\(\d\d\)/\1-\2-\3 \4:\5:\6/
  nnoremap Q gq
  vnoremap Q gq
" show trailing spaces at the end of the lines
  nmap tw :%s/  *$/_/g
  vmap tw :%s/  *$/_/g
" delete this whitespaces
"   nmap  :%s/\s\+$//
"   vmap   :s/\s\+$//
" Spellcheck.
map ,V :!ispell -x %:e!
" attachments
map __a_start :imap  __a_cmd\|imap  __a_end\|imap  \|imap  
noremap __a_end :iunmap \|iunmap \|iunmap \|iunmap dd`a:"Attach mode ended.
noremap __a_cmd oAttach:
noremap __a_scmd 1G/^$/:nohOAttach:
map ,A ma__a_start__a_scmd
" use jj instead of esc to change the mode
"   inoremap jj
" reformat mails
   map           :set tw-=2gqip
   vmap      :set tw-=2gvgqgv
   map           :set tw+=2gqip
   vmap      :set tw+=2gvgqgv
" use pon and poff instead of set no/paste
map pon  :set paste$
imap pon  :set pastea$
map poff :set nopaste$
imap poff :set nopastea$
" convert text2html
map ,h :runtime! syntax/2html.vim
"spelling
map  :set spell!:echo "Spell Check: " . strpart("OffOn", 3 * &spell, 3)
map  :set spelllang=en:set spell!:echo "Spell Check: " . strpart("OffOn", 3 * &spell, 3)
" FTPing with vim
map fr :Nread ftp://www.ngolde.de/index.html
map fw :Nwrite ftp://www.ngolde.de/index.html
" ============================================
" Highlighting
" ============================================
syntax match nico "Nico"
highlight nico ctermbg=Red
syntax match golde "Golde"
highlight golde ctermbg=Red
syntax match linux "Linux"
highlight linux ctermfg=Green
" let me know http://www.ngolde.de  
syntax match yacpi "Yacpi"
highlight yacpi ctermfg=Yellow
" hi cursorline    term=none ctermbg=blue
" hi cursorcolumn  term=none ctermbg=red
" The Shell in a Box mode.
"  Requires zsh for "print -P $PS1 / replace if needed.
" Your prompt should end in > (and only contain one)
" map __start :imap  __cmd\|imap  __end
" noremap __end :iunmap \|iunmap :"Vish ended.
" noremap __cmd 0f>ly$:r !";print -P $PS1A
" noremap __scmd :r !print -P $PS1A
" map ,s __start__scmd
" ==================================
" Useful stuff
" ==================================
"
" * Use % to jump from an open brace to its matching closing brace. Or from
"   a "#if" to the matching "#endif". Actually, % can jump to many different
"   matching items. It is very
"   useful to check if () and {} constructs are balanced properly.
" * Use [{ to jump back to the "{" at the start of the current code block.
" * Use gd to jump from the use of a variable to its local declaration."
" * Using the "*" key searches for the word under the cursor, use "#" to do the same thing backwards.
" * Using the "%" key on brackets {} () [] will find the matching one.
" * Using the "." key will repeat last change
" * Hitting "gf" will open the file under cursor
" * bufdo ... will apply "..." to all open buffers
" * (Insert Mode) Control-n and Control-p will autocomplete the current word
"   by looking forward or backward in the currently open file(s). Can be bound to
"   tab by using SuperTab. Check out the help for 'complete' to set where Vim will
"   search for autocomplete words.
" * :g/this/d applies an Ex command to all lines that match "this" -- if you
"    are uncomfortable with Ex command, you can go into normal mode. :g/this/normal
"    dd (just like hitting "dd" in normal mode on any line with "this" in it)
" * >> and
http://nion.modprobe.de/setup/vimrc


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/81965/showart_1339833.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP