vim html xml 自动补全(在closetag.vim 上作了点修改)

 

 

 

 

 

 

 

 

 

当输入 》时自动补全 当输入《/时自动补全

 

 

“=================================

 

" File: closetag.vim
" Summary: Functions and mappings to close open HTML/XML tags
" Uses: <C-_> -- close matching open tag
" Author: Steven Mueller <diffusor@ugcs.caltech.edu>
" Last Modified: Tue May 24 13:29:48 PDT 2005
" Version: 0.9.1
" XXX - breaks if close attempted while XIM is in preedit mode
" TODO - allow usability as a global plugin -
"    Add g:unaryTagsStack - always contains html tags settings
"    and g:closetag_default_xml - user should define this to default to xml
"    When a close is attempted but b:unaryTagsStack undefined,
"    use b:closetag_html_style to determine if the file is to be treated
"    as html or xml.  Failing that, check the filetype for xml or html.
"    Finally, default to g:closetag_html_style.
"    If the file is html, let b:unaryTagsStack=g:unaryTagsStack
"    otherwise, let b:unaryTagsStack=""
" TODO - make matching work for all comments
"  -- kinda works now, but needs syn sync minlines to be very long
"  -- Only check whether in syntax in the beginning, then store comment tags
"  in the tagstacks to determine whether to move into or out of comment mode
" TODO - The new normal mode mapping clears recent messages with its <ESC>, and
" it doesn't fix the null-undo issue for vim 5.7 anyway.
" TODO - make use of the following neat features:
"  -- the ternary ?: operator
"  -- :echomsg and :echoerr
"  -- curly brace expansion for variables and function name definitions?
"  -- check up on map <blah> /FuncName
"
" Description:
" This script eases redundant typing when writing html or xml files (even if
" you're very good with ctrl-p and ctrl-n  :).  Hitting ctrl-_ will initiate a
" search for the most recent open tag above that is not closed in the
" intervening space and then insert the matching close tag at the cursor.  In
" normal mode, the close tag is inserted one character after cursor rather than
" at it, as if a<C-_> had been used.  This allows putting close tags at the
" ends of lines while in normal mode, but disallows inserting them in the
" first column.
"
" For HTML, a configurable list of tags are ignored in the matching process.
" By default, the following tags will not be matched and thus not closed
" automatically: area, base, br, dd, dt, hr, img, input, link, meta, and
" param.
"
" For XML, all tags must have a closing match or be terminated by />, as in
" <empty-element/>.  These empty element tags are ignored for matching.
"
" Comment checking is now handled by vim's internal syntax checking.  If tag
" closing is initiated outside a comment, only tags outside of comments will
" be matched.  When closing tags in comments, only tags within comments will
" be matched, skipping any non-commented out code (wee!).  However, the
" process of determining the syntax ID of an arbitrary position can still be
" erroneous if a comment is not detected because the syntax highlighting is
" out of sync, or really slow if syn sync minlines is large.
" Set the b:closetag_disable_synID variable to disable this feature if you
" have really big chunks of comment in your code and closing tags is too slow.
"
" If syntax highlighting is not enabled, comments will not be handled very
" well.  Commenting out HTML in certain ways may cause a "tag mismatch"
" message and no completion.  For example, '<!--a href="blah">link!</a-->'
" between the cursor and the most recent unclosed open tag above causes
" trouble.  Properly matched well formed tags in comments don't cause a
" problem.
"
" Install:
" To use, place this file in your standard vim scripts directory, and source
" it while editing the file you wish to close tags in.  If the filetype is not
" set or the file is some sort of template with embedded HTML, you may force
" HTML style tag matching by first defining the b:closetag_html_style buffer
" variable.  Otherwise, the default is XML style tag matching.
"
" Example:
"   :let b:closetag_html_style=1
"   :source ~/.vim/scripts/closetag.vim
"
" For greater convenience, load this script in an autocommand:
"   :au Filetype html,xml,xsl source ~/.vim/scripts/closetag.vim
"
" Also, set noignorecase for html files or edit b:unaryTagsStack to match your
" capitalization style.  You may set this variable before or after loading the
" script, or simply change the file itself.
"
" Configuration Variables:
"
" b:unaryTagsStack        Buffer local string containing a whitespace
"                         seperated list of element names that should be
"                         ignored while finding matching closetags.  Checking
"                         is done according to the current setting of the
"                         ignorecase option.
"
" b:closetag_html_style   Define this (as with let b:closetag_html_style=1)
"                         and source the script again to set the
"                         unaryTagsStack to its default value for html.
"
" b:closetag_disable_synID  Define this to disable comment checking if tag
"                         closing is too slow.  This can be set or unset
"                         without having to source again.
"
" Changelog:
" May 24, 2005 Tuesday
"   * Changed function names to be script-local to avoid conflicts with other
"     scripts' stack implementations.
"
" June 07, 2001 Thursday
"   * Added comment handling.  Currently relies on synID, so if syn sync
"     minlines is small, the chance for failure is high, but if minlines is
"     large, tagclosing becomes rather slow...
"
"   * Changed normal mode closetag mapping to use <C-R> in insert mode
"     rather than p in normal mode.  This has 2 implications:
"       - Tag closing no longer clobbers the unnamed register
"       - When tag closing fails or finds no match, no longer adds to the undo
"         buffer for recent vim 6.0 development versions.
"       - However, clears the last message when closing tags in normal mode
"  
"   * Changed the closetag_html_style variable to be buffer-local rather than
"     global.
"
"   * Expanded documentation

