{"id":13898338,"url":"https://github.com/stevearc/vim-arduino","last_synced_at":"2025-04-05T14:09:27.888Z","repository":{"id":34364345,"uuid":"38288770","full_name":"stevearc/vim-arduino","owner":"stevearc","description":"Vim plugin for compiling and uploading arduino sketches","archived":false,"fork":false,"pushed_at":"2024-02-10T02:33:29.000Z","size":108,"stargazers_count":362,"open_issues_count":11,"forks_count":24,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-29T13:11:22.604Z","etag":null,"topics":["arduino-ide","vim","vim-arduino","vim-plugin","vim-plugins"],"latest_commit_sha":null,"homepage":"","language":"Vim Script","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stevearc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2015-06-30T05:01:44.000Z","updated_at":"2025-03-26T22:22:45.000Z","dependencies_parsed_at":"2023-01-15T06:45:29.590Z","dependency_job_id":"2224cf80-1885-464d-a5b9-3973c2ffca45","html_url":"https://github.com/stevearc/vim-arduino","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevearc%2Fvim-arduino","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevearc%2Fvim-arduino/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevearc%2Fvim-arduino/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevearc%2Fvim-arduino/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stevearc","download_url":"https://codeload.github.com/stevearc/vim-arduino/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247345854,"owners_count":20924102,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arduino-ide","vim","vim-arduino","vim-plugin","vim-plugins"],"created_at":"2024-08-06T18:04:14.585Z","updated_at":"2025-04-05T14:09:27.865Z","avatar_url":"https://github.com/stevearc.png","language":"Vim Script","funding_links":[],"categories":["Vim Script"],"sub_categories":[],"readme":"# vim-arduino\n\nVim plugin for compiling, uploading, and debugging arduino sketches. It uses\n[arduino-cli](https://arduino.github.io/arduino-cli/latest/) when available\n(recommended), and falls back to using the Arduino IDE's [commandline\ninterface](https://github.com/arduino/Arduino/blob/master/build/shared/manpage.adoc)\n(new in 1.5.x).\n\n## Installation\n\nvim-arduino works with all the usual plugin managers\n\n\u003cdetails\u003e\n  \u003csummary\u003ePacker (Neovim only)\u003c/summary\u003e\n\n```lua\nrequire('packer').startup(function()\n    use {'stevearc/vim-arduino'}\nend)\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003ePaq (Neovim only)\u003c/summary\u003e\n\n```lua\nrequire \"paq\" {\n    {'stevearc/vim-arduino'};\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003evim-plug\u003c/summary\u003e\n\n```vim\nPlug 'stevearc/vim-arduino'\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003edein\u003c/summary\u003e\n\n```vim\ncall dein#add('stevearc/vim-arduino')\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003ePathogen\u003c/summary\u003e\n\n```sh\ngit clone --depth=1 https://github.com/stevearc/vim-arduino.git ~/.vim/bundle/\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eNeovim native package\u003c/summary\u003e\n\n```sh\ngit clone --depth=1 https://github.com/stevearc/vim-arduino.git \\\n  \"${XDG_DATA_HOME:-$HOME/.local/share}\"/nvim/site/pack/vim-arduino/start/vim-arduino\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eVim8 native package\u003c/summary\u003e\n\n```sh\ngit clone --depth=1 https://github.com/stevearc/vim-arduino.git \\\n  \"$HOME\"/.vim/pack/vim-arduino/start/vim-arduino\n```\n\n\u003c/details\u003e\n\n## Requirements\n\nLinux and Mac are tested and functioning. I have not tested on Windows, but have\nheard that it works via WSL. See [this\nissue](https://github.com/stevearc/vim-arduino/issues/4) for discussion.\n\nIt is recommended to use `arduino-cli`, installation instructions here: https://arduino.github.io/arduino-cli/latest/installation/\n\nHowever it is also possible to use the arduino IDE directly. Download [Arduino\nIDE](https://www.arduino.cc/en/Main/Software) (version 1.5 or newer). Linux\nusers make sure the `arduino` command is in your PATH.\n\n## Commands\n\n| Command                   | arg          | description                                                                 |\n| ------------------------- | ------------ | --------------------------------------------------------------------------- |\n| `ArduinoAttach`           | [port]       | Automatically attach to your board (see `arduino-cli board attach -h`)      |\n| `ArduinoChooseBoard`      | [board]      | Select the type of board. With no arg, will present a choice dialog.        |\n| `ArduinoChooseProgrammer` | [programmer] | Select the programmer. With no arg, will present a choice dialog.           |\n| `ArduinoChoosePort`       | [port]       | Select the serial port. With no arg, will present a choice dialog.          |\n| `ArduinoVerify`           |              | Build the sketch.                                                           |\n| `ArduinoUpload`           |              | Build and upload the sketch.                                                |\n| `ArduinoSerial`           |              | Connect to the board for debugging over a serial port.                      |\n| `ArduinoUploadAndSerial`  |              | Build, upload, and connect for debugging.                                   |\n| `ArduinoInfo`             |              | Display internal information. Useful for debugging issues with vim-arduino. |\n\nTo make easy use of these, you may want to bind them to a key combination. You\ncan put them in `ftplugin/arduino.vim`:\n\n```vim\n\" Change these as desired\nnnoremap \u003cbuffer\u003e \u003cleader\u003eaa \u003ccmd\u003eArduinoAttach\u003cCR\u003e\nnnoremap \u003cbuffer\u003e \u003cleader\u003eav \u003ccmd\u003eArduinoVerify\u003cCR\u003e\nnnoremap \u003cbuffer\u003e \u003cleader\u003eau \u003ccmd\u003eArduinoUpload\u003cCR\u003e\nnnoremap \u003cbuffer\u003e \u003cleader\u003eaus \u003ccmd\u003eArduinoUploadAndSerial\u003cCR\u003e\nnnoremap \u003cbuffer\u003e \u003cleader\u003eas \u003ccmd\u003eArduinoSerial\u003cCR\u003e\nnnoremap \u003cbuffer\u003e \u003cleader\u003eab \u003ccmd\u003eArduinoChooseBoard\u003cCR\u003e\nnnoremap \u003cbuffer\u003e \u003cleader\u003eap \u003ccmd\u003eArduinoChooseProgrammer\u003cCR\u003e\n```\n\n## Configuration\n\nBy default you should not _need_ to set any options for vim-arduino to work\n(especially if you're using `arduino-cli`, which tends to behave better). If\nyou want to see what's available for customization, there is detailed\ninformation [in the vim docs](https://github.com/stevearc/vim-arduino/blob/master/doc/arduino.txt).\n\n## Integrations\n\n### Dialog / picker plugins\n\nThe built-in mechanism for choosing items (e.g. `:ArduinoChooseBoard`) uses\n`inputlist()` and is not very pretty or ergonomic. If you would like to improve\nthe UI, there are two approaches:\n\n- **Neovim:** override `vim.ui.select` (e.g. by using a plugin like [dressing.nvim](https://github.com/stevearc/dressing.nvim))\n- **Vim8:** install [ctrlp](https://github.com/ctrlpvim/ctrlp.vim) or [fzf](https://github.com/junegunn/fzf.vim). They will automatically be detected and used\n\n### Tmux / screen\n\nIf you want to run the arduino commands in a separate tmux or screen pane, use\n[vim-slime](https://github.com/jpalardy/vim-slime). By setting `let g:arduino_use_slime = 1` vim-arduino will send the commands via `slime#send()` instead of running them inside a vim terminal.\n\n### Status Line\n\nYou may want to display the arduino state in your status line. There are four\npieces of data you may find interesting:\n\n- **g:arduino_board** - the currently selected board\n- **g:arduino_programmer** - the currently selected programmer\n- **g:arduino_serial_baud** - the baud rate that will be used for Serial commands\n- **arduino#GetPort()** - returns the port that will be used for communication\n\nAn example with vanilla vim or nvim, added to `ftplugin/arduino.vim`:\n\n```vim\n\" my_file.ino [arduino:avr:uno] [arduino:usbtinyisp] (/dev/ttyACM0:9600)\nfunction! ArduinoStatusLine()\n  let port = arduino#GetPort()\n  let line = '[' . g:arduino_board . '] [' . g:arduino_programmer . ']'\n  if !empty(port)\n    let line = line . ' (' . port . ':' . g:arduino_serial_baud . ')'\n  endif\n  return line\nendfunction\naugroup ArduinoStatusLine\n  autocmd! * \u003cbuffer\u003e\n  autocmd BufWinEnter \u003cbuffer\u003e setlocal stl=%f\\ %h%w%m%r\\ %{ArduinoStatusLine()}\\ %=\\ %(%l,%c%V\\ %=\\ %P%)\naugroup END\n```\n\nTo do the same thing with [vim-airline](https://github.com/vim-airline/vim-airline):\n\n```vim\nautocmd BufNewFile,BufRead *.ino let g:airline_section_x='%{MyStatusLine()}'\n```\n\nFor [lualine](https://github.com/nvim-lualine/lualine.nvim) (Neovim only) I use\nthe following function:\n\n```lua\nlocal function arduino_status()\n  if vim.bo.filetype ~= \"arduino\" then\n    return \"\"\n  end\n  local port = vim.fn[\"arduino#GetPort\"]()\n  local line = string.format(\"[%s]\", vim.g.arduino_board)\n  if vim.g.arduino_programmer ~= \"\" then\n    line = line .. string.format(\" [%s]\", vim.g.arduino_programmer)\n  end\n  if port ~= 0 then\n    line = line .. string.format(\" (%s:%s)\", port, vim.g.arduino_serial_baud)\n  end\n  return line\nend\n```\n\n## License\n\nEverything is under the [MIT\nLicense](https://github.com/stevearc/vim-arduino/blob/master/LICENSE) except for\nthe wonderful syntax file, which was created by Johannes Hoff and copied from\n[vim.org](http://www.vim.org/scripts/script.php?script_id=2654) and is under the\n[Vim License](http://vimdoc.sourceforge.net/htmldoc/uganda.html).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstevearc%2Fvim-arduino","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstevearc%2Fvim-arduino","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstevearc%2Fvim-arduino/lists"}