Re: [dev] suckless indentation with vim

From: NRK <nrk_AT_disroot.org>
Date: Sun, 3 Jul 2022 00:27:04 +0600

On Sat, Jul 02, 2022 at 07:29:03PM +0200, Rene Kita wrote:
> It does. Just press Tab to indent and press Space to align. You don't
> need a plugin. ;)

One of the main reason I use vim is because it makes it VERY easy to
edit/refactor code. A lot of things which are very cumbersome on other
point-and-click style editors can be done in 1~3 just keystrokes.

It can do auto-indentation with `=`, which makes moving a block of code
from one place to another very easy. But in cases where spaces need to
used for alignment, it can mess it up and end up using tabs instead.

The following (indentation related) settings is what I've got on my
vimrc:

        set cinoptions+=t0 " Don't outdent function return types
        set cinoptions+=:0 " No extra indentation for case labels
        set cinoptions+=(0 " Lineup function args

which pretty much does everything I need, except using spaces for
alignment. I see no reason why that needs to be manual when everything
else vim can do automatially.

- NRK
Received on Sat Jul 02 2022 - 20:27:04 CEST

This archive was generated by hypermail 2.3.0 : Sat Jul 02 2022 - 20:36:08 CEST