`

欣赏一下这个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
分享到:
评论

相关推荐

    gVim 8.1.498

    gVim 8.1.498是Vim家族中一个功能强大的版本,尤其适合那些喜欢使用图形界面但又欣赏Vim高效编辑方式的用户。通过集成lua、python和ruby等语言的支持,gVim成为了多语言开发者理想的文本编辑工具。无论你是初学者...

    dotfiles:我的点文件

    标签为"Vimscript",意味着这个压缩包很可能包含了Vim编辑器的配置文件,其中可能有.vimrc文件,它是Vim的启动配置脚本,用于设置快捷键、映射、插件和其他高级功能。Vimscript是Vim内置的一种编程语言,用于编写...

    计算机硬件控制_驱动级键盘鼠标同步_PS2接口UDP协议多机协同_基于rabirdwinio和pynput的跨设备输入共享系统_实现多台Windows电脑的键盘鼠标同步操作_支持.zip

    计算机硬件控制_驱动级键盘鼠标同步_PS2接口UDP协议多机协同_基于rabirdwinio和pynput的跨设备输入共享系统_实现多台Windows电脑的键盘鼠标同步操作_支持

    嵌入式八股文面试题库资料知识宝典-TCPIP协议栈.zip

    嵌入式八股文面试题库资料知识宝典-TCPIP协议栈.zip

    少儿编程scratch项目源代码文件案例素材-开膛手杰克.zip

    少儿编程scratch项目源代码文件案例素材-开膛手杰克.zip

    基于深度学习CNN网络+pytorch框架实现遥感图像滑坡识别源码+数据集+训练好的模型

    基于深度学习CNN网络+pytorch框架实现遥感图像滑坡识别源码+数据集+训练好的模型,个人经导师指导并认可通过的高分设计项目,评审分99分,代码完整确保可以运行,小白也可以亲自搞定,主要针对计算机相关专业的正在做大作业的学生和需要项目实战练习的学习者,可作为毕业设计、课程设计、期末大作业,代码资料完整,下载可用。 基于深度学习CNN网络+pytorch框架实现遥感图像滑坡识别源码+数据集+训练好的模型基于深度学习CNN网络+pytorch框架实现遥感图像滑坡识别源码+数据集+训练好的模型基于深度学习CNN网络+pytorch框架实现遥感图像滑坡识别源码+数据集+训练好的模型基于深度学习CNN网络+pytorch框架实现遥感图像滑坡识别源码+数据集+训练好的模型基于深度学习CNN网络+pytorch框架实现遥感图像滑坡识别源码+数据集+训练好的模型基于深度学习CNN网络+pytorch框架实现遥感图像滑坡识别源码+数据集+训练好的模型基于深度学习CNN网络+pytorch框架实现遥感图像滑坡识别源码+数据集+训练好的模型基于深度学习CNN网络+pytorch框架实现遥感图像滑坡识别源码+数据集+训练好的模型基于深度学习CNN网络+pytorch框架实现遥感图像滑坡识别源码+数据集+训练好的模型基于深度学习CNN网络+pytorch框架实现遥感图像滑坡识别源码+数据集+训练好的模型基于深度学习CNN网络+pytorch框架实现遥感图像滑坡识别源码+数据集+训练好的模型基于深度学习CNN网络+pytorch框架实现遥感图像滑坡识别源码+数据集+训练好的模型基于深度学习CNN网络+pytorch框架实现遥感图像滑坡识别源码+数据集+训练好的模型基于深度学习CNN网络+pytorch框架实现遥感图像滑坡识别源码+数据集+训练好的模型基于深度学习CNN网络+pytorch框架实现

    电力弹簧技术在主动配电网规划与运行优化调度中的应用研究

    内容概要:本文详细探讨了电力弹簧技术在主动配电网规划及运行优化调度中的应用。首先介绍了电力弹簧技术作为智能电网调控手段的优势,如自适应性强、响应速度快、节能环保等。接着阐述了主动配电网规划的目标和策略,包括优化电网结构、提高能源利用效率和降低故障风险。随后讨论了运行优化调度的原则和方法,强调了实时监测、智能调度策略以及优化调度模型的重要性。最后通过实际案例分析展示了电力弹簧技术在提升电网稳定性、可靠性和能效方面的显著效果,展望了其广阔的应用前景。 适合人群:从事电力系统规划、运行管理的研究人员和技术人员,以及对智能电网感兴趣的学者和学生。 使用场景及目标:适用于希望深入了解电力弹簧技术及其在主动配电网规划和运行优化调度中具体应用的专业人士。目标是掌握电力弹簧技术的工作原理、优势及其在实际项目中的实施方法。 其他说明:本文不仅提供了理论分析,还有具体的案例支持,有助于读者全面理解电力弹簧技术的实际应用价值。

    嵌入式八股文面试题库资料知识宝典-C语言思维导图.zip

    嵌入式八股文面试题库资料知识宝典-C语言思维导图.zip

    电路教学与科研案例的结合—以最大功率传输定理为例.pdf

    电路教学与科研案例的结合—以最大功率传输定理为例.pdf

    【HarmonyOS文件系统】分布式架构下的多设备协同与文件管理:构建万物互联新生态

    内容概要:本文深入介绍了HarmonyOS文件系统及其在万物互联时代的重要性。HarmonyOS自2019年发布以来,逐步覆盖多种智能设备,构建了庞大的鸿蒙生态。文件系统作为其中的“数字管家”,不仅管理存储资源,还实现多设备间的数据协同。文章详细介绍了常见的文件系统类型,如FAT、NTFS、UFS、EXT3和ReiserFS,各自特点和适用场景。特别强调了HarmonyOS的分布式文件系统(hmdfs),它通过分布式软总线技术,打破了设备界限,实现了跨设备文件的无缝访问。此外,文章对比了HarmonyOS与Android、iOS文件系统的差异,突出了其在架构、跨设备能力和安全性方面的优势。最后,从开发者视角讲解了开发工具、关键API及注意事项,并展望了未来的技术发展趋势和对鸿蒙生态的影响。 适合人群:对操作系统底层技术感兴趣的开发者和技术爱好者,尤其是关注物联网和多设备协同的用户。 使用场景及目标:①理解HarmonyOS文件系统的工作原理及其在多设备协同中的作用;②掌握不同文件系统的特性和应用场景;③学习如何利用HarmonyOS文件系统进行应用开发,提升跨设备协同和数据安全。 阅读建议:本文内容详实,涵盖了从基础概念到高级开发技巧的多个层次,建议读者结合自身需求,重点关注感兴趣的部分,并通过实践加深理解。特别是开发者可参考提供的API示例和开发技巧,尝试构建基于HarmonyOS的应用。

    嵌入式八股文面试题库资料知识宝典-海康嵌入式笔试题.zip

    嵌入式八股文面试题库资料知识宝典-海康嵌入式笔试题.zip

    三电平有源电力滤波器仿真:基于瞬时无功功率理论的双闭环控制与SVPWM调制技术

    内容概要:本文详细介绍了基于瞬时无功功率理论的三电平有源电力滤波器(APF)仿真研究。主要内容涵盖并联型APF的工作原理、三相三电平NPC结构、谐波检测方法(ipiq)、双闭环控制策略(电压外环+电流内环PI控制)以及SVPWM矢量调制技术。仿真结果显示,在APF投入前后,电网电流THD从21.9%降至3.77%,显著提高了电能质量。 适用人群:从事电力系统研究、电力电子技术开发的专业人士,尤其是对有源电力滤波器及其仿真感兴趣的工程师和技术人员。 使用场景及目标:适用于需要解决电力系统中谐波污染和无功补偿问题的研究项目。目标是通过仿真验证APF的有效性和可行性,优化电力系统的电能质量。 其他说明:文中提到的仿真模型涉及多个关键模块,如三相交流电压模块、非线性负载、信号采集模块、LC滤波器模块等,这些模块的设计和协同工作对于实现良好的谐波抑制和无功补偿至关重要。

    基于环比增长的销售统计分析——2019年中青杯全国数学建模竞赛C题.pdf

    基于环比增长的销售统计分析——2019年中青杯全国数学建模竞赛C题.pdf

    嵌入式八股文面试题库资料知识宝典-linux面试题.zip

    嵌入式八股文面试题库资料知识宝典-linux面试题.zip

    嵌入式八股文面试题库资料知识宝典-linux常见面试题.zip

    嵌入式八股文面试题库资料知识宝典-linux常见面试题.zip

    基于Matlab的小电流接地系统单相故障仿真分析及其应对策略研究

    内容概要:本文探讨了小电流接地系统在配电网络中的应用,特别是在单相故障情况下的仿真分析。文中介绍了小电流接地系统的背景和发展现状,重点讨论了两种常见的接地方式——中性点不接地和中性点经消弧线圈接地。利用Matlab作为仿真工具,作者构建了详细的电路模型,模拟了单相故障的发生过程,并通过多个结果图表展示了故障电流、电压波形及系统运行状态。此外,文章还包括了详细的设计说明书和PPT介绍,帮助读者全面理解仿真过程和技术细节。 适合人群:从事电力系统研究、维护的技术人员,尤其是关注配电网络安全和稳定的工程师。 使用场景及目标:适用于希望深入了解小电流接地系统的工作原理和故障处理机制的专业人士。通过本研究,读者可以掌握如何使用Matlab进行电力系统仿真,评估不同接地方式的效果,优化配电网络的安全性能。 其他说明:随文附带完整的仿真工程文件、结果图、设计说明书及PPT介绍,便于读者进一步探索和实践。

    少儿编程scratch项目源代码文件案例素材-激烈的殴斗.zip

    少儿编程scratch项目源代码文件案例素材-激烈的殴斗.zip

    嵌入式八股文面试题库资料知识宝典-小米嵌入式软件工程师笔试题目解析.zip

    嵌入式八股文面试题库资料知识宝典-小米嵌入式软件工程师笔试题目解析.zip

    车辆主动避撞技术:紧急制动与紧急转向策略及其临界安全距离分析

    内容概要:本文详细探讨了车辆主动避撞技术中的两种常见策略——纵向紧急制动避撞和横向紧急转向避撞。首先介绍了这两种避撞策略的基本概念,接着深入分析了临界纵向安全距离的概念及其对避撞模式选择的影响。文中特别强调了五次多项式换道轨迹模型在计算横向紧急转向避撞安全距离中的应用。最后,通过一个简化的程序实现了避撞策略的模拟和可视化展示,帮助读者更好地理解不同避撞方式的应用场景和技术细节。 适合人群:汽车工程技术人员、交通安全研究人员、自动驾驶开发者。 使用场景及目标:适用于研究和开发车辆主动避撞系统的专业人士,旨在提高对避撞策略的理解,优化避撞算法的设计,提升行车安全性。 其他说明:文章不仅提供了理论分析,还结合了具体的数学模型和程序实现,使读者能够从多个角度全面掌握车辆避撞技术的关键要素。

    基于MPPSK调制的数字对讲机系统.pdf

    基于MPPSK调制的数字对讲机系统.pdf

Global site tag (gtag.js) - Google Analytics