code_runner.nvim icon indicating copy to clipboard operation
code_runner.nvim copied to clipboard

e492

Open nevdawg123 opened this issue 3 years ago • 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

nevdawg123 avatar Mar 14 '23 00:03 nevdawg123

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.

Skylli202 avatar Mar 16 '23 14:03 Skylli202

@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!

dorrajmachai avatar Mar 21 '23 08:03 dorrajmachai

@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 avatar Apr 17 '23 13:04 Uttah

@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!

dorrajmachai avatar Apr 17 '23 16:04 dorrajmachai

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 = {
      ...
     },
  },
}

f-steinbauer avatar Jun 20 '23 10:06 f-steinbauer

@dorrajmachai use this in lazy config:

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

CRAG666 avatar May 25 '24 20:05 CRAG666