Re: [Vala] [OT] indentation config for vim/emacs



On Wed, 2009-02-25 at 21:50 +0100, Stian Selnes wrote:
Google didn't help me either, so I ended up writing some code for
Emacs that enables indentation and line continuation the way I want it
to. If I understand you correctly this might be what you're looking
for. There is a screenshot at
http://stianse.wordpress.com/2008/11/17/indent-with-tabs-align-with-spaces/
you can look at and decide before going through the setup of Emacs. I
wrote it with C code in mind, but it seems to work for Vala as well if
you set up the Vala-mode as described at
http://live.gnome.org/Vala/Emacs.

Just put the code listed at
http://stianse.wordpress.com/2008/11/17/indent-with-tabs-align-with-spaces/
in your .emacs file. To enable it for Vala-mode, put for instance the
following in .emacs:

(defun vala-indentation-setup ()
  (setq c-special-indent-hook nil)
  (add-hook 'c-special-indent-hook 'c-indent-align-with-spaces-hook))
(add-hook 'vala-mode-hook 'vala-indentation-setup)

Hope it's what you're looking for.

That's exactly what I was looking for. Thanks a lot Stian !
Now I just have to find the equivalent for Vim, and that'd be perfect.

Thanks,
        Xav





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]