numirias/semshi

Not an editor command: Semshi enable

huyiqun opened this issue ยท 12 comments

Hi! I have run into a very strange issue. I am using the exact same init.vim file on my local Mac and a remote server which runs ubuntu. Semshi loads just fine on Mac but runs into this error on Ubuntu.

Error detected while processing function <SNR>17_filetype_changed:
line 4:
E492: Not an editor command: Semshi enable

I suspect that this error indicates that Semshi is not loaded correctly? I tried to delete other syntax related lines in the init.vim file. At last, I made my init.nvim file looks like this:

call plug#begin('~/.local/share/nvim/plugged')
Plug 'numirias/semshi'
call plug#end()

but still encountered same problem. Any insights?

Neovim version is 0.4.3 on both systems (nvim.appimage on linux). I use vim-plug to manage my plugins.

Figured it is because I have not run UpdateRemotePlugins!

snevs commented

I have the same issue. UpdateRemotePlugins doesn't work either

Same happens to me. nvim 0.7.0

UpdateRemotePlugins doesn't work for me. Below step helps resolve in my side.

  1. Comment out Plug 'numirias/semshi', { 'do': ':UpdateRemotePlugins' } in init.vim
  2. pip3 install pynvim --upgrade
  3. Enable Plug 'numirias/semshi', { 'do': ':UpdateRemotePlugins' } in init.vim

My problem was solved by installing pynvim Globally instead of Locally.

I used this command:

sudo -H pip install pynvim --upgrade

A regular pip install pynvim --upgrade will try to use your own home directory. The -H instructs it to use the system's home directory.

My problem was solved by installing pynvim Globally instead of Locally.

pynvim must be installed under the python that you are using for g:python3_host_prog. It doesn't matter whether it is installed locally or globally.

Don't forget you can use the following cmd to see where it is installed -- if it resolves to a strange installation, you should remove it:

$ python -c 'import pynvim; print(pynvim)'

