安装了 VIM 插件但遇到错误:E117: Unkown function

安装了 VIM 插件但遇到错误:E117: Unkown function

我安装谷歌/vim-codefmt插件然后安装clang 格式并重新启动 VIM,然后我运行:FormatCode,但出现以下错误:

格式化文件时出错:VIM(let):E117: 未知函数:maktaba#syscall#Create

我试图弄清楚为什么会发生这种情况,但到目前为止我还无法弄清楚。我想知道是否有人知道我错过了什么。

我的~/.vimrc如下图所示:

set nocompatible              " be iMproved, required
filetype off                  " required

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')

" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'

Plugin 'pangloss/vim-javascript'
Plugin 'mxw/vim-jsx'

Plugin 'google/vim-searchindex'

Plugin 'dracula/vim'

Plugin 'google/vim-maktaba'
Plugin 'google/vim-codefmt'
" Also add Glaive, which is used to configure codefmt's maktaba flags. See `:help :Glaive` for usage.
Plugin 'google/vim-glaive'

Plugin 'google/vim-colorscheme-primary'

" The following are examples of different formats supported.
" Keep Plugin commands between vundle#begin/end.
" plugin on GitHub repo
"Plugin 'tpope/vim-fugitive'
" plugin from http://vim-scripts.org/vim/scripts.html
" Plugin 'L9'
" Git plugin not hosted on GitHub
"Plugin 'git://git.wincent.com/command-t.git'
" git repos on your local machine (i.e. when working on your own plugin)
"Plugin 'file:///home/gmarik/path/to/plugin'
" The sparkup vim script is in a subdirectory of this repo called vim.
" Pass the path to set the runtimepath properly.
"Plugin 'rstacruz/sparkup', {'rtp': 'vim/'}
" Install L9 and avoid a Naming conflict if you've already installed a
" different version somewhere else.
" Plugin 'ascenator/L9', {'name': 'newL9'}

" All of your Plugins must be added before the following line
call vundle#end()            " required
filetype plugin indent on    " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList       - lists configured plugins
" :PluginInstall    - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean      - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line

" the glaive#Install() should go after the 'call vundle#end()'
call glaive#Install()

let g:jsx_ext_required = 0

"syntax on
"color dracula

set tabstop=4 softtabstop=0 expandtab shiftwidth=4 smarttab


augroup autoformat_settings
      autocmd FileType bzl AutoFormatBuffer buildifier
        autocmd FileType c,cpp,proto,javascript AutoFormatBuffer clang-format
          autocmd FileType dart AutoFormatBuffer dartfmt
            autocmd FileType go AutoFormatBuffer gofmt
              autocmd FileType gn AutoFormatBuffer gn
                autocmd FileType html,css,json AutoFormatBuffer js-beautify
                  autocmd FileType java AutoFormatBuffer google-java-format
                    autocmd FileType python AutoFormatBuffer yapf
                      " Alternative: autocmd FileType python AutoFormatBuffer autopep8
                      augroup END

syntax enable
set t_Co=256
"set background=light
set background=dark
colorscheme primary

map <C-K> :pyf  /usr/share/clang/clang-format.py<cr>
imap <C-K> <c-o>:pyf  /usr/share/clang/clang-format.py<cr>

相关内容