Coder Social home page Coder Social logo

rego-mode's Introduction

rego-mode

MELPA check

Emacs Major mode for working with Rego configuration language.

Features

  • Syntax highlighting (Using font lock)
  • Basic indentation, commenting
  • Automatic formatting on save (Configurable via variable). Uses opa fmt for it.
  • REPL support. The function rego-repl-show will load a plain REPL. You can also use rego-repl-with-data to pass file or directory which will be loaded to the REPL.

Demo

Rego mode in Emacs

Prerequisites

  • Make sure that you install opa and it's available in your system.

Usage

It's available via MELPA and the following use-package configuration can be used:

(use-package rego-mode
  :ensure t
  :custom
  (rego-repl-executable "/home/sibi/bin/opa")
  (rego-opa-command "/home/sibi/bin/opa"))

You would have to modify the above elisp code to have appropriate paths.

License

Copyright © 2020 Sibi Prabakaran

Distributed under GNU GPL, version 3.

rego-mode's People

Contributors

psibi avatar syohex avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

rego-mode's Issues

rego-mode does not seems to respect TAB behavior set with `tab-always-indent`

I'm using Doom Emacs and installed this package through the means offered by it (migrating my old configuration to use Doom Emacs). I noticed that hitting TAB on any rego-mode file always insert a tab instead of just trying to indent the line despite having tab-always-indent set to t.

You can replicate most of my configuration with the following data provided by M-x doom/info:

SYSTEM  type       gnu/linux
        config     x86_64-pc-linux-gnu
        shell      /bin/zsh
        uname      Linux 5.9.14-arch1-1 #1 SMP PREEMPT Sat, 12 Dec 2020 14:37:12 +0000 x86_64
        path       (~/.emacs.d/bin/ ~/.emacs.d/bin/ ~/.zplug/bin ~/.cargo/bin ~/.cask/bin ~/.gem/ruby/2.4.0/bin ~/.gem/ruby/2.7.0/bin ~/.emacs.d/bin ~/.local/bin ~/opt/prey-node-client/bin ~/.deno/bin ~/.node_modules/bin ~/go/bin ~/go /usr/local/bin /usr/local/sbin /usr/bin /opt/cuda/bin /opt/cuda/integration/nsight-compute /opt/cuda/integration/nsight-systems /opt/flutter/bin /usr/lib/jvm/default/bin /usr/bin/site_perl /usr/bin/vendor_perl /usr/bin/core_perl /usr/lib/emacs/27.1/x86_64-pc-linux-gnu/)
EMACS   dir        ~/.emacs.d/
        version    27.1
        build      ago 28, 2020
        buildopts  --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib --localstatedir=/var --with-x-toolkit=gtk3 --with-xft --with-wide-int --with-modules --with-cairo --with-harfbuzz 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fno-plt' CPPFLAGS=-D_FORTIFY_SOURCE=2 LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now
        features   XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND GPM DBUS GSETTINGS GLIB NOTIFY INOTIFY ACL GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS LIBSYSTEMD JSON PDUMPER LCMS2 GMP
        traits     (gui server-running envvar-file)
DOOM    dir        ~/.doom.d/
        version    2.0.9
        font       #<font-spec nil nil Fira Code nil nil nil nil nil 16 nil nil nil nil>
        theme      doom-gruvbox
        build      HEAD -> develop 026d96198 2021-01-31 04:34:46 -0500
        elc-files  1428
        modules    (:completion (company +childframe) (ivy +childframe +prescient +icons) :ui doom doom-dashboard doom-quit hl-todo hydra (ligatures +fira +extra) modeline nav-flash ophints (popup +defaults) treemacs unicode vc-gutter vi-tilde-fringe window-select workspaces :editor file-templates fold (format +onsave) (&nopath reformatter +onsave) lispy multiple-cursors snippets :emacs dired electric undo vc :term vterm :checkers syntax (spell +flyspell) grammar :tools (eval +overlay) lookup (lsp +peek) magit pdf :lang data (dart +flutter) emacs-lisp (gdscript +lsp) (go +lsp) json (javascript +lsp) (latex +lsp) markdown (org +dragndrop +pretty) (python +lsp) (rust +lsp) (sh +lsp) (web +lsp) yaml (&nopath rego) (&nopath pkgbuild) :email mu4e :config literate (default +bindings +smartparens +jorge))
        packages   ((hungry-delete :recipe (:host github :repo nflath/hungry-delete) :pin 0513152525c38519a5597db2d6495b56dd9cc3f0) (rego-mode :recipe (:host github :repo psibi/rego-mode) :pin be110e6cef5d34eef0529a8739c68e619cf15310 :disable (not (featurep! :lang rego))) (highlight-escape-sequences :recipe (:host github :repo dgutov/highlight-escape-sequences) :pin fae976568c04b6fe8a9f2d854c8fe23b357a6878) (pkgbuild-mode :recipe (:host github :repo juergenhoetzel/pkgbuild-mode) :pin 8a5e95c8514315cb40c47f1acdb68a4ace921497 :disable (not (featurep! :lang pkgbuild))) (reformatter :recipe (:host github :repo purcell/reformatter.el) :pin 45c0add95025f53ca644a6c8b9afa05b2da3c474))
        unpin      (n/a)
        elpa       (n/a)

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.