Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hhamud/sway-mode
An Emacs major mode for the Sway language
https://github.com/hhamud/sway-mode
blockchain emacs sway
Last synced: about 2 months ago
JSON representation
An Emacs major mode for the Sway language
- Host: GitHub
- URL: https://github.com/hhamud/sway-mode
- Owner: hhamud
- License: apache-2.0
- Created: 2022-05-30T14:44:25.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-05-23T21:46:46.000Z (over 1 year ago)
- Last Synced: 2024-04-06T01:51:45.189Z (6 months ago)
- Topics: blockchain, emacs, sway
- Language: Emacs Lisp
- Homepage: https://melpa.org/#/sway-lang-mode
- Size: 25.4 KB
- Stars: 3
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Sway-mode
[![MELPA](https://melpa.org/packages/sway-lang-mode-badge.svg)](https://melpa.org/#/sway-lang-mode)
[![MELPA Stable](https://stable.melpa.org/packages/sway-lang-mode-badge.svg)](https://stable.melpa.org/#/sway-lang-mode)## Introduction
A sway specific major mode for emacs that includes:
- Syntax highlighting
- Integrations with forc, forc-lisp and forc-fmt## Installation
Clone this repository locally and then add these to your init.el file
``` emacs-lisp
(add-to-list 'load-path "/path/to/sway-mode/")
(autoload 'sway-lang-mode "sway-lang-mode" nil t)
(add-to-list 'auto-mode-alist '("\\.sw\\'" . sway-lang-mode))
```if the above fails then just load in the manually and activate the mode within any `.sw` file
## Feature Guide
### Key bindings:
| Key binding | Function | description |
|-------------|----------|-------------|
| C-c C-c | sway-lang-mode-fmt | an emacs function to format the present sway file |
| C-c C-a | sway-lang-mode-fm-custom | an emacs function to format a specific sway file providing the forc toml path |
| C-c C-t | sway-lang-mode-test | an emacs function to activate forc test |
| C-c C-b | sway-lang-mode-build | an emacs function to activate forc build |
| C-c C-d | sway-lang-mode-deploy | an emacs function to activate forc deploy |### LSP mode:
Integration with forc-lsp requires that you have lsp-mode package installed and that you run lsp-mode with the major mode by running the command . ```M-x lsp-mode```