Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide an align command for the haskell-mode #1493

Closed
PierreR opened this issue May 4, 2015 · 4 comments
Closed

Provide an align command for the haskell-mode #1493

PierreR opened this issue May 4, 2015 · 4 comments

Comments

@PierreR
Copy link
Contributor

PierreR commented May 4, 2015

Integrating something like the following would be a nice improvement (for those who don't want to bother with hindent)

The binding <space>m a could be used as it is the case in pupppet mode.

  (require 'align)
  ;; align rules
      (add-to-list 'align-rules-list
                   '(haskell-types
                     (regexp . "\\(\\s-+\\)\\(::\\|∷\\)\\s-+")
                     (modes quote (haskell-mode literate-haskell-mode))))
      (add-to-list 'align-rules-list
                   '(haskell-assignment
                     (regexp . "\\(\\s-+\\)=\\s-+")
                     (modes quote (haskell-mode literate-haskell-mode))))
      (add-to-list 'align-rules-list
                   '(haskell-arrows
                     (regexp . "\\(\\s-+\\)\\(->\\|→\\)\\s-+")
                     (modes quote (haskell-mode literate-haskell-mode))))
      (add-to-list 'align-rules-list
                   '(haskell-left-arrows
                     (regexp . "\\(\\s-+\\)\\(<-\\|←\\)\\s-+")
                     (modes quote (haskell-mode literate-haskell-mode))))
@gitfoxi
Copy link

gitfoxi commented Jun 17, 2015

Here is my favorite alignment plugin for vim:

https://github.com/junegunn/vim-easy-align

It is a mighty sword and not just for haskell (but also for haskell).

@d12frosted
Copy link
Collaborator

@PierreR Would you like to open PR for this?

@PierreR
Copy link
Contributor Author

PierreR commented Oct 8, 2015

I know the code works fine but I am hesitant about making a PR because it is so haskell specific.

I guess I just need a confirmation that it is ok to add specific align rule such as these.

@d12frosted
Copy link
Collaborator

So you could add it into haskell layer 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants