# 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`