`

欣赏一下这个vimrc

阅读更多
" =======================================================
" Vim configuration file
" Author: Nico Golde <nico@ngolde.de>
" 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 <Up>       :echoerr "Use k instead!"<CR>$
noremap <Down>     :echoerr "Use j instead!"<CR>$
noremap <Left>     :echoerr "Use l instead!"<CR>$
noremap <Right>    :echoerr "Use h instead!"<CR>$,
"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 <C-R>=strftime("%a %b %d %T %Z %Y")<CR>

" my name + email address
ab ngg Nico Golde <nico@ngolde.de>

" ==============================================
" Mappings
" ==============================================

" use Exp for file explorer
" :help 42
" :help holy-grail

" use shell with ctrl-z
map <C-Z> :shell


map ;0 <ESC>:'<,'>!boxes -d netdata
map ;1 <ESC>:'<,'>!boxes -d boxquote
map ;2 <ESC>:'<,'>!boxes -d peek -a c -s 40x5
map ;3 <ESC>:'<,'>!boxes -d c-cmt
map ;4 <ESC>:'<,'>!boxes -d dog -a c
map ;5 <ESC>:'<,'>!boxes -d simple -a jr
map ;6 <ESC>:'<,'>!boxes -d headline

" delete the text until start of the mail signature with ,k 
map <LEADER>k d/^-- $<CR>

" line numbering
map <LEADER>ln :%s/^/\=line('.')/<CR><ESC>

" add a comment
map ,mkc i/*  */<Left><Left><Left>
" with ,a give a greeting to the person you write a mail
map <LEADER>a  G/^\* /e+1<CR>ye1G}oHallo <c-r>",<cr><ESC>

" change mail subjects
map <LEADER>sw 1G/^Subject: <CR>:s/Re:/was:/<CR>Wi (<C-O>$)<ESC>0Whi

" change the FROM: 
map <f12> 1G/^From: /e+1<CR>CNico Golde <nico@ngolde.de><ESC>
map <f11> 1G/^From: /e+1<CR>CNico Golde <nion@debian.org><ESC>
" <F6>: Toggle list (display unprintable characters).
 nnoremap <F8> :set list!<CR>
" F7: Write a ChangeLog entry.
map <F7> :r !date<CR>A Nico Golde <nico@ngolde.de><CR><CR> * |
" search ~/.website 
nmap <LEADER>s :r!grep  '' ~/.website<S-Left><S-Left><right>

" write and read from and to ftp
nmap <LEADER>r :Nread ftp://
nmap <LEADER>w :Nwrite ftp:// 

imap <F10> <C-O>cit

" show trailing white spaces
  nmap <LEADER>Sws :%s/ /?g<C-M>
  vmap <LEADER>Sws :%s/ /?g<C-M>

" see the top of this document
  map <LEADER>L  1G/Letzte 膎derung:\s*/e+1<CR>CDATE<ESC>
  map <LEADER>l  1G/Latest change:\s*/e+1<CR>CDATE<ESC>
  map <Leader>v  1G/Version:\s*/e+1<CR>CDATE<ESC>

" delete all the fzcking ^M's
  map <LEADER>M :%s/\r//g<CR>

" show original date of mail if the mail client from the sender sets valid
" msgid's
  map ## 1G/^In-Re<cr>yypdWx14lD:s/^\(\d\d\d\d\)\(\d\d\)\(\d\d\)\(\d\d\)\(\d\d\)\(\d\d\)/\1-\2-\3 \4:\5:\6/<cr>

  nnoremap Q gq
  vnoremap Q gq

" show trailing spaces at the end of the lines 
  nmap <LEADER>tw :%s/  *$/_/g<C-M>
  vmap <LEADER>tw :%s/  *$/_/g<C-M>

" delete this whitespaces
"   nmap <f11> :%s/\s\+$//
"   vmap <f11>  :s/\s\+$//

" Spellcheck.
map ,V :!ispell -x %<CR>:e!<CR><CR>


" attachments
map __a_start :imap <C-V><CR> <C-O>__a_cmd\|imap <C-V><ESC> <C-V><ESC>__a_end\|imap <C-V><C-V><C-V><C-I> <C-V><C-N>\|imap <C-V><C-N> <C-V><C-X><C-V><C-F><CR>
noremap __a_end :iunmap <C-V><CR>\|iunmap <C-V><ESC>\|iunmap <C-V><C-V><C-V><C-I>\|iunmap <C-V><C-V><C-V><C-N><CR>dd`a:"Attach mode ended.<CR>
noremap __a_cmd oAttach:<Space>
noremap __a_scmd 1G/^$/<CR>:noh<CR>OAttach:<Space>
map ,A ma__a_start__a_scmd

