On Fri, 21 Mar 2025 22:03:58 +0100 Marc Chantreux wrote:
> On Fri, Mar 21, 2025 at 07:24:29PM -0000, Steven H. wrote:
> > Here is the result with the latest changes you proposed:
>
> > #!/bin/bash⏎
> > ⏎
> > this␣--something␣\⏎
> > >·······-anotherthing␣\⏎
> > >·······␣␣␣␣␣␣␣␣␣␣␣␣␣␣-third␣\▪⏎
> > >·······␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣-andsoon
>
> yes! that's because it fully complies the pseudocode we
> agreed on and that's why I suggested the \\<cr> map in the
> first place:
The algorithm is to preserve indentation and alignment of the previous line, then align with spaces to the second word of the previous line.
The result is not that: pressing Enter after a backslash inserts a
tab-indent.
> if you come back to the
>
> inoremap \\<cr>
>
> you can type 2 \ to say "that's the beginin of an indent.so to have
>
> [...]
> this is one extra caracter. don't you think that's fair enough?
Well, the whole point of arranging code nicely is to avoid clutter,
thus improving readability. Adding unnecessary characters not only
adds clutter, but also results in erroneous code, because '\' is also
used for escaping. Example:
#!bin/bash
grep --extended-regexp \\
--only-matching \
-- \
'a' \
<<< 'abc'
Running that results in:
grep: Trailing backslash
example: line 5: --only-matching: command not found
So, double backslashes are problematic.
P.S. Speaking of duplication: I don't know why but I always receive
each of your messages twice. :)
--
--
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 vim_use+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/vim_use/20250322063508.44e80f98%40localhost.
Friday, March 21, 2025
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment