stevearc / vim-arduino

Vim plugin for compiling and uploading arduino sketches
MIT License
343 stars 24 forks source link

Plugin Not Starting With Lazy.nvim #63

Open s4Dt0y opened 1 month ago

s4Dt0y commented 1 month ago

I'm on mac sonoma with neovim 0.10.0. My probem is that the plugin does not even start. I used lazy.nvim to install it, and I "vim-arduino" in the loaded plugins. But when I open an ino file, the Blink.ino in the examples repository, for instance, there is no Arduino command set.

Here is my vim-arduino.lua file:

return {
    "stevearc/vim-arduino",
    config = function()
        local keymap = vim.keymap
        keymap.set("n", "<cmd>ArduinoAttach<CR>", "<leader>aa", { desc = "Automatically attach to your board" })
        keymap.set("n", "<cmd>ArduinoVerify<CR>", "<leader>av", { desc = "Compile" })
        keymap.set("n", "<cmd>ArduinoUpload<CR>", "<leader>au", { desc = "Upload" })
        keymap.set(
            "n",
            "<cmd>ArduinoUploadAndSerial<CR>",
            "<leader>aus",
            { desc = "Build, upload, and connect for debugging" }
        )
        keymap.set("n", "<cmd>ArduinoSerial<CR>", "<leader>as", { desc = "Connect for debugging" })
        keymap.set("n", "<cmd>ArduinoChooseBoard<CR>", "<leader>ab", { desc = "Choose board" })
        keymap.set("n", "<cmd>ArduinoChooseProgrammer", "<leader>ap", { desc = "Choose programmer" })
    end,
}
SebastianBilek commented 2 weeks ago

What worked for me was stating the filetype like so:

return {
  "stevearc/vim-arduino",
  ft = "arduino",
  ...
}