" use jj instead of esc to change the mode
"   inoremap jj <esc>

" reformat mails
   map <F5>          :set tw-=2<cr>gqip
   vmap <F5>     <esc>:set tw-=2<cr>gvgqgv
   map <F6>          :set tw+=2<cr>gqip
   vmap <F6>     <esc>:set tw+=2<cr>gvgqgv
" use pon and poff instead of set no/paste
map <Leader>pon  :set paste<CR>$
imap <Leader>pon  <Esc>:set paste<CR>a$
map <Leader>poff :set nopaste<CR>$
imap <Leader>poff <Esc>:set nopaste<CR>a$

" convert text2html
map ,h :runtime! syntax/2html.vim 
"spelling
map <F2> :set spell!<CR><Bar>:echo "Spell Check: " . strpart("OffOn", 3 * &spell, 3)<CR>
map <F3> :set spelllang=en<CR>:set spell!<CR><Bar>:echo "Spell Check: " . strpart("OffOn", 3 * &spell, 3)<CR>

" FTPing with vim
map <LEADER>fr :Nread ftp://www.ngolde.de/index.html
map <LEADER>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 <C-V><C-M> <C-O>__cmd<C-V>\|imap <C-V><ESC> <C-V><ESC>__end<C-M>
" noremap __end :iunmap <C-V><CR>\|iunmap <C-V><ESC><C-M>:"Vish ended.<C-M>
" noremap __cmd 0<ESC>f>ly$:r !<C-R>";print -P $PS1<C-M>A
" noremap __scmd :r !print -P $PS1<c-M>A
" 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 << to indent
" * If you have really long lines and wrapping turned on, you can map j and k
" to move down/up to the next visible line by doing ":nmap j gj" and ":nmap k
" gk"

" not to self:
" J     Attaches the next line to the end of the current line (deletes carriage return). ***useful*** 
" JAVH
" vim -c ":%s/^/WhfgTNabgureRIvzSUnpxre/|:%s/[R-T]/ /Ig|:normal ggVGg?"
"vim:tw=80 et sw=4 comments=\:\"


转自:http://nion.modprobe.de/setup/vimrc
分享到:
评论

