about summary refs log tree commit diff stats
path: root/js/baba-yaga/dev/emacs/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'js/baba-yaga/dev/emacs/README.md')
-rw-r--r--js/baba-yaga/dev/emacs/README.md102
1 files changed, 102 insertions, 0 deletions
diff --git a/js/baba-yaga/dev/emacs/README.md b/js/baba-yaga/dev/emacs/README.md
new file mode 100644
index 0000000..ef339ba
--- /dev/null
+++ b/js/baba-yaga/dev/emacs/README.md
@@ -0,0 +1,102 @@
+# Baba Yaga Emacs Mode
+
+Major mode for the Baba Yaga programming language in Emacs.
+
+## Installation
+
+### Method 1: Manual Installation
+1. Copy `baba-yaga-mode.el` to your Emacs load path:
+   ```bash
+   cp baba-yaga-mode.el ~/.emacs.d/
+   ```
+
+2. Add to your `~/.emacs` or `~/.emacs.d/init.el`:
+   ```elisp
+   (require 'baba-yaga-mode)
+   ```
+
+### Method 2: Using Package.el (Recommended)
+1. Add to your `~/.emacs` or `~/.emacs.d/init.el`:
+   ```elisp
+   (add-to-list 'package-archives
+                '("melpa" . "https://melpa.org/packages/") t)
+   (package-initialize)
+   ```
+
+2. Install the package:
+   ```elisp
+   M-x package-install RET baba-yaga-mode RET
+   ```
+
+### Method 3: Using use-package
+Add to your `~/.emacs` or `~/.emacs.d/init.el`:
+```elisp
+(use-package baba-yaga-mode
+  :ensure t
+  :mode ("\\.baba\\'" . baba-yaga-mode))
+```
+
+### Method 4: Using straight.el
+Add to your `~/.emacs` or `~/.emacs.d/init.el`:
+```elisp
+(straight-use-package 'baba-yaga-mode)
+```
+
+## Features
+- Syntax highlighting for Baba Yaga language
+- Automatic filetype detection for `.baba` files
+- Indentation support
+- Comment handling
+- Highlighting for:
+  - Keywords (when, then, is, with, etc.)
+  - Types (Bool, Int, Float, String, etc.)
+  - Operators (->, =>, +, -, etc.)
+  - Functions and variables
+  - Strings and numbers
+  - Comments (// and /* */)
+  - IO functions (io.out, io.in, etc.)
+
+## Usage
+Open any `.baba` file and Emacs should automatically detect the language and apply syntax highlighting.
+
+## Customization
+You can customize the mode by adding to your `~/.emacs` or `~/.emacs.d/init.el`:
+
+```elisp
+;; Customize indentation width
+(setq baba-yaga-indent-width 4)
+
+;; Customize colors (if using a theme)
+(custom-set-faces
+ '(font-lock-keyword-face ((t (:foreground "blue"))))
+ '(font-lock-type-face ((t (:foreground "green"))))
+ '(font-lock-operator-face ((t (:foreground "red")))))
+```
+
+## Key Bindings
+- `RET` - Insert newline and indent
+
+## File Structure
+```
+dev/emacs/
+├── baba-yaga-mode.el     # Major mode definition
+└── README.md             # This file
+```
+
+## Building from Source
+If you want to install from the source files:
+
+1. Clone the repository
+2. Add the `dev/emacs` directory to your load path:
+   ```elisp
+   (add-to-list 'load-path "~/path/to/baba-yaga/dev/emacs")
+   (require 'baba-yaga-mode)
+   ```
+
+## Troubleshooting
+If syntax highlighting doesn't work:
+
+1. Check that the mode is loaded: `M-x describe-mode`
+2. Verify filetype detection: `C-h v major-mode`
+3. Force mode activation: `M-x baba-yaga-mode`
+4. Check for errors: `M-x view-lossage`