GithubHelp home page GithubHelp logo

hasky-mode / hasky-extensions Goto Github PK

View Code? Open in Web Editor NEW
22.0 2.0 1.0 117 KB

Toggle Haskell language extensions from Emacs

Emacs Lisp 80.09% Haskell 17.58% Nix 2.33%
emacs haskell language-extensions

hasky-extensions's Introduction

Hasky Extensions

This project is in “limited-maintenance” mode. I will not spend any of my time supporting it. You can still open PRs if you must, or you can take over if you wish. I'll mark the project as deprecated and stop supporting it altogether in some months.

License GPL 3 MELPA CircleCI

The package provides a way to add and remove Haskell language extensions easily from any place in a file without moving the point. This is done with the help of a menu where the most popular language extensions are assigned just one letter to toggle, while the others require two key strokes:

Hasky extensions

Naturally, when performing toggling of the extensions, they are kept sorted and aligned automatically for you.

Installation

Download this package and place it somewhere, so Emacs can see it. Then put (require 'hasky-extensions) into your configuration file. Done!

It's available via MELPA, so you can just M-x package-install RET hasky-extensions RET.

Usage

Just bind the hasky-extensions and hasky-extensions-browse-docs commands, for example:

(global-set-key (kbd "C-c y")     #'hasky-extensions)
(global-set-key (kbd "<next> h x" #'hasky-extensions-browse-docs))

When the menu shows up, type letters assigned to the language extension you wish to toggle. To exit the menu press C-g.

Customization

To view available customization options, type M-x customize-group RET hasky-extensions RET. Most important variables are:

  • hasky-extensions—list of all extensions to show in the menu.

  • haksy-extensions-docs—A collection of extensions with links to GHC user guide.

  • hasky-extensions-reach—how many characters from the beginning of file to scan. We cannot always scan entire files because they can be quite big, the default value, however, should be OK in 99.99% of cases.

  • hasky-extensions-sorting—whether to keep the collection of extensions sorted, default is t.

  • hasky-extensions-aligning—whether to keep closing braces of extension pragmas aligned, default is t.

  • hasky-extensions-prettifying-hook—the hook to run after prettifying the extension list. For example, you could run whitespace-cleanup there.

The package in powered by the avy-menu library, which implements this handy Avy-powered popup menu. To control appearance of the menu, use M-x customize-group avy-menu RET.

License

Copyright © 2016–2019 Mark Karpov

Distributed under GNU GPL, version 3.

hasky-extensions's People

Contributors

mrkkrp avatar

Stargazers

 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

Forkers

mgudemann

hasky-extensions's Issues

Disable alignment

Thanks for this cool emacs mode! Would it be possible to add a configuration to disable alignment?

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.