"------------------------------------------------------------------------------
" User configurable settings
"------------------------------------------------------------------------------

" if html, don't close certain tags.  Works best if ignorecase is set.
" otherwise, capitalize these elements according to your html editing style
if !exists("b:unaryTagsStack") || exists("b:closetag_html_style")
    if &filetype == "html" || exists("b:closetag_html_style")
    let b:unaryTagsStack="area base br dd dt hr img input link meta param"
    else " for xsl and xsl
    let b:unaryTagsStack=""
    endif
endif

" Has this already been loaded?
if exists("loaded_closetag")
    finish
endif
let loaded_closetag=1

" set up mappings for tag closing
inoremap <C-_> <C-R>=GetCloseTag()<CR>
map <C-_> a<C-_><ESC>
inoremap > <C-R>=GetCloseTag()<CR>
inoremap </ <C-R>=GetCloseTag()<CR>

"------------------------------------------------------------------------------
" Tag closer - uses the stringstack implementation below
"------------------------------------------------------------------------------

" Returns the most recent unclosed tag-name
" (ignores tags in the variable referenced by a:unaryTagsStack)
function! GetLastOpenTag(unaryTagsStack)
    " Search backwards through the file line by line using getline()
    " Overall strategy (moving backwards through the file from the cursor):
    "  Push closing tags onto a stack.
    "  On an opening tag, if the tag matches the stack top, discard both.
    "   -- if the tag doesn't match, signal an error.
    "   -- if the stack is empty, use this tag
    let linenum=line(".")
    let lineend=col(".") - 1 " start: cursor position
    let first=1              " flag for first line searched
    let b:TagStack=""        " main stack of tags
    let startInComment=s:InComment()

    let tagpat='<//=/(/k/|[-:]/)/+/|/>'
    " Search for: closing tags </tag, opening tags <tag, and unary tag ends />
    while (linenum>0)
    " Every time we see an end-tag, we push it on the stack.  When we see an
    " open tag, if the stack isn't empty, we pop it and see if they match.
    " If no, signal an error.
    " If yes, continue searching backwards.
    " If stack is empty, return this open tag as the one that needs closing.
    let line=getline(linenum)
    if first
        let line=strpart(line,0,lineend)
    else
        let lineend=strlen(line)
    endif
    let b:lineTagStack=""
    let mpos=0
    let b:TagCol=0
    " Search the current line in the forward direction, pushing any tags
    " onto a special stack for the current line
    while (mpos > -1)
        let mpos=matchend(line,tagpat)
        if mpos > -1
        let b:TagCol=b:TagCol+mpos
        let tag=matchstr(line,tagpat)
       
        if exists("b:closetag_disable_synID") || startInComment==s:InCommentAt(linenum, b:TagCol)
          let b:TagLine=linenum
          call s:Push(matchstr(tag,'[^<>]/+'),"b:lineTagStack")
        endif
        "echo "Tag: ".tag." ending at position ".mpos." in '".line."'."
        let lineend=lineend-mpos
        let line=strpart(line,mpos,lineend)
        endif
    endwhile
    " Process the current line stack
    while (!s:EmptystackP("b:lineTagStack"))
        let tag=s:Pop("b:lineTagStack")
        if match(tag, "^/") == 0        "found end tag
        call s:Push(tag,"b:TagStack")
        "echo linenum." ".b:TagStack
        elseif s:EmptystackP("b:TagStack") && !s:Instack(tag, a:unaryTagsStack)    "found unclosed tag
        return tag
        else
        let endtag=s:Peekstack("b:TagStack")
        if endtag == "/".tag || endtag == "/"
            call s:Pop("b:TagStack")    "found a open/close tag pair
            "echo linenum." ".b:TagStack
        elseif !s:Instack(tag, a:unaryTagsStack) "we have a mismatch error
            echohl Error
            echon "/rError:"
            echohl None
            echo " tag mismatch: <".tag."> doesn't match <".endtag.">.  (Line ".linenum." Tagstack: ".b:TagStack.")"
            return ""
        endif
        endif
    endwhile
    let linenum=linenum-1 | let first=0
    endwhile
    " At this point, we have exhausted the file and not found any opening tag
    echo "No opening tags."
    return ""
