Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

E492: Not an editor command: VimBeGood #122

Open
iaravindreddyp opened this issue Nov 21, 2022 · 8 comments
Open

E492: Not an editor command: VimBeGood #122

iaravindreddyp opened this issue Nov 21, 2022 · 8 comments

Comments

@iaravindreddyp
Copy link

Installation of plugin went through fine but unable to run the plugin.
After installation everytime I open a file in vim I see this error from plugin

Error detected while processing /home/aravind/.vim/plugged/vim-be-good/plugin/vim-be-good.vim:
line    1:
E15: Invalid expression: has('nvim-0.5')^M
line   17:
E171: Missing :endif

:checkhealth returns

    1 health#nvim#check
    2 ========================================================================
    3 ## Configuration
    4   - OK: no issues found
    5
    6 ## Performance
    7   - OK: Build type: Release
    8
    9 ## Remote Plugins
   10   - OK: Up to date
   11
   12 ## terminal
   13   - INFO: key_backspace (kbs) terminfo entry: key_backspace=\177
   14   - INFO: key_dc (kdch1) terminfo entry: key_dc=\E[3~
   15
   16 health#provider#check
   17 ========================================================================
   18 ## Clipboard (optional)
   19   - WARNING: No clipboard tool found. Clipboard registers (`"+` and `"*`) will not work.
   20     - ADVICE:
   21       - :help clipboard
   22
   23 ## Python 2 provider (optional)
   24   - WARNING: No Python executable found that can `import neovim`. Using the first available             executable for diagnostics.
   25   - ERROR: Python provider error:
   26     - ADVICE:
   27       - provider/pythonx: Could not load Python 2:
   28           /usr/bin/python2 does not have the "neovim" module. :help provider-python
   29           /usr/bin/python2.7 does not have the "neovim" module. :help provider-python
   30           python2.6 not found in search path or not executable.
   31           python not found in search path or not executable.
   32   - INFO: Executable: Not found
   33
   34 ## Python 3 provider (optional)
   35   - INFO: `g:python3_host_prog` is not set.  Searching for python3 in the environment.
   36   - INFO: Multiple python3 executables found.  Set `g:python3_host_prog` to avoid surprises.
   37   - INFO: Executable: /usr/bin/python3
   38   - INFO: Other python executable: /bin/python3
   39   - INFO: Python version: 3.8.10
   40   - INFO: pynvim version: 0.4.1 (outdated; from /usr/lib/python3/dist-packages/neovim)
   41   - WARNING: Latest pynvim is NOT installed: 0.4.3
   42
   43 ## Ruby provider (optional)
   44   - WARNING: `ruby` and `gem` must be in $PATH.
   45     - ADVICE:
   46       - Install Ruby and verify that `ruby` and `gem` commands work.
   47
   48 ## Node.js provider (optional)
   49   - INFO: Node.js: v14.21.1
   50   - INFO: Neovim node.js host: /usr/local/lib/node_modules/neovim/bin/cli.js
   51   - OK: Latest "neovim" npm/yarn package is installed: 4.10.1
   52

Is there any way to resolve this? I am using the Linux subsystem in windows btw.

@squerez
Copy link

squerez commented Jan 9, 2023

From the error, I would assume that you need a neovim version of 0.5 or above, as warned in the README (https://github.com/ThePrimeagen/vim-be-good#must-use-neovim-5x).

Check the official nvim instructions on how to install a newer version:
https://github.com/neovim/neovim/releases/tag/v0.8.2

Let me know if that worked!

@Skylli202
Copy link

Skylli202 commented Mar 17, 2023

Hi,

I think I encountered the same issue as OP.

nvim -v give me :

~ nvim -v
NVIM v0.8.3
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by runner@fv-az183-550

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/share/nvim"

Run :checkhealth for more info

Where we can see that I have a greater version than 0.5 as required in the readme.

But at boot time of nvim, I got the following error :

Failed to source `/home/egoui/.local/share/nvim/lazy/vim-be-good/plugin/vim-be-good.vim`
...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:437: Vim(if):E15: Invalid expression: has(
'nvim-0.5')^M
# stacktrace:
Press ENTER or type command to continue
  - .config/nvim/init.lua:66

Which, of course, give me the same error as OP : E492: Not an editor command: VimBeGood

In case it matters, this is my :checkhealth

gitsigns: require("gitsigns.health").check()
========================================================================
  - OK: git version 2.25.1

lazy: require("lazy.health").check()
========================================================================
## lazy.nvim
  - OK: Git installed
  - OK: no existing packages found by other package managers
  - OK: packer_compiled.lua not found

man: require("man.health").check()
========================================================================
  - OK: plugin/man.vim not in $VIMRUNTIME
  - OK: autoload/man.vim not in $VIMRUNTIME

mason: require("mason.health").check()
========================================================================
## mason.nvim report
  - OK: neovim version >= 0.7.0
  - WARNING: **Go**: not available
  - WARNING: **cargo**: not available
  - WARNING: **luarocks**: not available
  - WARNING: **Ruby**: not available
  - WARNING: **RubyGem**: not available
  - OK: **Composer**: `Composer version 2.5.1 2022-12-22 15:33:54`
  - OK: **PHP**: `PHP 8.1.16 (cli) (built: Feb 14 2023 18:34:53) (NTS)`
  - OK: **npm**: `9.6.2`
  - OK: **node**: `v19.8.1`
  - OK: **python3**: `Python 3.8.10`
  - OK: **pip3**: `pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8)`
  - WARNING: **javac**: not available
  - WARNING: **java**: not available
  - WARNING: **julia**: not available
  - OK: **wget**: `GNU Wget 1.20.3 built on linux-gnu.`
  - OK: **curl**: `curl 7.68.0 (x86_64-pc-linux-gnu) libcurl/7.68.0 OpenSSL/1.1.1f zlib/1.2.11 brotli/1.0.7 libidn2/2.3.0 libpsl/0.21.0 (+libidn2/2.2.0) libssh/0.9.3/openssl/zlib nghttp2/1.40.0 librtmp/2.3`
  - OK: **gzip**: `gzip 1.10`
  - OK: **tar**: `tar (GNU tar) 1.30`
  - WARNING: **pwsh**: not available
  - OK: **bash**: `GNU bash, version 5.0.17(1)-release (x86_64-pc-linux-gnu)`
  - OK: **sh**: `Ok`
  - OK: GitHub API rate limit. Used: 0. Remaining: 60. Limit: 60. Reset: Fri Mar 17 12:36:01 2023.

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=\177
  - INFO: key_dc (kdch1) terminfo entry: key_dc=\E[3~

nvim-treesitter: require("nvim-treesitter.health").check()
========================================================================
## Installation
  - WARNING: `tree-sitter` executable not found (parser generator, only needed for :TSInstallFromGrammar, not required for :TSInstall)
  - OK: `node` found v19.8.1 (only needed for :TSInstallFromGrammar)
  - OK: `git` executable found.
  - OK: `cc` executable found. Selected from { vim.NIL, "cc", "gcc", "clang", "cl", "zig" }
    Version: cc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
  - OK: Neovim was compiled with tree-sitter runtime ABI version 14 (required >=13). Parsers must be compatible with runtime ABI.

## OS Info:
{
  machine = "x86_64",
  release = "5.15.90.1-microsoft-standard-WSL2",
  sysname = "Linux",
  version = "#1 SMP Fri Jan 27 02:56:13 UTC 2023"
}

## Parser/Features         H L F I J
  - c                   ✓ ✓ ✓ ✓ ✓
  - cpp                 ✓ ✓ ✓ ✓ ✓
  - go                  ✓ ✓ ✓ ✓ ✓
  - help                ✓ . . . ✓
  - lua                 ✓ ✓ ✓ ✓ ✓
  - python              ✓ ✓ ✓ ✓ ✓
  - rust                ✓ ✓ ✓ ✓ ✓
  - tsx                 ✓ ✓ ✓ ✓ ✓
  - typescript          ✓ ✓ ✓ ✓ ✓
  - vim                 ✓ ✓ ✓ . ✓

  Legend: H[ighlight], L[ocals], F[olds], I[ndents], In[j]ections
         +) multiple parsers found, only one will be used
         x) errors found in the query, try to run :TSUpdate {lang}

provider: health#provider#check
========================================================================
## Clipboard (optional)
  - OK: Clipboard tool found: xclip

## Python 3 provider (optional)
  - INFO: `g:python3_host_prog` is not set.  Searching for python3 in the environment.
  - INFO: Multiple python3 executables found.  Set `g:python3_host_prog` to avoid surprises.
  - INFO: Executable: /usr/bin/python3
  - INFO: Other python executable: /bin/python3
  - INFO: Python version: 3.8.10
  - INFO: pynvim version: 0.4.1 (outdated; from /usr/lib/python3/dist-packages/neovim)
  - WARNING: Latest pynvim is NOT installed: 0.4.3

## 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.8.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

telescope: require("telescope.health").check()
========================================================================
## Checking for required plugins
  - OK: plenary installed.
  - OK: nvim-treesitter installed.

## Checking external dependencies
  - ERROR: rg: not found. `live-grep` finder will not function without [BurntSushi/ripgrep](https://github.com/BurntSushi/ripgrep) installed.
  - WARNING: fd: not found. Install [sharkdp/fd](https://github.com/sharkdp/fd) for extended capabilities

## ===== Installed extensions =====

## Telescope Extension: `fzf`
  - OK: lib working as expected
  - OK: file_sorter correctly configured
  - OK: generic_sorter correctly configured

vim.lsp: require("vim.lsp.health").check()
========================================================================
  - INFO: LSP log level : WARN
  - INFO: Log path: /home/egoui/.local/state/nvim/lsp.log
  - INFO: Log size: 4 KB

vim.treesitter: require("vim.treesitter.health").check()
========================================================================
  - INFO: Runtime ABI version : 14
  - OK: Loaded parser for c: ABI version 13
  - OK: Loaded parser for cpp: ABI version 14
  - OK: Loaded parser for go: ABI version 14
  - OK: Loaded parser for help: ABI version 14
  - OK: Loaded parser for lua: ABI version 13
  - OK: Loaded parser for python: ABI version 14
  - OK: Loaded parser for rust: ABI version 14
  - OK: Loaded parser for tsx: ABI version 14
  - OK: Loaded parser for typescript: ABI version 14
  - OK: Loaded parser for vim: ABI version 14
  - OK: Loaded parser for c: ABI version 13
  - OK: Loaded parser for help: ABI version 14
  - OK: Loaded parser for lua: ABI version 13
  - OK: Loaded parser for vim: ABI version 14

which_key: health#which_key#check
========================================================================
## WhichKey: checking conflicting keymaps
  - WARNING: conflicting keymap exists for mode **"n"**, lhs: **"gb"**
  - INFO: rhs: `<Plug>(comment_toggle_blockwise)`
  - WARNING: conflicting keymap exists for mode **"n"**, lhs: **"gc"**
  - INFO: rhs: `<Plug>(comment_toggle_linewise)`
  - WARNING: buffer-local keymap overriding global for mode **"n"**, buf: 0, lhs: **"<leader>"**
  - INFO: old rhs: `<Nop>`
  - INFO: new rhs: `<cmd>lua require("which-key").show(" ", {mode = "n", auto = true})<cr>`

@AlexGirardDev
Copy link

I ran into this issue as well,
I managed to get it working with the following lazy config

  {
    "thePrimeagen/vim-be-good",
    cmd = "VimBeGood",
    config = function()
      require("VimBeGood").setup {}
    end,
  },

@philipuvarov
Copy link

Also using Lazy, nothing seems so solve the issue, unfortunately.

@Brandutchmen
Copy link

For those using Lazy, you can load it by disabling lazy loading:

  {
    "ThePrimeagen/vim-be-good",
    lazy = false,
  },

@modomodoplz
Copy link

I ran into this issue as well, I managed to get it working with the following lazy config

  {
    "thePrimeagen/vim-be-good",
    cmd = "VimBeGood",
    config = function()
      require("VimBeGood").setup {}
    end,
  },

Bro you literally the life saver, thx a a lot!

@Beyonder616
Copy link

I ran into this issue as well, I managed to get it working with the following lazy config

  {
    "thePrimeagen/vim-be-good",
    cmd = "VimBeGood",
    config = function()
      require("VimBeGood").setup {}
    end,
  },

Bro you literally the life saver, thx a a lot!

It worked for me too, thank you!

I just needed to make a change in order for Lazy to recognize the plugin.

In my case I also needed to include this code in the lazy folder where I made a vimbegood.lua file and made a config like this:

return {
"thePrimeagen/vim-be-good",
cmd = "VimBeGood",
config = function()
require("VimBeGood").setup {}
end,
}

I tried to make my lazy config like Prime's from his neovim config series on the Vimeagen channel and put the code above without the return in lazy_init.lua.

@MusherM
Copy link

MusherM commented Aug 4, 2024

I ran into this issue as well,我也遇到了这个问题, I managed to get it working with the following lazy config我设法让它使用以下惰性配置工作

  {
    "thePrimeagen/vim-be-good",
    cmd = "VimBeGood",
    config = function()
      require("VimBeGood").setup {}
    end,
  },

You are the real hero man, I met a similar problem with code_runner.nvim, and I got it fixed under your guidance.
I just want you to know you really help a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants