Closed PlexSheep closed 11 months ago
This is probably because the commands were defined in a ftplugin
file instead of a plugin
file. This was for historical reasons, but I don't think it makes much sense anymore. I've changed the commands to be globally available.
I can confirm this issue is fixed in the latest update. Thank you!
So... seems like command aren't visible again, and the way I "solved" it (or what i did for myself) was just:
{'stevearc/vim-arduino', lazy = false }, -- sudo pacman -S screen arduino-cli (and arduino?) | arduino-cli config init
local api = vim.api
api.nvim_command('au BufRead,BufNewFile *.ino nnoremap <buffer> <leader>aa <cmd>call arduino#Attach()<CR>')
api.nvim_command('au BufRead,BufNewFile *.ino nnoremap <buffer> <leader>am <cmd>call arduino#Verify()<CR>')
api.nvim_command('au BufRead,BufNewFile *.ino nnoremap <buffer> <leader>au <cmd>call arduino#Upload()<CR>')
api.nvim_command('au BufRead,BufNewFile *.ino nnoremap <buffer> <leader>ad <cmd>call arduino#UploadAndSerial()<CR>')
api.nvim_command('au BufRead,BufNewFile *.ino nnoremap <buffer> <leader>ab <cmd>call arduino#ChooseBoard()<CR>')
api.nvim_command('au BufRead,BufNewFile *.ino nnoremap <buffer> <leader>ap <cmd>call arduino#ChooseProgrammer()<CR>')
... and so I thought to share it here.
Also, random but: whenever I need to exit from arduino#Serial
I have to press CTR:+A \
for screen
to get closed. Else it will lock the /dev/ttyACM0
and I can't upload... hmm...
Describe the bug The commands of the plugin cannot be found when installing it with the lazy package manager, regardless of how I load the plugin.
This config should load the plugin when I call one of the commands listed above. It tries to do so, but the commands are not found.
When I try to load the plugin as non lazy like below, the commands just do not exist.
System information
v0.9.2
with lazyarduino-cli Version: 0.34.2 Commit: 963c1a76 Date: 2023-09-11T10:05:42Z
To Reproduce Steps to reproduce the behavior:
Expected behavior The commands are found in both lazy and non lazy mode
Additional context I have installed the arduino application as a flatpak, but
arduino-cli
is installed natively through their provided install script. If I understand correctly, this should not be a problem, as the plugin usesarduino-cli
if possible and regulararduino
only as fallback.arduino-cli
is available from my regular shell,arduino
is not (only as flatpak).In case my complete configuration becomes relevant, it can be found at my personal git server here.