VIM配置,F5自动运行脚本

来源:互联网 发布:linux中查看日志文件 编辑:程序博客网 时间:2024/06/02 04:04
set syntax=on
set noeb
set confirm
set autoindent
set cindent
set tabstop=4
set softtabstop=4
set shiftwidth=4
set noexpandtab
set number
set history=10000
set nobackup
set noswapfile
set hlsearch
set incsearch
" set enc=utf-8
" set fencs=utf-8,ucs-bom,shift-jis,gb18030,gbk,gb2312,cp936
" set langmenu=zh_CN.UTF-8
" set helplang=cn
set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [POS=%l,%v][%p%%]\ %{strftime(\"%d/%m/%y\ -\ %H:%M\")}
set laststatus=2
set ruler
set cmdheight=2
filetype on
filetype plugin on
filetype indent on
set viminfo+=!
set iskeyword+=_,$,@,%,#,-
set linespace=0
set wildmenu
set report=0
set showmatch
set matchtime=5
set scrolloff=5
set smartindent
if has("autocmd")
   autocmd FileType xml,html,c,cs,java,perl,shell,bash,cpp,python,vim,php,ruby set number
   autocmd FileType xml,html vmap <C-o> <ESC>'<i<!--<ESC>o<ESC>'>o-->
   autocmd FileType java,c,cpp,cs vmap <C-o> <ESC>'<o/*<ESC>'>o*/
   autocmd FileType html,text,php,vim,c,java,xml,bash,shell,perl,python setlocal textwidth=100
   autocmd Filetype html,xml,xsl source $VIMRUNTIME/plugin/closetag.vim
   autocmd BufReadPost *
      \ if line("'\"") > 0 && line("'\"") <= line("$") |
      \   exe "normal g`\"" |
      \ endif
endif " has("autocmd")
map <F5> :call RunPerl()<CR>
func! RunPerl()
exec "w" 
exec "! /usr/bin/perl -w ./% "
endfunc
set foldenable
set foldmethod=manual
nnoremap <space> @=((foldclosed(line('.')) < 0) ? 'zc' : 'zo')<CR>
原创粉丝点击