Re: [dev] suckless indentation with vim

2022-07-06 Thread NRK
On Tue, Jul 05, 2022 at 06:43:53PM -0500, Robert Winkler wrote:
> Probably a newly written 'vimish' editor is needed.

I see that "vis" has already been mentioned. There's also neatvi, and
kakoune.

But if your problem with neovim is that it isn't compatible with the vim
ecosystem, then neatvi and kakoune; or any other "newly written" vi
clone will suffer from the same problem.

neatvi: https://github.com/aligrudi/neatvi
kakoune: https://github.com/mawww/kakoune

- NRK



Re: [dev] suckless indentation with vim

2022-07-05 Thread Robert Winkler
On Tue Jul 5, 2022 at 7:44 AM CDT,  wrote:
> >>> If someone's using vim and follows this style, what plugin and/or
> >>> setting do you use?
> >>
> >>set tabstop=8
> >>set softtabstop=0
> >>set shiftwidth=0
> >>set noexpandtab
> >>
> >>Not being lazy to type text, and indenting each line manually.
> >>Side note: vim is bloated compared to vi and vis.
>
> Yeah, Vim is extremely bloated.. I tried counting it's SLOC, both C and .vim
> and stuff, and it's above 70, I think.. if I counted it well, not sure.
> Vi seems minimalistic - skimmed a it's source code.. but just A BIT too
> minimal (suckless-style patches needed xD).
>
> This is why I'm creating my own text terminal.
> I don't give a shit if it doesn't become 1/1000 as popular as Vim is, I
> want it
> to be simple, suckless, and powerful-ish.
> The cross-platform compatibility might be a shit-thing.

Well, vim is problematic for several reasons.
neovim is said to be 'cleaner' code and more collaborative; 
Unfortunately, many useful plugins that I need for working with
markdown/ pandoc (e.g. youcompleteme) don't run on all platforms
with neovim, why I'm still stuck with vim (from time to time I need a
manuscript finished..).

Since my hand mobility is limited, I cannot use Emacs, et al. (;-)),
and atom, which was a very versatile editor, is dead.

My point: the tab/intend/space issue is only the tip of the iceberg. 
Probably a newly written 'vimish' editor is needed.




Re: [dev] suckless indentation with vim

2022-07-05 Thread NRK
On Tue, Jul 05, 2022 at 08:54:20AM +0200, David Demelier wrote:
> I'm not sure if it's really easy to implement a smart alignment.

Do you mean implementing it in vimscript/externally or internally?

Because I don't think implementing it internally should be difficult,
given that it already can do alignment, it just continues to use tabs as
long as possible rather than using it as much as the previous line.

Though I could be wrong, as I've never taken a look at the vim codebase.

> Of course, always better to view whitespaces when dealing with that
> mix.

Even suckless indentation aside, it's useful when you deal with multiple
codebases which use different styles.

- NRK



Re: [dev] suckless indentation with vim

2022-07-05 Thread David Demelier
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 , :set et!

Of course, always better to view whitespaces when dealing with that
mix.

-- 
David



Re: [dev] suckless indentation with vim

2022-07-02 Thread Страхиња Радић
On 22/07/02 11:07, NRK wrote:
> If someone's using vim and follows this style, what plugin and/or
> setting do you use?

set tabstop=8
set softtabstop=0
set shiftwidth=0
set noexpandtab

Not being lazy to type text, and indenting each line manually.

Side note: vim is bloated compared to vi and vis.


signature.asc
Description: PGP signature


Re: [dev] suckless indentation with vim

2022-07-02 Thread NRK
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



Re: [dev] suckless indentation with vim

2022-07-02 Thread Rene Kita
On Sat, Jul 02, 2022 at 11:07:48PM +0600, NRK wrote:
> Hi,
> 
> The suckless coding style follows "tabs for indent, spaces for
> alignment" philosophy. But afaik, vim doesn't support it natively.

It does. Just press Tab to indent and press Space to align. You don't
need a plugin. ;)