endfunction

" Returns closing tag for most recent unclosed tag, respecting the
" current setting of b:unaryTagsStack for tags that should not be closed
function! GetCloseTag()
    let tag=GetLastOpenTag("b:unaryTagsStack")
    if tag == ""
    return ""
    elseif  tag==?"br"
        return  "/<Left>//<Right>"
    else
    return "</".tag.">".repeat("/<Left>",strlen(tag)+3)
    endif
endfunction

" return 1 if the cursor is in a syntactically identified comment field
" (fails for empty lines: always returns not-in-comment)
function! s:InComment()
    return synIDattr(synID(line("."), col("."), 0), "name") =~ 'Comment'
endfunction

" return 1 if the position specified is in a syntactically identified comment field
function! s:InCommentAt(line, col)
    return synIDattr(synID(a:line, a:col, 0), "name") =~ 'Comment'
endfunction

"------------------------------------------------------------------------------
" String Stacks
"------------------------------------------------------------------------------
" These are strings of whitespace-separated elements, matched using the /< and
" /> patterns after setting the iskeyword option.
"
" The sname argument should contain a symbolic reference to the stack variable
" on which method should operate on (i.e., sname should be a string containing
" a fully qualified (ie: g:, b:, etc) variable name.)

" Helper functions
function! s:SetKeywords()
    let g:IsKeywordBak=&iskeyword
    let &iskeyword="33-255"
endfunction

function! s:RestoreKeywords()
    let &iskeyword=g:IsKeywordBak
endfunction

" Push el onto the stack referenced by sname
function! s:Push(el, sname)
    if !s:EmptystackP(a:sname)
    exe "let ".a:sname."=a:el.' '.".a:sname
    else
    exe "let ".a:sname."=a:el"
    endif
endfunction

" Check whether the stack is empty
function! s:EmptystackP(sname)
    exe "let stack=".a:sname
    if match(stack,"^ *$") == 0
    return 1
    else
    return 0
    endif
endfunction

