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. ;)



Re: [dev] show line number *and* column number in a search

2022-07-02 Thread Marc Chantreux
On Mon, Jun 20, 2022 at 09:02:13AM -0400, Greg Reagle wrote:
> On Mon, Jun 20, 2022, at 3:00 AM, m...@datameer.com wrote:
> > "Greg Reagle"  wrote:
> >> ls | awk '/er.*/ {match($0, /er.*/); print $0; print 
> >> NR":"RSTART"-"RSTART+RLENGTH}'
> > [0] https://geoff.greer.fm/ag/

you don't need match twice so

awk ' match($0, /er.*/) { print $_"\n"NR":"RSTART"-"RSTART+RLENGTH }'

does the trick.

regards
-- 
Marc Chantreux
Direction du numérique de l'Université de Strasbourg
Pôle de Calcul et Services Avancés à la Recherche (CESAR)
http://annuaire.unistra.fr/p/20200