Chinaunix首页 | 论坛 | 博客
  • 博客访问: 239592
  • 博文数量: 52
  • 博客积分: 2263
  • 博客等级: 大尉
  • 技术积分: 695
  • 用 户 组: 普通用户
  • 注册时间: 2008-07-28 12:00
文章分类

全部博文(52)

文章存档

2010年(2)

2009年(20)

2008年(30)

分类:

2009-04-23 11:08:17

我的vimrc:



     

      F1      水平分屏显示perl support help infomation

      F2     水平分屏显示bash support help infomation

      F3     命令模式下在行首加# (加注释)

      F4     保存退出

      F7     减小当前窗口大小

      F8     增大当前窗口大小

      F9     perl debug

      ctrl+z 挂起

      ctrl+c 不保存退出

      摘要注释


加入了perl ide 和 bash ide 插件。
需要到vim网站上下载。





下载到/usr/share/vim/vim70/下,解压;
再加个软链接
cd
/usr/share/vim/ && ln -s vim70 vimfiles

下面是。vimrc内容


"allow backspacing over everything in insert mode
set backspace=indent,eol,start

"----------------------------- add by luoxl ---------------------------
"set the lastates line always
set laststatus=2

"number of undos
set undolevels=200

"jump to the word that you search for
set incsearch           " do incremental searching


" highlight search result
set hlsearch

" make no bachup
set nobackup

" we use a darkness backgound
"set background=dark

" fuck the beeps
set noerrorbells

" for hidden buffer
set hidden
set smartindent

" for continue searching at top when hitting buttom
set wrapscan
set smarttab

" always show the command
set showcmd

"show all changes
set report=0

" highlight current line
set cursorline

" highlight matching parens
set matchpairs=(:),[:],{:},<:>

" use auto indent
set autoindent

" expend tabs
set expandtab

" how many spaces for indenting
set shiftwidth=4

" fancy menu
set wildmenu

" display utf-8 chars  and set encoding = utf-8
set encoding=utf-8

set number

" after 75 characters write a swap file
set uc=75

" tab width
set tabstop=4

" do not bahave like as vi , vi is dead
set nocompatible

" use color shema
"colo desert
"color pablo

set modeline

" use 3 lines for modelines
set modelines=3

" use , as mapleader variable
let mapleader=","

" use ignorecase
set ignorecase

filetype on
filetype plugin on
filetype indent on


"============================
"    Syntax highlighting
"============================
syntax on

if version>=700
        set pumheight=7
endif
"==========================================================================================
"  mapping
"==========================================================================================
" use F1 for open perl support help
map :help perlsupport
imap :help perlsupport

" use F2 for open bash support help
map :help bashsupport
imap :help bashsupport

" use F3 for add a comment
map I#
imap I#

" use F4 for save and exit
map :wq
imap :wq

" use F5 for run perl sripts
"map :call runPerl()

"==========================================================================================
" use ^c for not save and exit
map :q!
imap :q!

" use ^z for shell
map :sh
imap :sh

" use Q for format comments
map Q gq
imap Q gq
"==========================================================================================
" use F8 for reduce window size
map -
imap -

" use F9 for increase window size
map +
imap +
"==========================================================================================
" add for run perl map
"function runPerl()
   " save the current script
"   exec "w"
   " display output infomation
"   exec "!perl %"
"endfunction

" add for run bash map
"function runBash()
   " save the current script
"   exec "w"
   " display output infomation                                                                                                               
"   exec "!sh %"
"endfunction


" my title:
function Mytitle()
    call setline(1,"")
    call append(line("."),"# Power by: lll0905@163.com")
    call append(line(".")+1,"#     Time: ".strftime("%c"))
    call append(line(".")+2,"# Function:")
    call append(line(".")+3,"# ")
    call append(line(".")+4,"#   para_1: ")
    call append(line(".")+5,"#   para_2: ")
    call append(line(".")+6,"#   para_3: ")
    call append(line(".")+7,"#   para_4: ")
    call append(line(".")+8,"#   para_5: ")
    "call append(line(".")+2,"#function:".expand("%"))
endfunction
map :call Mytitle()
imap :call Mytitle()
"====================================
" ab  --   word map as another word
"====================================
ab lll lll0905@163.com
ab fun function (){    }
"----------------------------- add by luoxl --------------------------

阅读(1769) | 评论(0) | 转发(0) |
0

上一篇:vim turning

下一篇:tomcat install + config

给主人留下些什么吧!~~