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:
Naturally, when performing toggling of the extensions, they are kept sorted and aligned automatically for you.
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.
Just bind the
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.
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
hasky-extensions-aligning—whether to keep closing braces of extension pragmas aligned, default is
hasky-extensions-prettifying-hook—the hook to run after prettifying the extension list. For example, you could run
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.
Copyright © 2016–2018 Mark Karpov
Distributed under GNU GPL, version 3.