CRAG666/code_runner.nvim

e492

Opened this issue · 6 comments

I'm currently using a version of kickstart.nvim and when i added the plugin and set the keymap every time i try to run a file or code it says "e492: not an editor command:Run File, or run code:
Screenshot 2023-03-13 at 7 39 58 PM

Hi @nevdawg123,

I'm also starting my neovim journey with kickstart.nvim and I have issue installing code_runner.
How did you install it ? I think that the error is coming from a bad installation.

Edit :
I fix my installation with the following configuration file :

-- ~/.config/nvim/lua/custom/plugins/code_runner.lua

return {
  "CRAG666/code_runner.nvim",
  config = function()
    require("code_runner").setup ({
      filetype = {
        javascript = "cd $dir && node $fileName"
      }
    })
  end,
}

Note that I choose to use the multiple file configuration as explained in kickstart.nvim README.

@nevdawg123,

Have you tried this? What does your config look like? I think more information would help make your issue clearer. Like, @Skylli202, I've shared my config to give an example of what works. Any updated information from you will be greatly appreciated. Thanks!

Uttah commented

@nevdawg123,

Have you tried this? What does your config look like? I think more information would help make your issue clearer. Like, @Skylli202, I've shared my config to give an example of what works. Any updated information from you will be greatly appreciated. Thanks!

I caught the same after migrate to Lazy (with your config)...

@Uttah ,

Can you share your config file, as well as your nvim version and OS? It's hard to diagnose the issue without at least those things. Thanks!

Hi, can you verify if the plugin is loaded by :Lazy? If not the commands won't be available.
In case it's not loaded, try to add event = "VeryLazy" to your config and try again.

return {
  "CRAG666/code_runner.nvim",
  event = "VeryLazy",
  opts = {
      filetype = {
      ...
     },
  },
}

@dorrajmachai use this in lazy config:

  keys = {
    {
      "<leader>e",
      function()
        require("code_runner").run_code()
      end,
      desc = "[e]xcute code",
    },
  },