CRAG666 / code_runner.nvim

Neovim plugin.The best code runner you could have, it is like the one in vscode but with super powers, it manages projects like in intellij but without being slow
MIT License
531 stars 39 forks source link

e492 #71

Open nevdawg123 opened 1 year ago

nevdawg123 commented 1 year ago

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

Skylli202 commented 1 year ago

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.

dorrajmachai commented 1 year ago

@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 1 year ago

@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)...

dorrajmachai commented 1 year ago

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

f-steinbauer commented 1 year ago

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 = {
      ...
     },
  },
}
CRAG666 commented 3 months ago

@dorrajmachai use this in lazy config:

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