Skip to content

proper indent for block comment #51

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

Merged
merged 1 commit into from
Aug 18, 2015
Merged

Conversation

HuStmpHrrr
Copy link
Contributor

The piece of code I added is meant for block comment indentation, such that following effect can be achieved:

{- <cr>
 - <cr>
 - <cr>
 - -}

first of all, a vim session with haskell file opened should be configured properly first:

:set comments=s1fl:{-,mb:-,ex:-},:--
:set formatoptions+=ro

if the original setting is used, then the following will be the outcome:

{- <cr>
- <cr>
- <cr>
- -}

notice that the - at each line won't be aligned.

by adding my code, first vim will try to detect if the current position is in block comment. if so, vim will try to find the indent of the first occurrence of {- and make the - later the same the dash in {-.

for more info, please have a look at my question in stack exchange: http://vi.stackexchange.com/questions/4368/how-can-i-configure-a-three-piece-comment/4388#4388

@raichoo
Copy link
Member

raichoo commented Aug 18, 2015

Wow, this looks pretty interesting. Thanks for researching that.

raichoo added a commit that referenced this pull request Aug 18, 2015
proper indent for block comment
@raichoo raichoo merged commit 39670bd into neovimhaskell:master Aug 18, 2015
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.

2 participants