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

Disable indentation - configuration variable #88

Merged
merged 3 commits into from
Nov 29, 2016

Conversation

alx741
Copy link
Contributor

@alx741 alx741 commented Nov 22, 2016

Currently there are a lot of issues with the indentation that make it unusable, it forces indentation in such a way that the resulting code won't compile, and it's a bit of a PITA [#85 #83 #82 #73 #75 #69].

So the g:haskell_indent_disable can be set to 1 (it defaults to 0) can be used to disable the indentation in a graceful way until these problems (or most of them at least) are solved in the indentation branch. It sets autoindent so the user benefits from the same-level-indentation magic but still has the control over the right indentation to use at any time.

Additionally, hindent can be used for the equalprg setting, so using = will work as expected and don't mess up all the indentation. But this is not recommended as hindent will replace the code with an error message if it happens to be a syntax error on it. So the vim-hindent plugin is suggested to handle that issue and give auto indentation and formatting on file save.

I'm currently trying this commit with my own code, and it's quite an enormous relief having the indentation to behave.

@osfameron
Copy link

Thanks! I also really want this (I've currently simply edited haskell-vim/indent/haskell.vim to stop the indentation happening at all, as it was driving me crazy).

@raichoo raichoo merged commit 8c1fac4 into neovimhaskell:master Nov 29, 2016
@raichoo
Copy link
Member

raichoo commented Nov 29, 2016

I've merged this.

Just to be clear: most if the issues you've linked to have been solved some time ago, sadly the people who open these tickets seldom report back if it has been fixed for them so I can only check their provided test case (if any). In some of the tickets I've pointed out how it isn't feasible to do indentation at all (most of these cases require some sort of context that is non-trivial, hence expensive, to obtain in Vim). I usually don't close these tickets because people repeatedly open "hey I want different indendation in a do-block"-tickets, which would certainly be nice to have but would require a whole lot of backtracking and that is pretty expensive to do in since you basically only have Regexes at hand.

Anyway, it's certainly useful to disable indentation since some folks might want to use the hindent plugin or an indentation that suits their style better (which is why I wrote this plugin in the first place, because I wanted to aid my style ;) )

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

Successfully merging this pull request may close these issues.

3 participants