" Return 1 if el is in stack sname, else 0.
function! s:Instack(el, sname)
    exe "let stack=".a:sname
    call s:SetKeywords()
    let m=match(stack, "//<".a:el."//>")
    call s:RestoreKeywords()
    if m < 0
    return 0
    else
    return 1
    endif
endfunction

" Return the first element in the stack
function! s:Peekstack(sname)
    call s:SetKeywords()
    exe "let stack=".a:sname
    let top=matchstr(stack, "//<.//{-1,}//>")
    call s:RestoreKeywords()
    return top
endfunction

" Remove and return the first element in the stack
function! s:Pop(sname)
    if s:EmptystackP(a:sname)
    echo "Error!  Stack ".a:sname." is empty and can't be popped."
    return ""
    endif
    exe "let stack=".a:sname
    " Find the first space, loc is 0-based.  Marks the end of 1st elt in stack.
    call s:SetKeywords()
    let loc=matchend(stack,"//<.//{-1,}//>")
    exe "let ".a:sname."=strpart(stack, loc+1, strlen(stack))"
    let top=strpart(stack, match(stack, "//<"), loc)
    call s:RestoreKeywords()
    return top
endfunction

function! s:Clearstack(sname)
    exe "let ".a:sname."=''"
endfunction

 

==========================================================================

 

 

 

原创   windows 下面vim javacomplete 收藏

 

首先 要配制CLASSPATH 如下:

”C:/Program Files/Java/jdk1.5.0/lib“   注意一定要有引号,否则会出错, 最好将 jdk 安在没有空格的路径下

另外把javacomplete.vim   Reflection.class Reflection.java 放到 C:/Documents and Settings/Administrator/vimfiles/autoload

或者C:/Program Files/Vim/vimfiles/autoload 下面 并且把这个目录加到CLASSPATH 里,注意也要加引号

java_parser.vim 放到 C:/Documents and Settings/Administrator/vimfiles/ftplugin/java 或者C:/Program Files/Vim/vimfiles/ftplugin/java

=================================================

autocmd Filetype java set omnifunc=javacomplete#Complete

autocmd Filetype java set completefunc=javacomplete#CompleteParamsInf
inoremap <buffer> <C-X><C-U> <C-X><C-U><C-P>
inoremap <buffer> <C-S-Space> <C-X><C-U><C-P>

=====================================================

此四句放到

C:/Program Files/Vim/_vimrc 文件里

写java 文件的时候    按下ctrl+x 然后按下ctrl+o 就会出现相应的提示

 

 

 

_vimrc ========================================================================

set nocompatible
source $VIMRUNTIME/vimrc_example.vim
source $VIMRUNTIME/mswin.vim
behave mswin

set diffexpr=MyDiff()
function MyDiff()
  let opt = '-a --binary '
  if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
  if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
  let arg1 = v:fname_in
  if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif
  let arg2 = v:fname_new
  if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
  let arg3 = v:fname_out
  if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
  let eq = ''
  if $VIMRUNTIME =~ ' '
    if &sh =~ '/<cmd'
      let cmd = '""' . $VIMRUNTIME . '/diff"'
      let eq = '"'
    else
      let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '/diff"'
    endif
  else
    let cmd = $VIMRUNTIME . '/diff'
  endif
  silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq
endfunction
"===========================================================

" 设定默认解码 
set pastetoggle=<F4> 
set fenc=utf-8 
set fencs=utf-8,usc-bom,euc-jp,gb18030,gbk,gb2312,cp936 
"设定搜索是的高亮显示 
set hlsearch 
" 不要使用vi的键盘模式,而是vim自己的 
set nocompatible 
" history文件中需要记录的行数 
set history=100 
" 在处理未保存或只读文件的时候,弹出确认 
set confirm 
" 与windows共享剪贴板 
"set clipboard+=unnamed 
" 侦测文件类型 
filetype on 
" 载入文件类型插件 
filetype plugin on 
" 为特定文件类型载入相关缩进文件 
filetype indent on 

