Giter Site home page Giter Site logo

miking-emacs's Introduction

miking-emacs

This repo contains an Emacs mode for editing Miking code (MCore/MLang). Pull requests and issue reports are welcome!

To use the mode, add the following to your init.el file:

;; MCore mode
(add-to-list 'load-path "/path/to/miking-emacs/")
(require 'mcore-mode)
(require 'miking-syn-mode)

(or run M-x eval-buffer in the file defining the mode)

Tree-sitter support

miking-emacs supports parser-based syntax highlighting and other features using the new tree-sitter support in Emacs 29. To utilize this functionality, first make sure your Emacs version is at least 29.0.60 and that (treesit-available-p) returns t. Then, build the tree-sitter-miking grammar by following the instructions here. Move the resulting libtree-sitter-mlang.so file to $HOME/.emacs.d/tree-sitter/, and you're good to go!

In Emacs, enable mcore-ts-mode instead of mcore-mode to get the extended functionality. You can make this automatic by extending auto-mode-alist like so.

;; Open “*.mc” in mcore-ts-mode
(add-to-list 'auto-mode-alist '("\\.mc\\'" . mcore-ts-mode))

Opening a .mc-file, you should now see function names being highlighted. You can control the level of fontification using treesit-font-lock-level. For instance,

(setq-default treesit-font-lock-level 3)

will set a moderate level of fontification (3 is default; values in the range 1-4 are possible).

You can also explore the syntax tree of an MCore file using the treesit-explore-mode command, or get a mode line indication of your position in the tree using treesit-inspect-mode.

Companion Packages

miking-emacs's People

Contributors

aathn avatar br4sco avatar eliasc avatar lingmar avatar thechampagne avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.