Re: BASH script: Indent with tabs, align with spaces

Marc Chantreux <[email protected]>
Newsgroups gmane.editors.vim
Message-ID <Z-Eiy-hcrVggY-oC@prometheus>
hello,

On Sat, Mar 22, 2025 at 04:24:16PM -0000, Steven H. wrote:
> If checking for trailing backslash is difficult, here is a simpler idea:

this isn't difficult: it's useless the way the macro actually works.

to be sure we're talking about the same thing: my last proposal was:

vim9script
set ai ci noet
command -nargs=0 ArgIndent {
	y y | put y
	var s = @/
	s!\v^\s*\zs(\S+\s+).*!\=repeat(' ', 1 + len(submatch(1)))!
	@/ = s
}

so when i write

this --example \\<cr>--works \<cr>--fine

I got

this --example \
     --works \
     --fine

which is what you ask if we forget the fact (and to me it's
a feature, not a bug) that you indent just by doubling the \
(which respect the huffman principle: most used is shorter).

> Map all that to Ctrl+Enter (or Shift+Enter).
> Is that possible?

AFAIK no because all of them act the same (^M)
maybe I'm wrong but I'll not investigate this point.

regards

-- 
Marc Chantreux

-- 
-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/vim_use/Z-Eiy-hcrVggY-oC%40prometheus.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.