• [Ubuntu] ubuntu vim error when editing: option 'omnifunc' is not set


    The reason for this error is that i am editing a html file, and it seems that gvim does not konw how to handle it.

    At last i found this solution. Add the code to the /etc/vim/gvimrc

    代码
    filetype plugin indent on
    autocmd FileType ruby,eruby set omnifunc
    =rubycomplete#Complete
    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 java set omnifunc=javacomplete#Complete
    if has("autocmd"&& exists("+omnifunc")
         autocmd Filetype 
    *
       \ 
    if &omnifunc == "" |
       \   setlocal omnifunc
    =syntaxcomplete#Complete |
       \ endif
    endif
    let g:rubycomplete_buffer_loading 
    = 1
    let g:rubycomplete_classes_in_global 
    = 1
    "let g:rubycomplete_rails = 1
  • 相关阅读:
    c++ stl string char* 向 string 转换的问题
    不要在疲惫中工作
    今天
    悠然自得
    忙与闲
    <转>LuaTinker的bug和缺陷
    匿名管道
    SetWindowHookEx 做消息响应
    最近工作
    实现网页页面跳转的几种方法(meta标签、js实现、php实现)
  • 原文地址:https://www.cnblogs.com/davidhhuan/p/1933283.html
Copyright © 2020-2023  润新知