相关推荐

    vimrc

    在Vim的世界里,`vimrc`(有时也写作`.vimrc`)是一个文本文件,位于用户的主目录下,通常名为`~/.vimrc`或`_vimrc`(Windows系统)。这个文件包含了Vim启动时执行的一系列命令和设定,如快捷键映射、插件配置、颜色...

    vimrc设置命令1

    在这个例子中,它会尝试 `ucs-bom,utf-8,chinese,taiwan,japan,korea,latin1` 这些编码。对于中文环境,根据简体或繁体进行不同的设置,如 `set encoding=chinese` 和 `set termencoding=chinese`。同时,`if v:lang...

    一个比较好用的vimrc

    比较好用的一个vimrc,将其复制到用户目录下,记得重命名为.vimrc

    .vimrc.rar

    这是一个纯文本文件,位于用户的家目录下(通常是`~/.vimrc`),包含了Vim启动时执行的一系列命令和设置。通过修改`.vimrc`,我们可以调整Vim的颜色方案、快捷键、插件、自动缩进规则、语法高亮等众多特性。以下是...

    经典的vimrc配置文件

    最后,`版本3-vimrc-version2-小码哥`可能是一位名叫"小码哥"的开发者分享的配置,这里的`version2`意味着这是他个人配置的第二个版本,相对于之前的版本可能有改进或添加了新的功能。通常,开发者会随着使用经验的...

    自己使用的vimrc,现在分享一下

    - **标题**:“自己使用的vimrc,现在分享一下” 该标题表明作者正在分享他们个人使用的`vimrc`配置文件。`vimrc`是Vim编辑器的一个配置文件,用于定制用户的编辑习惯和个人偏好。 #### 描述解读 - **描述**:...

    vimrc文件vimrc文件

    2. 配置语法:vimrc文件主要包含一系列命令行选项和映射,每行代表一个设置。以冒号(:)开头的行是命令,如`:set number`,而以"map"开头的行则是快捷键映射,如`nnoremap &lt;Leader&gt;w :w&lt;CR&gt;`。 二、常用配置选项 ...

    vimrc 配置

    在这个专题中,我们将深入探讨如何在Ubuntu系统中进行`vimrc`的配置。 首先,我们需要了解`vimrc`文件的位置。在Ubuntu系统中,个人的`vimrc`文件通常位于`~/.vimrc`或`~/.config/vim/vimrc`。如果文件不存在,可以...

    vim-真实使用要改成.vimrc隐藏文件

    mv vimrc .vimrc

    .vimrc配置文件

    这个文件通常存放在用户的主目录下(即`~/.vimrc`),并且在每次启动Vim时都会被读取和执行。 #### 操作系统判断 配置文件首先通过`has()`函数检测操作系统的类型。这里的`win32`, `win64`, 和 `win32unix`分别...

    vimrc vim 配置文件

    通过编辑这个文件,用户可以个性化自己的Vim环境,例如调整颜色方案、设置自动缩进、启用语法高亮、定义快捷键等。以下是一些常见的 `.vimrc` 配置示例: 1. **颜色方案**: ```vim colorscheme desert ``` 这...

    配置文件vimrc

    配置文件vimrc.vimrc

    vimrc vim配置方案 vim配置 vim配色 vim配色方案

    用户可以将这个文件复制到自己的`~/.vimrc`位置,覆盖原有的配置,或者将其内容合并到现有的`vimrc`文件中。这样,用户就可以享受这个精心配置的Vim环境了。 综上所述,`vimrc`文件和Vim的配色方案是提升Vim使用...

    vimrc的配置文件

    vimrc的配置文件,对应博客“linux服务器中安装vimrc的一二三”中的内容

    .vimrc的设置

    为了更好的在vim下进行工作,需要手动设置一个配置文件:.vimrc。 在启动vim时,当前用户根目录下的.vimrc文件会被自动读取,该文件可以包含一些设置甚至脚本,所以,一般情况下把.vimrc文件创建在当前用户的根目录...

    vim插件和配置信息vimrc

    这通常意味着将它们放入`~/.vim`和`~/.vimrc`文件中。`.vim`目录用于存放所有插件,而`.vimrc`文件则存储了用户的个性化设置。例如,要安装一个名为“NERDTree”的文件浏览器插件,你需要将下载的插件文件(通常为`....

    使用vimrc配置vim

    使用vimrc配置Linux中的vim. vim配置vimrc后的优点 1.按F5可以直接编译并执行C、C++、java代码以及执行shell脚本,按“F8”可进行C、C++代码的调试 2.自动插入文件头,新建C、C++源文件时自动插入表头:包括文件名...

    windows下gvim配置_vimrc

    首先,让我们深入了解一下`_vimrc`文件。在Vim中,`.vimrc`或`_vimrc`是启动时读取的配置脚本,用于设置各种选项、映射快捷键、定义高亮样式等。这些配置可以帮助提高开发效率,让GVIM更适合个人的工作流程。文件中...

    C++ 好用的VIMRC

    好用的VIMR C++ 好用的VIMRCC++ 好用的VIMRC

    vim 配置文件 vimrc

    它的灵活性和高度可定制性是其核心特点之一,而这一切都离不开一个关键的配置文件——`vimrc`。`vimrc`文件是Vim启动时读取的配置脚本,允许用户自定义各种设置、快捷键和功能,以适应个人的工作习惯和需求。 1. **...

Global site tag (gtag.js) - Google Analytics