water-dropwort / PlatformIO-Mode

PlatformIO Integration for Emacs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PlatformIO Mode

MELPA MELPA Stable

platformio-mode is an Emacs minor mode which allows quick building and uploading of PlatformIO projects with a few short key sequences.

Code completion can be provided by installing any package compatible with .ccls files, such as ccls. To keep the index up to date, run platformio-init-update-workspace (C-c i i) after installing any libraries.

Dependencies

Currently the only dependency is Projectile to facilitate running commands in the project root.

Keymap

The default keymap prefix is C-c i.

The following keybindings are currently available.

Function Keymap
Build C-c i b
Upload C-c i u
Upload using Programmer C-c i p
Upload SPIFFS C-c i s
Monitor device C-c i m
Clean C-c i c
Update C-c i d
Update Workspace C-c i i
Boards List C-c i l

Installation

The recommended way to install PlatformIO-Mode is using MELPA.

Configuration

Here is a sample config using PlatformIO-Mode in conjunction with ccls.

(require 'platformio-mode)

;; Enable ccls for all c++ files, and platformio-mode only
;; when needed (platformio.ini present in project root).
(add-hook 'c++-mode-hook (lambda ()
                           (lsp-deferred)
                           (platformio-conditionally-enable)))

カスタマイズメモ

インストール

emacs上で、M-x package-install-fileを実行し、platformio-mode.elファイルを指定する。処理が完了すると、package-user-dir変数の場所にautoloadファイルとかが作成される。

変更点

  • Platformioのバイナリが~/.local/bin配下に配置されていたが、Emacs上で確認したPATH環境変数にそのディレクトリがなかったため、各コマンドが実行できなかった。PATHに追加する方法がよくわからなかったので、path-to-platformio変数を追加して、実行ファイルのパスを指定できるようにした。

About

PlatformIO Integration for Emacs

License:GNU General Public License v3.0


Languages

Language:Emacs Lisp 100.0%