On Sat, 2022-07-02 at 23:07 +0600, NRK wrote: > Hi, > > The suckless coding style follows "tabs for indent, spaces for > alignment" philosophy. But afaik, vim doesn't support it natively. > > I remember trying out a couple plugins from here: > https://vim.fandom.com/wiki/Indent_with_tabs,_align_with_spaces > but they all failed miserably on many cases. > > 'clang-format' can do this with 'UseTab: AlignWithSpaces' but it also > does a bunch of *other* stuff (which I don't like) and I also don't > like > external formatters and would much rather have my editor do the > formatting as I'm typing. > > If someone's using vim and follows this style, what plugin and/or > setting do you use?
I'm not sure if it's really easy to implement a smart alignment. I use some mapping to switch between et/noet option to insert spaces instead of tabs and align manually. nmap ,<TAB> :set et!<CR> Of course, always better to view whitespaces when dealing with that mix. -- David