liuchengxu / vista.vim

:cactus: Viewer & Finder for LSP symbols and tags
https://liuchengxu.github.io/vista.vim
MIT License
1.9k stars 86 forks source link

E117 ERROR:Unknow function : vista# #418

Closed askfiy closed 2 years ago

askfiy commented 2 years ago

OS: Manjaro Linux x86_64 Kernel: 5.16.2-1-MANJARO Neovim 0.6.1

My config:

call plug#begin('~/.config/nvim/autoload/')
Plug 'yianwillis/vimcdoc'
Plug '907th/vim-auto-save'
Plug 'easymotion/vim-easymotion'
Plug 'tpope/vim-surround'
Plug 'theniceboy/vim-deus'
Plug 'vim-scripts/Toggle'
Plug 'liuchengxu/vista.vim'
call plug#end()

...

noremap <leader>2 :Vista!!<CR>
let g:vista_icon_indent = ["╰─▸ ", "├─▸ "]

let g:vista_default_executive = 'ctags'

let g:vista_executive_for = {
  \ 'cpp': 'vim_lsp',
  \ 'php': 'vim_lsp',
  \ }

let g:vista_ctags_cmd = {
      \ 'haskell': 'hasktags -x -o - -c',
      \ }

let g:vista_fzf_preview = ['right:50%']
let g:vista#renderer#enable_icon = 1
let g:vista#renderer#icons = {
\   "function": "\uf794",
\   "variable": "\uf71b",
\  }

When I call the Vista command, he will get the following error:

Cannot source a directory: "/home/askfiy/.config/nvim/autoload/vista.vim"                                                                 
E117: Unknown function: vista#

How can I fix this?

enzoarguello512 commented 2 years ago

OS: Manjaro Linux x86_64 Kernel: 5.16.2-1-MANJARO Neovim 0.6.1

My config:

call plug#begin('~/.config/nvim/autoload/')
Plug 'yianwillis/vimcdoc'
Plug '907th/vim-auto-save'
Plug 'easymotion/vim-easymotion'
Plug 'tpope/vim-surround'
Plug 'theniceboy/vim-deus'
Plug 'vim-scripts/Toggle'
Plug 'liuchengxu/vista.vim'
call plug#end()

...

noremap <leader>2 :Vista!!<CR>
let g:vista_icon_indent = ["╰─▸ ", "├─▸ "]

let g:vista_default_executive = 'ctags'

let g:vista_executive_for = {
  \ 'cpp': 'vim_lsp',
  \ 'php': 'vim_lsp',
  \ }

let g:vista_ctags_cmd = {
      \ 'haskell': 'hasktags -x -o - -c',
      \ }

let g:vista_fzf_preview = ['right:50%']
let g:vista#renderer#enable_icon = 1
let g:vista#renderer#icons = {
\   "function": "\uf794",
\   "variable": "\uf71b",
\  }

When I call the Vista command, he will get the following error:

Cannot source a directory: "/home/askfiy/.config/nvim/autoload/vista.vim"                                                                 
E117: Unknown function: vista#

How can I fix this?

I was having the same error, what I did to fix it was to remove the Plug 'liuchengxu/vista.vim' line from my .vimrc, now restart your vim/nvim instance (close it and reopen it) , then to completely remove the plugin run the clean command of plug :PlugClean

And then I followed the instructions in the README about Package management

Package management

Vim 8

$ mkdir -p ~/.vim/pack/git-plugins/start
$ git clone https://github.com/liuchengxu/vista.vim.git --depth=1 ~/.vim/pack/git-plugins/start/vista.vim

NeoVim

$ mkdir -p ~/.local/share/nvim/site/pack/git-plugins/start
$ git clone https://github.com/liuchengxu/vista.vim.git --depth=1 ~/.local/share/nvim/site/pack/git-plugins/start/vista.vim

And that solved it 👌