" 保存全局变量 
set viminfo+=! 
" 带有如下符号的单词不要被换行分割 
set iskeyword+=_,$,@,%,#,- 
" 语法高亮 
syntax on 

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 
" 文件设置 
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 
" 不要生成swap文件,当buffer被丢弃的时候隐藏它 
setlocal noswapfile 
set bufhidden=hide 
" 字符间插入的像素行数目 
set linespace=0 
" 增强模式中的命令行自动完成操作 
set wildmenu 
" 在状态行上显示光标所在位置的行号和列号 
set ruler 
set rulerformat=%20(%2*%<%f%=/ %m%r/ %3l/ %c/ %p%%%) 
" 使回格键(backspace)正常处理indent, eol, start等 
set backspace=2 
" 允许backspace和光标键跨越行边界 
set whichwrap+=<,>,h,l 
" 可以在buffer的任何地方使用鼠标(类似office中在工作区双击鼠标定位) 
set mouse=a 
set selection=exclusive 
set selectmode=mouse,key 
" 启动的时候不显示那个援助索马里儿童的提示 
set shortmess=atI 
" 通过使用: commands命令,告诉我们文件的哪一行被改变过 
set report=0 
" 不让vim发出讨厌的滴滴声 
set noerrorbells 
" 在被分割的窗口间显示空白,便于阅读 
set fillchars=vert:/ ,stl:/ ,stlnc:/ 

" 搜索和匹配 
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 
" 高亮显示匹配的括号 
set showmatch 
" 匹配括号高亮的时间(单位是十分之一秒) 
set matchtime=5 
" 在搜索的时候不忽略大小写 
set noignorecase 
" 不要高亮被搜索的句子(phrases) 
"set nohlsearch 
" 在搜索时,输入的词句的逐字符高亮(类似firefox的搜索) 
set incsearch 
" 输入:set list命令是应该显示些啥? 
set listchars=tab:/|/ ,trail:.,extends:>,precedes:<,eol:$ 
" 光标移动到buffer的顶部和底部时保持3行距离 
set scrolloff=3 
" 不要闪烁 
set novisualbell 
" 我的状态行显示的内容(包括文件类型和解码) 
"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 formatoptions=tcrqn 
" 继承前一行的缩进方式,特别适用于多行注释 
 set autoindent 
 " 为C程序提供自动缩进 
 set smartindent 
 " 使用C样式的缩进 
 set cindent 
 " 制表符为4 
 set tabstop=4 
 " 统一缩进为4 
 set softtabstop=4 
 set shiftwidth=4 
 " 不要用空格代替制表符 
 set noexpandtab 
 " 不要换行 
 "set nowrap 
 "设置每行80个字符自动换行 
 "set textwidth=80 
 " 在行和段开始处使用制表符 
 set smarttab 
 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 
" CTags的设定 
 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 
 " 按照名称排序 
 let Tlist_Sort_Type = "name" 
 " 在右侧显示窗口 
 let Tlist_Use_Right_Window = 1 
 " 压缩方式 
 let Tlist_Compart_Format = 1 
 " 如果只有一个buffer,kill窗口也kill掉buffer 
 let Tlist_Exist_OnlyWindow = 1 
 " 不要关闭其他文件的tags 
 let Tlist_File_Fold_Auto_Close = 0 
 " 不要显示折叠树 
 let Tlist_Enable_Fold_Column = 1 
 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 

"=========================下面的内容在windows 上有一点乱码============================================================
 " Autocommands 
 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" 
 nnoremap <space> @=((foldclosed(line('.')) < 0) ? 'zc' : 'zo')<CR> 
 " minibufexpl插件的一般设置 
 let g:miniBufExplMapWindowNavVim = 1 
 let g:miniBufExplMapWindowNavArrows = 1 
 let g:miniBufExplMapCTabSwitchBufs = 1 
 let g:miniBufExplModSelTarget = 1  
 " Omni 
 let OmniCpp_DisplayMode = 1 
