can't use "S" in normal mode with haskell-mode

Linus Arver linusarver at gmail.com
Thu Mar 21 05:00:14 CET 2013


On Wed, Mar 20, 2013 at 09:25:03AM +0100, Michael Markert wrote:
> On Wed, Mar 20 2013 (01:52), Linus Arver <linusarver at gmail.com> wrote: 
> 
> > On Tue, Mar 19, 2013 at 06:32:24PM +0100, Michael Markert wrote:
> >> Actually not direct, but when it does when entering insert-state, this
> >> 
> >>     (add-hook haskell-mode-hook (lambda () (setq evil-auto-indent nil)))
> >> 
> >> should work around it.
> >
> > This works wonderfully! Thank you very much.
> >
> > For what it's worth, here is my current Haskell-specific code for
> > dead-simple indentation in my ~/.emacs:
> >
> >     ; custom indentation function: copy the indentation of the previous line
> >     ; adopted from http://sequence.complete.org/node/365
> >     (defun newline-and-indent-relative ()
> >         (interactive)
> >         (newline)
> >         (indent-to-column (save-excursion
> >             (forward-line -1)
> >             (back-to-indentation)
> >             (current-column)))
> >     )
> 
> Well if you don't want to use the indent modes this one is even simpler:
> 
>      (add-hook 'haskell-mode (lambda () (setq indent-line-function #'indent-relative)))
>      
> This could make your custom function superfluous and you don't have to
> disable the auto-indent.

Indeed, it did make my custom indent function unnecessary; I've removed
the bindings to "RET", "o", and "O" and they all work by default as
expected with my preferred relative indentation style.

"S" and "cc" work just fine, also.

Thanks again.



More information about the implementations-list mailing list