Still getting the 'Not an editor command :Semshi enable' :(

This is my nvim:checkhealth

coc: health#coc#check

  • OK: Environment check passed
  • OK: Javascript bundle build/index.js found
  • OK: Service started

nvim: health#nvim#check

Configuration

  • OK: no issues found

Performance

  • OK: Build type: Release

Remote Plugins

  • OK: Up to date

terminal

  • INFO: key_backspace (kbs) terminfo entry: key_backspace=^H
  • INFO: key_dc (kdch1) terminfo entry: key_dc=\E[3~
  • INFO: $VTE_VERSION='7001'
  • INFO: $COLORTERM='truecolor'

provider: health#provider#check

Clipboard (optional)

  • OK: Clipboard tool found: xclip

Python 3 provider (optional)

  • INFO: Using: g:python3_host_prog = "/home/gordonrust/anaconda3/bin/python"
  • INFO: Executable: /home/gordonrust/anaconda3/bin/python
  • INFO: Python version: 3.9.7
  • INFO: pynvim version: 0.4.3
  • OK: Latest pynvim is installed.

Python virtualenv

  • OK: no $VIRTUAL_ENV

Ruby provider (optional)

  • WARNING: ruby and gem must be in $PATH.
    • ADVICE:
      • Install Ruby and verify that ruby and gem commands work.

Node.js provider (optional)

  • INFO: Node.js: v19.0.1
  • WARNING: Missing "neovim" npm (or yarn, pnpm) package.
    • ADVICE:
      • Run in shell: npm install -g neovim
      • Run in shell (if you use yarn): yarn global add neovim
      • Run in shell (if you use pnpm): pnpm install -g neovim
      • You may disable this provider (and warning) by adding let g:loaded_node_provider = 0 to your init.vim

Perl provider (optional)

  • WARNING: "Neovim::Ext" cpan module is not installed
    • ADVICE:
      • See :help |provider-perl| for more information.
      • You may disable this provider (and warning) by adding let g:loaded_perl_provider = 0 to your init.vim

vim.lsp: require("vim.lsp.health").check()

  • INFO: LSP log level : WARN
  • INFO: Log path: /home/gordonrust/.local/state/nvim/lsp.log
  • INFO: Log size: 0 KB

vim.treesitter: require("vim.treesitter.health").check()

  • INFO: Runtime ABI version : 14

What does ~/.local/share/nvim/rplugin.vim read for you (or any other similar path that reads from :UpdateRemotePlugins? What output does :UpdateRemotePlugins give you? What is the output of /home/gordonrust/anaconda3/bin/python -c "import pynvim; print(pynvim)" ?

Thanks for the quick response !!

  1. Output of cat ~/.local/share/nvim/rplugin.vim

`" perl plugins

" node plugins

" python3 plugins

" ruby plugins

" python plugins

`

  1. On doing :UpdateRemotePlugins I get remote/host: generated rplugin manifest: /home/gordonrust/.local/share/nvim/rplugin.vim

  2. /home/gordonrust/anaconda3/bin/python -c "import pynvim; print(pynvim)" gives
    <module 'pynvim' from '/home/gordonrust/anaconda3/lib/python3.9/site-packages/pynvim/__init__.py'>

Some more context :
I reinstalled the plugin using PlugInstall from within nvim(was earlier installing it from vim) and after that i am getting the error as shown in the attached image

2022-12-24-144052_3840x2160_scrot

Sorry for kind of a spam: But just want to say the issue seems resolved for now. Presently the output is
`cat ~/.local/share/nvim/rplugin.vim (base)
" perl plugins

" node plugins

" python3 plugins
call remote#host#RegisterPlugin('python3', '/home/gordonrust/.vim/plugged/semshi/rplugin/python3/semshi', [
\ {'sync': v:true, 'name': 'SemshiInternalEval', 'type': 'function', 'opts': {}},
\ {'sync': v:true, 'name': 'Semshi', 'type': 'command', 'opts': {'complete': 'customlist,SemshiComplete', 'nargs': ''}},
\ {'sync': v:true, 'name': 'SemshiBufEnter', 'type': 'function', 'opts': {}},
\ {'sync': v:true, 'name': 'SemshiBufLeave', 'type': 'function', 'opts': {}},
\ {'sync': v:true, 'name': 'SemshiBufWipeout', 'type': 'function', 'opts': {}},
\ {'sync': v:false, 'name': 'SemshiCursorMoved', 'type': 'function', 'opts': {}},
\ {'sync': v:false, 'name': 'SemshiTextChanged', 'type': 'function', 'opts': {}},
\ {'sync': v:true, 'name': 'VimLeave', 'type': 'autocmd', 'opts': {'pattern': '
'}},
\ {'sync': v:false, 'name': 'SemshiVimResized', 'type': 'function', 'opts': {}},
\ {'sync': v:true, 'name': 'SemshiComplete', 'type': 'function', 'opts': {}},
\ ])

" ruby plugins

" python plugins
`

and the issue seems to be gone. And this happened after started a new instance of neovim-qt. Earlier, UpdateRemotePlugins did not seem to help as you can see from the content of my ~/.local/share/nvim/rplugin.vim file earlier. This seems a bit random to me. In one of my earlier attempts, the editor recognized Semsi as an editor command but gave a pyinv unknown function semshi#buffer_attach error on doing Semshi enable manually. But since then, uptil just now, anytime I had opened a new instance of nvim_qt Semshi itself was not even a recognized editor command.

@wookayin Btw, in all these attemts I am using your particular fork Plug 'wookayin/semshi', { 'do': ':UpdateRemotePlugins' }

Again, sorry for a longish post, but there seems to be someting amiss, and I am just trying to help.

To fix this on my end, using python3.11 installed via linuxbrew, I first uninstalled both neovim and pynvim using pip:

pip3.11 uninstall neovim
pip3.11 uninstall pynvim

Then, I reinstalled only pynvim:

pip3.11 install pynvim

Then, I added the following to my init.lua:

-- in vimscript, this would be let g:python3_host_prog = '/home/linuxbrew/.linuxbrew/bin/python3.11'
vim.g.python3_host_prog = '/home/linuxbrew/.linuxbrew/bin/python3.11'

Then, and only then, did I finally get the :UpdateRemotePlugins in neovim command mode to work for me.

Hope this helps and good luck out there!