"===================================括号自动关闭========================
function! My_BracketComplete()
    let char = strpart(getline('.'), col('.')-1, 1)
    if (char == ")")
        return "/<Right>"
    else
        return ")"
    endif
endfunction
autocmd Filetype java,javascript,html imap ( ()<left>
"autocmd FileType java,javascript,html inoremap ) <C-R>=My_BracketComplete()<CR>

function! My_MidComplete()
    let char = strpart(getline('.'), col('.')-1, 1)
    if (char == "]")
        return "/<Right>"
    else
        return "]"
    endif
endfunction
autocmd Filetype java,javascript,html imap  [ []<left>
autocmd FileType java,javascript,html inoremap ] <C-R>=My_MidComplete()<CR>

autocmd Filetype java,javascript,html,css imap { {<esc>xA<esc>pa}<left><cr><cr><up><tab>
function! My_BraceComplete()
    let char = strpart(getline('.'), col('.')-1, 1)
    if (char == "}")
        return "/<Right>"
    else
        return "}"
    endif
endfunction

function! My_appendSemicolon() "在句末添加分号后 ,光标仍回原位置 imap  ; <C-R>=My_appendSemicolon()<CR>
    let nowPos=col('.') "光标下标
    let endPos=col('$') "行尾下标
    let len=endPos-nowPos
    let line=getline('.')
    if matchend(line,";//s/*$")==strlen(line) " 如果 此行以分号结尾(包括分号后面有空格的情况) 则不将分号加到末尾,而是光标处
        return ";"
    else
        return repeat("/<Right>",len).";".repeat("/<Left>",len+1) "在行尾添加分号并回到原位置
    endif
endfunction
"============================end of 括号自动关闭========================
"与omni结合使用的时候 当提示方法名的时个一般是这种情形 System.out.print(
"而不是System.out.println() 注意最后的括号,此函数要做的就是当使用提示的时候
"补上右括号
function! My_BracketComplete4omni()
    let line=getline('.')  "|  example: line=  System.ouout
    let  dotPos=strridx(line,".") "lengthOf('  System.')-1 最后一个点.所在的位置
    let cursePos=strlen(line)    "lengthOf('  System.ouout') 光标的位置
    let len=cursePos-dotPos   "lengthof(ouout)+1 光标到最后一个点之间 的长度
    let lastCharIndex=strridx(line,'(') "得到最后一个左括号的下标,判断是否需要补上一个右括号
    let bedot=strpart(line,0,dotPos) "  System  最后一个点之前的部分
    let afdot=strpart(line,dotPos+1,len) "ouout 最后一个点之后 的部分
    let b=match(afdot,'/(/w/+/)/1')   " the begin index of   ouou
    let e=matchend(afdot,'/(/w/+/)/1') " the end index of ouou
    let ok=strpart(afdot,(e-b)/2)       " out    ,all the char after the first 'u' of ouout 
    "debug
    "return repeat("/<BS>",len-1).ok."/nline:".line."/ndotPos:".dotPos."/ncursePos:".cursePos."/nlen:".len."/nlastCharIndex:".lastCharIndex."/nbedot:".bedot."/nafdot:".afdot."/nb:".b."/ne:".e."/nok:".ok."/nrep:".rep
    let rep=repeat("/<Left>",strlen(ok)-1) "向前移动strlen(ok) 个长度的位置,以便删除ouout 最前面出现的重复的ou
    let lenOfOk=strlen(ok)
    let lenOfBetweenDotAndOk=len-lenOfOk
    let rep=rep.repeat("/<BS>", lenOfBetweenDotAndOk-1) "删除ouout 最前面出现的重复的ou
    let rep=rep.repeat("/<Right>",lenOfOk) "光标向后移动到最初的位置
    if  lastCharIndex == -1
        if dotPos== -1
            return " "
        else
            return rep
        endif 
    else
        return rep.")/<Left>"
    endif
endfunction

let g:closetag_html_style=1
" 下一行不用改了,因为 在closetag.vim 里设置了
"autocmd FileType xml,html,jsp imap  > ><C-_>
autocmd FileType python set omnifunc=pythoncomplete#Complete
autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
autocmd FileType css set omnifunc=csscomplete#CompleteCSS
autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags
autocmd FileType php set omnifunc=phpcomplete#CompletePHP
autocmd FileType c set omnifunc=ccomplete#Complete
autocmd Filetype java set omnifunc=javacomplete#Complete
autocmd Filetype java set completefunc=javacomplete#CompleteParamsInf

autocmd FileType java,javascript,html,css imap  ; <C-R>=My_appendSemicolon()<CR>
autocmd FileType java,javascript,,jsp,html,css map  ; i;<esc>
autocmd FileType java,javascript,html,jsp imap  "  "<cr><esc>kA<esc>xa<esc>ppJhi
autocmd FileType java,javascript,html,vim,jsp imap  '  '<cr><esc>kA<esc>xa<esc>ppJi
autocmd Filetype java,javascript,jsp inoremap <buffer>  .  .<C-X><C-O><C-P>
autocmd Filetype css inoremap <buffer>  :  :<C-X><C-O><C-P>
"tab 键高亮下一个条目
autocmd Filetype css,javascript,java inoremap <buffer>  <tab>  <C-N>
"以下三行,效果相同,将第一个条目上屏
autocmd Filetype java,javascript,css,html inoremap <buffer>  <F1>   <C-O><C-R>=My_BracketComplete4omni()<CR>
autocmd Filetype java,javascript,css,html, inoremap <buffer>  <F2>   <C-O><C-R>=My_BracketComplete4omni()<CR>
autocmd Filetype java,javascript,css,html inoremap <buffer>  <F3>   <C-O><C-R>=My_BracketComplete4omni()<CR>

" add jquery.vim to syntax dir
au BufRead,BufNewFile *.js set ft=javascript.jquery
autocmd Filetype java,javascript,css,html,xml inoremap <buffer>  a  a<C-N><C-P>
autocmd Filetype java,javascript,css,html,xml inoremap <buffer>  b  b<C-N><C-P>
autocmd Filetype java,javascript,css,html,xml inoremap <buffer>  c  c<C-N><C-P>
autocmd Filetype java,javascript,css,html,xml inoremap <buffer>  d  d<C-N><C-P>
autocmd Filetype java,javascript,css,html,xml inoremap <buffer>  e  e<C-N><C-P>
autocmd Filetype java,javascript,css,html,xml inoremap <buffer>  f  f<C-N><C-P>
autocmd Filetype java,javascript,css,html,xml inoremap <buffer>  g  g<C-N><C-P>
autocmd Filetype java,javascript,css,html,xml inoremap <buffer>  h  h<C-N><C-P>
autocmd Filetype java,javascript,css,html,xml inoremap <buffer>  i  i<C-N><C-P>
autocmd Filetype java,javascript,css,html,xml inoremap <buffer>  j  j<C-N><C-P>
autocmd Filetype java,javascript,css,html,xml inoremap <buffer>  k  k<C-N><C-P>
autocmd Filetype java,javascript,css,html,xml inoremap <buffer>  l  l<C-N><C-P>
autocmd Filetype java,javascript,css,html,xml inoremap <buffer>  m  m<C-N><C-P>
autocmd Filetype java,javascript,css,html,xml inoremap <buffer>  n  n<C-N><C-P>
autocmd Filetype java,javascript,css,html,xml inoremap <buffer>  o  o<C-N><C-P>
autocmd Filetype java,javascript,css,html,xml inoremap <buffer>  p  p<C-N><C-P>
autocmd Filetype java,javascript,css,html,xml inoremap <buffer>  q  q<C-N><C-P>
autocmd Filetype java,javascript,css,html,xml inoremap <buffer>  r  r<C-N><C-P>
autocmd Filetype java,javascript,css,html,xml inoremap <buffer>  s  s<C-N><C-P>
autocmd Filetype java,javascript,css,html,xml inoremap <buffer>  t  t<C-N><C-P>
autocmd Filetype java,javascript,css,html,xml inoremap <buffer>  u  u<C-N><C-P>
autocmd Filetype java,javascript,css,html,xml inoremap <buffer>  v  v<C-N><C-P>
autocmd Filetype java,javascript,css,html,xml inoremap <buffer>  w  w<C-N><C-P>
autocmd Filetype java,javascript,css,html,xml inoremap <buffer>  x  x<C-N><C-P>
autocmd Filetype java,javascript,css,html,xml inoremap <buffer>  y  y<C-N><C-P>
autocmd Filetype java,javascript,css,html,xml inoremap <buffer>  z  z<C-N><C-P>

autocmd Filetype java,javascript,css,html,xml inoremap <buffer>  A  A<C-N><C-P>
autocmd Filetype java,javascript,css,html,xml inoremap <buffer>  B  B<C-N><C-P>
autocmd Filetype java,javascript,css,html,xml inoremap <buffer>  C  C<C-N><C-P>
autocmd Filetype java,javascript,css,html,xml inoremap <buffer>  D  D<C-N><C-P>
autocmd Filetype java,javascript,css,html,xml inoremap <buffer>  E  E<C-N><C-P>
autocmd Filetype java,javascript,css,html,xml inoremap <buffer>  F  F<C-N><C-P>
autocmd Filetype java,javascript,css,html,xml inoremap <buffer>  G  G<C-N><C-P>
autocmd Filetype java,javascript,css,html,xml inoremap <buffer>  H  H<C-N><C-P>
autocmd Filetype java,javascript,css,html,xml inoremap <buffer>  I  I<C-N><C-P>
autocmd Filetype java,javascript,css,html,xml inoremap <buffer>  J  J<C-N><C-P>
autocmd Filetype java,javascript,css,html,xml inoremap <buffer>  K  K<C-N><C-P>
autocmd Filetype java,javascript,css,html,xml inoremap <buffer>  L  L<C-N><C-P>
autocmd Filetype java,javascript,css,html,xml inoremap <buffer>  M  M<C-N><C-P>
autocmd Filetype java,javascript,css,html,xml inoremap <buffer>  N  N<C-N><C-P>
autocmd Filetype java,javascript,css,html,xml inoremap <buffer>  O  O<C-N><C-P>
autocmd Filetype java,javascript,css,html,xml inoremap <buffer>  P  P<C-N><C-P>
autocmd Filetype java,javascript,css,html,xml inoremap <buffer>  Q  Q<C-N><C-P>
autocmd Filetype java,javascript,css,html,xml inoremap <buffer>  R  R<C-N><C-P>
autocmd Filetype java,javascript,css,html,xml inoremap <buffer>  S  S<C-N><C-P>
autocmd Filetype java,javascript,css,html,xml inoremap <buffer>  T  T<C-N><C-P>
autocmd Filetype java,javascript,css,html,xml inoremap <buffer>  U  U<C-N><C-P>
autocmd Filetype java,javascript,css,html,xml inoremap <buffer>  V  V<C-N><C-P>
autocmd Filetype java,javascript,css,html,xml inoremap <buffer>  W  W<C-N><C-P>
autocmd Filetype java,javascript,css,html,xml inoremap <buffer>  X  X<C-N><C-P>
autocmd Filetype java,javascript,css,html,xml inoremap <buffer>  Y  Y<C-N><C-P>
autocmd Filetype java,javascript,css,html,xml inoremap <buffer>  Z  Z<C-N><C-P>

"设定窗口位置及大小
winpos 355 35
set lines=35 columns=98



set number


set backup
set backupcopy=yes
set backupdir=c:/backup

set guioptions-=m
set guioptions-=T
============================================================================

 

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值