Saturday, July 31, 2021

vim ... < /dev/null behaves differently for indentation?

$ cat /tmp/mktemp/tmp.KBMEySQJEs.awk
BEGIN {
x = 1
y = 2
}

Suppose that I have the above file.

$ vim -n --cmd ':set t_ti= t_te=' -X -E -c 'normal gg=G' -c x /tmp/tmp.KBMEySQJEs.awk < /dev/null

The above command won't indent it correctly. The following command will indent it correctly.

$ vim -n --cmd ':set t_ti= t_te=' -X -E -c 'normal gg=G' -c x /tmp/tmp.KBMEySQJEs.awk < /dev/tty
5 lines indented
"/private/tmp/mktemp/tmp.KBMEySQJEs.awk" 5L, 27B written

But for the following file. Vim can indent it with /dev/null. Does anybody know why vim behaves differently on the two files? Thanks.

$ cat  /tmp//tmp.KBMEySQJEs.sh
#!/usr/bin/env bash
# vim: set noexpandtab tabstop=2:

      declare -p BASH_SOURCE
$ vim -n --cmd ':set t_ti= t_te=' -X -E -c 'normal gg=G' -c x /tmp//tmp.KBMEySQJEs.sh < /dev/null
$ cat  /tmp/tmp.KBMEySQJEs.sh
#!/usr/bin/env bash
# vim: set noexpandtab tabstop=2:

declare -p BASH_SOURCE

--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/40ce7b1a-fa06-4f0b-95b1-9bdfe005ea19n%40googlegroups.com.

Re: unicode: UTF / UCS

On 27.07.21 21:37, Gabriele F wrote:
> (If I remember correctly) the first versions of Unicode had only a
> 2-byte encoding, so that (part of the) manpage is very old.

"_that would appeal to me_
... unsalaried working for the linux manpage people, to
keep them far off of "muddle-headed", always up-to-date
and referencing...
I ❤ reading manpages"

Is there a global internet group like for the vim developing?

>> Furthermore, be interested myself in the filesystem behavior
>> and unicode with ucs-2. Is it possible to use a linux
>> filesystem with 2-byte unicode encoding on principle.
>
> I'm not so strong on Linux but filesystems shouldn't have anything to do
> with text files encodings

I thought it like that, because the vim option ":set fenc"
implies file->system...

> you're probably thinking too much ahead, these issues have likely
> nothing to do with endianness

by myself aspirate to think inferring instead of ahead, but
maybe yu meant "keep the point", then i agree ;)

> It's not that simple unfortunately, UTF-16 (let's leave aside UCS-2, it
> shouldn't matter) cannot be assumed to always have two bytes per

UCS: _Uni_versal _Cod_ed Character Set

In my mind, UCS is the mathematical quantum and UTF the
encoding/decoding function using this:
magnitudes: 16(32)bit
plurality: charset / coded character

> All in all, it's nice if you want to understand how things are at the
> lower levels, it's quite fun to know it, but in order to achieve that

I did experience, that knowledge in "low-level" results into
the possible inferring thought to discuss with others...
(without having to stick deep into the science of the
electronic subject).

Such as,

a hardware hdd controller is using a bit buffer for
transferring the bit word to the static memory. This
controller can handle an defined bit length (normally the
bus width).

Assuming that the data of the hdd partition tables (e.g.UID),
used by the operating system, are encoded in 16bit Unicode.
Well, my inferring thoughts were that UCS-2 is a
hardware encoding, UTF-8 for ASCII purpose, UTF-32 a
high level programmer attitude and UTF-16 the real unicode.

In the end that means, the controller is made for 2-byte.
The old ASCII code needs 7bit and probably one for
sth., now than UTF-8 has to work with a different endian.

And... why should i use a deprecated ASCII scheme
at my system, when i can have lots of advantage
using utf-16 (e.g. control/hash functions). It fells
like utf-8 is a "work around" wrapper for
the ASCII scheme...

And... ucs (by princible) is probably using the science
leap from block oriented sequential access (HDD) to
byte oriented random access memory (SSD). Maybe, it plays
with the one to four bit-octets and the endian. ASCII
seems to be developed on the sequential encoding form.

sincerely
-kefko

--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/29a674cd-7be1-8abb-829d-ba6c3ddb2c16%40googlemail.com.

Tuesday, July 27, 2021

Re: unicode: UTF / UCS

Gabriele F wrote:
> By the way, many things "should"
I meant to put a " :) " after that, didn't mean to be rude

--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/5891bf7a-4945-2744-bc27-6d7296d58984%40tiscali.it.

Re: unicode: UTF / UCS

Johannes Köhler wrote:
> when my linux
> is already configured with unicode it should
> not use ascii anymore, and without the order that i have
> to stick deep into the science of charsets.

Unfortunately the only way to achieve that, BOMs, is particularly
disputed on Linux, where indeed it has more likelihood to cause problems
By the way, many things "should"


> I spent some time with unicode pages. Therefore i thought to
> remember that ascii characters encoded in unicode using
> an different endian. But maybe i am wrong with this in
> mind.

The multi-byte encodings (UTF-16, UTF-32 and the legacy UCSs) do have
endianness, the specific versions are called UTF-16LE, UTF-16BE etc. .
In Unicode these latter are called "Encoding Schemes" (Unicode chapter
3.10), while the higher level concept that doesn't concern itself with
endianness is called "Encoding Form" (Unicode ch. 3.9).
By the way, I'm actually quite rusty in all these things, take my words
with a grain of salt

--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/8211623e-0d90-39c9-634b-94c0bf4db212%40tiscali.it.

Re: unicode: UTF / UCS

'Johannes Köhler' via vim_use wrote:
> I spent some time with unicode pages. Therefore i thought to
> remember that ascii characters encoded in unicode using
> an different endian. But maybe i am wrong with this in
> mind.

By the way, the word endianness is only used when speaking about the
order of bytes, the order of the individual bits inside each byte is a
different thing (and it's virtually always something that only the
lowest levels -electronic components- concern themselves with)

--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/f3af818c-27b0-9071-bb3b-aaf09a21f185%40tiscali.it.

Re: unicode: UTF / UCS

On 27.07.21 20:42, Gabriele F wrote:
> relevant portions of the Unicode specification (unicode.org) are not
> very long or exceedingly hard to understand, but maybe you can find some
> more accessible description.

I will - i just prefer to believe in the working passion of
the crowd (not cloud:) ). Means, when my linux
is already configured with unicode it should
not use ascii anymore, and without the order that i have
to stick deep into the science of charsets.

Now, i am awakened with the interest of knowing more
about unicode charsets, especially with linux. I keep
myself busy with it hereafter.

> Most of all, UTF-8 is (normally) absolutely indistinguishable from
> normal US-ASCII until you use characters that were not in US-ASCII; so
> for example most English files will be bit-per-bit identical whether
> written in US-ASCII or UTF-8.

I spent some time with unicode pages. Therefore i thought to
remember that ascii characters encoded in unicode using
an different endian. But maybe i am wrong with this in
mind.
> https://www.mail-archive.com/vim_use@googlegroups.com/msg57383.html and
> the others of that thread. But you probably won't make much out of it
> until you know how at least UTF-8 is encoded.
> https://www.mail-archive.com/vim_use@googlegroups.com/msg57385.html .

thx, i appreciate *entropy*

> By the way, all of this means that it's not ascii that is "deprecated",
> but the various complimentary or alternative encodings that were (and
> still partly are) used to support non-English characters.

Inside of my amateur and dilettante mind i think it like
"right now our cpu's enforces themself with 64bit, why should
i notice an 7bit process as not deprecated"

*i like to write with green and comical slang because of
the entertainment value - hopefully its ok with our netiquette!*

sincerely
-kefko

--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/0ba57112-a074-f9f8-88eb-577fdcd13268%40googlemail.com.

Re: unicode: UTF / UCS

'Johannes Köhler' via vim_use wrote:
> *disorientation*
>
> The unix _manpage_ utf-8 describes unicode with 2-byte encoding. But
> _wikipedia_ indicates also 1-byte unicode
> with ascii compatibility.

(If I remember correctly) the first versions of Unicode had only a
2-byte encoding, so that (part of the) manpage is very old.



> Furthermore, be interested myself in the filesystem behavior
> and unicode with ucs-2. Is it possible to use a linux
> filesystem with 2-byte unicode encoding on principle.

I'm not so strong on Linux but filesystems shouldn't have anything to do
with text files encodings



> Due to the cause that linux creates a 2-byte file
> (1-byte character & 1-byte EOF) when creating it with
> touch, and inserting one character into it with vim.

I think it's vim that puts the EOF (see :help 'fixendofline'), not the
touch program or linux



> The bottom line is a 1-byte ascii file... Or a 1-byte
> unicode with ascii compatibility (that what i meant with
> endian abuse appearance).

I haven't understood this or other parts of the first message, but
you're probably thinking too much ahead, these issues have likely
nothing to do with endianness



> Present, i study autodidactic with electric circuits and
> the logical behavior. With that in mind it should be
> faster to use 2-byte all over instead of a 1-byte, 2-byte
> decision with the encoder, decoder.
>

It's not that simple unfortunately, UTF-16 (let's leave aside UCS-2, it
shouldn't matter) cannot be assumed to always have two bytes per
character, and some tests indicated that UTF-8 usually ends up being
better overall (utf8everywhere.org is certainly worth a look, I don't
remember if I agreed with it completely but it for sure is an
interesting document).



All in all, it's nice if you want to understand how things are at the
lower levels, it's quite fun to know it, but in order to achieve that
for text files these days you need to read the Unicode specification, at
least in its first parts; other sources are quite likely to cause more
confusion than clarity. To tackle the varied things you can run into on
the web and other information sources you'll probably also need to know
some of the earlier history of Unicode and the older encodings /
character sets.


Kind regards,
Gabriele

--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/0165ce1c-cd38-2d24-72b2-365849a8f788%40tiscali.it.

Re: unicode: UTF / UCS

On 27.07.21 18:09, Johannes Köhler wrote:
>
> [...]
>
> Is there a way to ensure working with true utf-8
> or better utf-16 files? Aim is to work with source
> files in unicode to exclude the deprecated ascii...
>

*disorientation*

The unix _manpage_ utf-8 describes unicode with 2-byte encoding. But
_wikipedia_ indicates also 1-byte unicode
with ascii compatibility.

So my issue is _partly_ obsolete.

I realized when setting 'bomb' option in vim there
is no inconsistent behavior anymore when using 2-byte
unicode ucs-2. The BOM header tells about
endianness, also.

Furthermore, be interested myself in the filesystem behavior
and unicode with ucs-2. Is it possible to use a linux
filesystem with 2-byte unicode encoding on principle.
Due to the cause that linux creates a 2-byte file
(1-byte character & 1-byte EOF) when creating it with
touch, and inserting one character into it with vim.
The bottom line is a 1-byte ascii file... Or a 1-byte
unicode with ascii compatibility (that what i meant with
endian abuse appearance).

Present, i study autodidactic with electric circuits and
the logical behavior. With that in mind it should be
faster to use 2-byte all over instead of a 1-byte, 2-byte
decision with the encoder, decoder.

- kefko




--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/39051db7-5e42-b006-26ea-885dac91b749%40googlemail.com.

Re: unicode: UTF / UCS (just sorry for the top-quote)

Apologies for top-quoting in the previous message, I forgot to delete
the quote

--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/cc20b49c-fc01-cf94-a5ba-962cf6dfdc50%40tiscali.it.

Re: unicode: UTF / UCS

Hi, first of all you seem to have misunderstandings about what UTF-8 and
the other Unicode encodings are. If you're interested and confident with
low-level things I advise you to learn exactly what they are. The
relevant portions of the Unicode specification (unicode.org) are not
very long or exceedingly hard to understand, but maybe you can find some
more accessible description.

Most of all, UTF-8 is (normally) absolutely indistinguishable from
normal US-ASCII until you use characters that were not in US-ASCII; so
for example most English files will be bit-per-bit identical whether
written in US-ASCII or UTF-8.

Then, there are many fairly complex issues in how files are read,
converted and written by the various parts of the system. Vim is an
especially problematic part, I had made an attempt of understanding it
in the message
https://www.mail-archive.com/vim_use@googlegroups.com/msg57383.html and
the others of that thread. But you probably won't make much out of it
until you know how at least UTF-8 is encoded.

Finally, if you really want to be sure of having all your files encoded
in Unicode (in UTF-8 or other encodings), then I applaud you and agree
with your concern, and I suggest the way I do it (yes there actually is
a way):
https://www.mail-archive.com/vim_use@googlegroups.com/msg57385.html .
The BOM mentioned there is a byte sequence that can be placed at the
beginning of text files and will be interpreted by unicode-aware
software as a sort of invisible declaration that the file is in a
certain Unicode encoding.

By the way, all of this means that it's not ascii that is "deprecated",
but the various complimentary or alternative encodings that were (and
still partly are) used to support non-English characters.

Kind regards,
Gabriele



P.S. I'm not sure I'll be able to further reply in the next days, I'm in
a complex situation






'Johannes Köhler' via vim_use wrote:
>
> Beloved vim'er!
>
> until shortly before... I never came up with
> the idea of doing: "thinking about the text file encoding
> of my files@hdd"
>
> I used unicode like a definition at my locales. Still in
> mind that my files are utf-8 encoded.
>
> BUT, after a file crash - during the system play with an
> old ext2 filesystem and gnu tar, i had an file header
> without file in my inodes. Like an condensor without
> payload :) AND, out of curiosity i probed a bit with vim
> files, and utf-8 (but btrfs) and an up-to-date archlinux.
>
> Then, I realized that there are three encoding views:
> keyboard, display(terminal), vim. Like, decoding pipes to
> an encoded socket. The encoded socket, the file itself,
> works partly inconsistent together with vim, xterm and
> the unixtool file.
>
> Setting: I create an file using xterm console and touch.
> Then, i open it with vim.
>
> Vim: enc & fenc = utf-8
> BUT file -i: us-ascii
>
> The file results with 2-byte per Character, yet like
> us-ascii inside of an unicode container. However, i
> like to have real unicode and not an endianness
> of us-ascii using 2-byte instead of 1-byte.
>
> Then @vim, i change the encoding to ucs-2 with :set fenc=ucs-2. I
> read@vimdoku ucs-2 and utf-8 is similar@linux
> Now :write, vim tells me [converted] and
> file (sometimes) tells me utf-8 like expected. The file
> size increases to 4-byte per character, like expected
> for ucs-4. Then reread @vim, shows me unreadable content.
> I have to ++enc it back to ucs-2. So, inside vim ucs-2 and utf-8 seems
> to be different. And @linux ucs-2 using
> filespace like ucs-4.
>
> Imaginary reasoning: my system wide (or kernel working)
> utf-8 differs from real unicode utf-8 by endianness
> abuse. Maybe because of compatibility...
> That is why the file tool works inconsistent
> (partly tells binary stuff instead of text encoding).
>
> Is there a way to ensure working with true utf-8
> or better utf-16 files? Aim is to work with source
> files in unicode to exclude the deprecated ascii...
>
> Sincerly
> -kefko
>

--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/fd8feffe-891b-5a14-223c-9ebdf99841ac%40tiscali.it.

unicode: UTF / UCS

Beloved vim'er!

until shortly before... I never came up with
the idea of doing: "thinking about the text file encoding
of my files@hdd"

I used unicode like a definition at my locales. Still in
mind that my files are utf-8 encoded.

BUT, after a file crash - during the system play with an
old ext2 filesystem and gnu tar, i had an file header
without file in my inodes. Like an condensor without
payload :) AND, out of curiosity i probed a bit with vim
files, and utf-8 (but btrfs) and an up-to-date archlinux.

Then, I realized that there are three encoding views:
keyboard, display(terminal), vim. Like, decoding pipes to
an encoded socket. The encoded socket, the file itself,
works partly inconsistent together with vim, xterm and
the unixtool file.

Setting: I create an file using xterm console and touch.
Then, i open it with vim.

Vim: enc & fenc = utf-8
BUT file -i: us-ascii

The file results with 2-byte per Character, yet like
us-ascii inside of an unicode container. However, i
like to have real unicode and not an endianness
of us-ascii using 2-byte instead of 1-byte.

Then @vim, i change the encoding to ucs-2 with :set fenc=ucs-2. I
read@vimdoku ucs-2 and utf-8 is similar@linux
Now :write, vim tells me [converted] and
file (sometimes) tells me utf-8 like expected. The file
size increases to 4-byte per character, like expected
for ucs-4. Then reread @vim, shows me unreadable content.
I have to ++enc it back to ucs-2. So, inside vim ucs-2 and utf-8 seems
to be different. And @linux ucs-2 using
filespace like ucs-4.

Imaginary reasoning: my system wide (or kernel working)
utf-8 differs from real unicode utf-8 by endianness
abuse. Maybe because of compatibility...
That is why the file tool works inconsistent
(partly tells binary stuff instead of text encoding).

Is there a way to ensure working with true utf-8
or better utf-16 files? Aim is to work with source
files in unicode to exclude the deprecated ascii...

Sincerly
-kefko

--
Wonderful vim doku:
When a mapping triggers itself, it will run forever
WEB www.johannes-koehler.de

--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/8713d446-fcc2-6ca8-2ba0-0162ebcaae61%40googlemail.com.

Sunday, July 25, 2021

Re: Insert non-rectangular selection

Hi Christian, all,

On 31.05.21 07:39, Christian Brabandt wrote:

> With the latest Vim 8.2.2914 you can now paste using `zp` that will not
> add any padding.

I completely missed this one. That's great news, and I just cloned this
version & it works exactly as expected.

Thanks very much to add this feature so fast - and sorry again for not
answering that long.

All the best
Andre

--
Andre Tann

--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/bb4e6aeb-6a89-b70e-61e2-7a1aaa8860df%40alphasrv.net.

Thursday, July 22, 2021

Re: Enabling/Disabling Vim features during compilation

Bump.

(I'm sorry, I don't know if this is allowed)

On 2021-07-19 17:19, lists@ifohancroft.com wrote:
> I would like to apologize if this shows up twice. I have posted it (I
> believe hours ago) to the @vim.org alias of the mailing list but it
> hasn't shown so I am guessing I need to use the @googlegroups.com
> address.
>
> Hi,
>
> I have a couple of questions that I couldn't find an answer for. I do
> suck at explaining so if anything is unclear, please let me know.
>
> 1. Obviously, excluding the features marked with '-', can each of the
> features in https://vimhelp.org/various.txt.html#%2Bfeature-list be
> explicitly enabled or disabled on its own during compilation?
>
> 2. Are there any features that can be disabled/enabled during
> compilation
> that can't be enabled/disabled by passing an option to ./configure?
>
> If the answer to #1 is yes and the answer to #2 is no - I see that
> ./configure --help doesn't list a separate option for each of the
> features, but there is --enable-FEATURE[=ARG] and --disable-FEATURE so
> I
> am guessing I just replace FEATURE with the name of the feature I wish
> to enable or disable and I don't actually include the + sign, just the
> plain feature name, however:
>
> 3.1. If builtin_terms is enabled, whether only some terminals will be
> builtin or all of them depends on whether builtin_terms is
> +builtin_terms or ++builtin_terms. How do I specify ++builtin_terms as
> --enable-FEATURE? Should it be --enable-+builtinterms?
>
> 3.2. I see that some features that have explicit enable/disable options
> for them and require passing an argument (for example the Perl
> interpreter option requires an argument whether it should be anbled or
> not and whether it should be dynamically loaded) have a +feature
> equivalent with separate options for the different arguments of the
> builtin enable/disable option. Very clever btw! In such a case, if I
> choose to enable the Perl interpret using --enable-perl and want it
> loaded dynamic, instead of setting --enable-perlinterp=dynamic, do I
> use
> just --enable-perl/dyn or should I use both --enable-perl and
> --enable-perl/dyn?
>
> Best Regards,
> IFo Hancroft
>
> --

--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/3baefa2922f1323ff0cb076627a57420%40ifohancroft.com.

Vim autoindent for scheme "#;" comments

So, I've recently started learning scheme lisp and found what I believe is a bug in Vim, regarding one-keyword-comments and indentation. But as I'm new to lisp, I think it's better to confirm that I'm not missing some option, before spamming the vim mailing list. Also I couldn't find anything about it either in :h todo nor on ddg/google.

Consider the following function with the expected indentation:

(define (lookup key #;in mapping)
  (let* [(((name . value) . remaining) mapping)]
    (if (eq? key name)
      value
      (lookup key remaining))))

Contrary this is how Vim indentates it automatically:

(define (lookup key #;in mapping)
                (let* [(((name . value) . remaining) mapping)]
                  (if (eq? key name)
                    value
                    (lookup key remaining))))


Now, removing the #;in comment, the indentation works as expected.
Finally I set for editing scheme files

:se filetype=scheme
:se lisp

Am I then missing an option?

--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/05218604-e127-4963-8e7a-28ee5cb545f9n%40googlegroups.com.

Tuesday, July 20, 2021

Re: Command Line Bookmark manager

Rameo - I am not certain that I understand what you are seeking, but possibly a personalized reference resource within VIM (e.g., see the following link) would be helpful. Stevan
http://technosophos.com/2014/10/09/create-built-in-vim-cheatsheet.html

On Monday, July 19, 2021 at 5:37:12 AM UTC-7 rameo wrote:
Thank you, even though it looks really good, it's much more than I wanted.
I was looking for something in vim itself and only focused on saving vim search/exec commands (like a bookmark manager).

On Saturday, July 17, 2021 at 5:37:56 PM UTC+2 stevelitt wrote:
rameo said on Fri, 16 Jul 2021 02:37:44 -0700 (PDT)

>Hi,
>
>Is there a possibility in Vim or a script that allows us to Bookmark
>or Pin Command Line commands?

You might like UMENU2: http://www.troubleshooters.com/projects/umenu2/

SteveT

Steve Litt
Spring 2021 featured book: Troubleshooting Techniques of the Successful
Technologist http://www.troubleshooters.com/techniques

--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/523ea955-0c60-4cb6-9236-57f9050dfc30n%40googlegroups.com.

Re: Vim mindmap functionality


Some one previously wanted to do something similar with forms and only being allowed to edit certain blocks.
The consensus (of those much smarter than me) was this is not feasible in how vim works.

(cue someone who will now provide a plugin to do exactly that)
On Tuesday, July 20, 2021 at 11:46:47 AM UTC-4 julk...@gmail.com wrote:
Hey everyone,
Thanks very much for your responses.
Coming back to this, I've found I still haven't found the solution I am looking for, as Google links to something else than I was hoping for.

Basically, I am not looking for a plug-in to visualize a graph, based on a certain indentation structure of a plaintext document being edited in Vim. The plaintext format is fine, for my purposes.

Rather, I am trying to still make that plaintext that I am editing in Vim have certain properties that make it more fundamentally like a mindmap. Most importantly, text should be bounded within certain regions. In effect, text should be contained within text boxes. You cannot write anywhere you want in the file. You can only enter text into text boxes, or whatever Vim's representation of a text box, to the same effect, is.

I would like to believe this is possible since Vim is so customizable. And I want to do it in Vim since increasingly everything I'm doing is in Vim.

So, is there any way to create a text box in Vim? I could just draw boxes with lines, but the deeper point is having Vim recognize that a box is an object or region where text is permitted, and blocking the entry of text outside of that object.

I'd really appreciate any help on this.

Thanks very much,
Julius


On Monday, July 5, 2021 at 9:43:31 PM UTC cfcol...@gmail.com wrote:
On Mon, Jul 5, 2021, 2:13 PM meine <tria...@gmx.com> wrote:
On Mon, Jul 05, 2021 at 07:59:58PM +0200, Julius Hamilton wrote:
> Hello,
>
> I wish to enable mindmapping functionality inside Vim by somehow treating
> regions of text as programmatic objects.

This one seems to be more aimed at programming:

https://github.com/severin-lemaignan/vim-minimap

//meine

--
--
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+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/YON19PBn48xCw5EA%40trackstand.


Some years back on this list, I saw this, which might be close to your goal:


--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/0c2b51a8-acb4-4938-9c55-0c8d13808612n%40googlegroups.com.

Re: Vim mindmap functionality

Hey everyone,
Thanks very much for your responses.
Coming back to this, I've found I still haven't found the solution I am looking for, as Google links to something else than I was hoping for.

Basically, I am not looking for a plug-in to visualize a graph, based on a certain indentation structure of a plaintext document being edited in Vim. The plaintext format is fine, for my purposes.

Rather, I am trying to still make that plaintext that I am editing in Vim have certain properties that make it more fundamentally like a mindmap. Most importantly, text should be bounded within certain regions. In effect, text should be contained within text boxes. You cannot write anywhere you want in the file. You can only enter text into text boxes, or whatever Vim's representation of a text box, to the same effect, is.

I would like to believe this is possible since Vim is so customizable. And I want to do it in Vim since increasingly everything I'm doing is in Vim.

So, is there any way to create a text box in Vim? I could just draw boxes with lines, but the deeper point is having Vim recognize that a box is an object or region where text is permitted, and blocking the entry of text outside of that object.

I'd really appreciate any help on this.

Thanks very much,
Julius


On Monday, July 5, 2021 at 9:43:31 PM UTC cfcol...@gmail.com wrote:
On Mon, Jul 5, 2021, 2:13 PM meine <tria...@gmx.com> wrote:
On Mon, Jul 05, 2021 at 07:59:58PM +0200, Julius Hamilton wrote:
> Hello,
>
> I wish to enable mindmapping functionality inside Vim by somehow treating
> regions of text as programmatic objects.

This one seems to be more aimed at programming:

https://github.com/severin-lemaignan/vim-minimap

//meine

--
--
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+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/YON19PBn48xCw5EA%40trackstand.


Some years back on this list, I saw this, which might be close to your goal:


--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/201c1831-ebe6-4b8d-ace2-4e626bff2039n%40googlegroups.com.

Monday, July 19, 2021

Enabling/Disabling Vim features during compilation

I would like to apologize if this shows up twice. I have posted it (I
believe hours ago) to the @vim.org alias of the mailing list but it
hasn't shown so I am guessing I need to use the @googlegroups.com
address.

Hi,

I have a couple of questions that I couldn't find an answer for. I do
suck at explaining so if anything is unclear, please let me know.

1. Obviously, excluding the features marked with '-', can each of the
features in https://vimhelp.org/various.txt.html#%2Bfeature-list be
explicitly enabled or disabled on its own during compilation?

2. Are there any features that can be disabled/enabled during
compilation
that can't be enabled/disabled by passing an option to ./configure?

If the answer to #1 is yes and the answer to #2 is no - I see that
./configure --help doesn't list a separate option for each of the
features, but there is --enable-FEATURE[=ARG] and --disable-FEATURE so I
am guessing I just replace FEATURE with the name of the feature I wish
to enable or disable and I don't actually include the + sign, just the
plain feature name, however:

3.1. If builtin_terms is enabled, whether only some terminals will be
builtin or all of them depends on whether builtin_terms is
+builtin_terms or ++builtin_terms. How do I specify ++builtin_terms as
--enable-FEATURE? Should it be --enable-+builtinterms?

3.2. I see that some features that have explicit enable/disable options
for them and require passing an argument (for example the Perl
interpreter option requires an argument whether it should be anbled or
not and whether it should be dynamically loaded) have a +feature
equivalent with separate options for the different arguments of the
builtin enable/disable option. Very clever btw! In such a case, if I
choose to enable the Perl interpret using --enable-perl and want it
loaded dynamic, instead of setting --enable-perlinterp=dynamic, do I use
just --enable-perl/dyn or should I use both --enable-perl and
--enable-perl/dyn?

Best Regards,
IFo Hancroft

--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/534ef97c364a5cb4551a119bdb0b45a8%40ifohancroft.com.

Re: Command Line Bookmark manager

Thank you, even though it looks really good, it's much more than I wanted.
I was looking for something in vim itself and only focused on saving vim search/exec commands (like a bookmark manager).

On Saturday, July 17, 2021 at 5:37:56 PM UTC+2 stevelitt wrote:
rameo said on Fri, 16 Jul 2021 02:37:44 -0700 (PDT)

>Hi,
>
>Is there a possibility in Vim or a script that allows us to Bookmark
>or Pin Command Line commands?

You might like UMENU2: http://www.troubleshooters.com/projects/umenu2/

SteveT

Steve Litt
Spring 2021 featured book: Troubleshooting Techniques of the Successful
Technologist http://www.troubleshooters.com/techniques

--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/08833cfe-7292-475c-bb23-b74c56f6ccb4n%40googlegroups.com.

Sunday, July 18, 2021

Re: Conversion Error

> Hi Robert,
>
> On Sunday, 2021-07-18 06:18:36 -0700, Robert Solomon wrote:
>
>> I often copy-paste from a browser into a text file to save the content I
>> come across. When I try to save the file, I often get a conversion error.
>> I have to manually go thru each error and change the extended character to
>> an ascii one.
> Likely the text pasted from clipboard is in a different text encoding
> (usually UTF-16 on Windows) than the file is saved in, and the file's
> text encoding can't represent all characters. Issue the command
>
> :set fenc?
>
> that displays the current fileencoding. To be on the safe side choose an
> encoding that can represent all Unicode characters, common is UTF-8.
>
> So,
>
> :set fileencoding=utf-8
>
> before saving.
>
> Best have encoding (taken from current locale) and fileencoding aligned
> set to utf-8, but things may be more complicated on Windows. See
> https://vim.fandom.com/wiki/Working_with_Unicode and the help sections
> it references.
>
> Eike
>

Hi Eike,

I think that was it.  It seems that the fenc for my files is latin1. 
I'll add a line in my _vimrc to set fenc=utf-8

Thanks

--rob

--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/8c23ee68-a991-07ed-c247-b252196621de%40gmail.com.

Re: Conversion Error

Hi Robert,

On Sunday, 2021-07-18 06:18:36 -0700, Robert Solomon wrote:

> I often copy-paste from a browser into a text file to save the content I
> come across. When I try to save the file, I often get a conversion error.
> I have to manually go thru each error and change the extended character to
> an ascii one.

Likely the text pasted from clipboard is in a different text encoding
(usually UTF-16 on Windows) than the file is saved in, and the file's
text encoding can't represent all characters. Issue the command

:set fenc?

that displays the current fileencoding. To be on the safe side choose an
encoding that can represent all Unicode characters, common is UTF-8.

So,

:set fileencoding=utf-8

before saving.

Best have encoding (taken from current locale) and fileencoding aligned
set to utf-8, but things may be more complicated on Windows. See
https://vim.fandom.com/wiki/Working_with_Unicode and the help sections
it references.

Eike

--
OpenPGP/GnuPG encrypted mail preferred in all private communication.
GPG key 0x6A6CD5B765632D3A - 2265 D7F3 A7B0 95CC 3918 630B 6A6C D5B7 6563 2D3A
Use LibreOffice! https://www.libreoffice.org/

--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/YPSYqcUUtiPDhYB4%40kulungile.erack.de.

Re: Conversion Error

I forgot to add that this is on a Windows 10 computer running gvim 8.2 w/ patches including 3049.

On Sunday, July 18, 2021 at 9:18:36 AM UTC-4 Robert Solomon wrote:
I often copy-paste from a browser into a text file to save the content I come across.  When I try to save the file, I often get a conversion error.  I have to manually go thru each error and change the extended character to an ascii one.

I don't understand why this happens.  Any file I see is saved on a server, so why can't vim also save that file? 
And, what do I do to automatically save the file?

Thx,
Rob

--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/53e016de-d95f-4783-8b72-905520246d13n%40googlegroups.com.

Conversion Error

I often copy-paste from a browser into a text file to save the content I come across.  When I try to save the file, I often get a conversion error.  I have to manually go thru each error and change the extended character to an ascii one.

I don't understand why this happens.  Any file I see is saved on a server, so why can't vim also save that file? 
And, what do I do to automatically save the file?

Thx,
Rob

--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/cde208a1-ad56-40e2-949c-be5b15e3fad2n%40googlegroups.com.

Saturday, July 17, 2021

Re: Command Line Bookmark manager

rameo said on Fri, 16 Jul 2021 02:37:44 -0700 (PDT)

>Hi,
>
>Is there a possibility in Vim or a script that allows us to Bookmark
>or Pin Command Line commands?

You might like UMENU2: http://www.troubleshooters.com/projects/umenu2/

SteveT

Steve Litt
Spring 2021 featured book: Troubleshooting Techniques of the Successful
Technologist http://www.troubleshooters.com/techniques

--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/20210717113744.0ead77fe%40mydesk.domain.cxm.

Friday, July 16, 2021

Re: Command Line Bookmark manager

Hi,

Vim command line commands

On Friday, July 16, 2021 at 4:37:21 PM UTC+2 rwmit...@gmail.com wrote:
On Friday, July 16, 2021 at 5:37:44 AM UTC-4 rameo wrote:
Hi,

Is there a possibility in Vim or a script that allows us to Bookmark or Pin Command Line commands?

I know there is such a thing for files and directories (eg FavMenu) but is there something similar for search and execute commands?

Thanks in advance.

Just to be clear, are you referring to Vim command line commands (:) or terminal/shell command line? 

--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/28215902-8965-46e7-929f-8c9c1dd95772n%40googlegroups.com.

Re: Command Line Bookmark manager


On Friday, July 16, 2021 at 5:37:44 AM UTC-4 rameo wrote:
Hi,

Is there a possibility in Vim or a script that allows us to Bookmark or Pin Command Line commands?

I know there is such a thing for files and directories (eg FavMenu) but is there something similar for search and execute commands?

Thanks in advance.

Just to be clear, are you referring to Vim command line commands (:) or terminal/shell command line? 

--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/b502694f-1790-463c-b081-56a341ccfcd4n%40googlegroups.com.

Command Line Bookmark manager

Hi,

Is there a possibility in Vim or a script that allows us to Bookmark or Pin Command Line commands?

I know there is such a thing for files and directories (eg FavMenu) but is there something similar for search and execute commands?

Thanks in advance.

--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/fe8df999-a98d-4d39-bcde-611df7f802b4n%40googlegroups.com.

Monday, July 12, 2021

Re: Seach and follow with keystrokes or a macro

* lgc <jdupont655@gmail.com> wrote:
> > Is there anyway to search and replace in a single colon command?
> Yes, use `:normal`, possibly in combination with `:global`. Record your
> key presses (` 9lv10l~0`) into the macro `q`. Then, execute:
>
> :%norm! @q
>
> To execute the macro on all the lines in the file.
>
> Or:
>
> :*norm! @q
>
> To execute the macro on all the lines which were in the last visual
> selection.
>
> Or:
>
> :g/^keyword:/norm! @q
>
> To execute the macro on all the line starting with the text `keyword:`.
Yes, thanks, I also found ...

:g[!]/pattern/exec 'norm[!]' "/pattern\<CR><cmd>"

It is very interesting.

--
Gua Chung Lim

Nothing ever exists entirely alone without dualities.

--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/YOw4nFunWAR8O0bn%40gmail.com.

Sunday, July 11, 2021

Re: Seach and follow with keystrokes or a macro

* 'c.willis111' via vim_use <vim_use@googlegroups.com> wrote:
> as you say, the task is not terribly clear.
> Once you've done a
> /^keyword
> you can find further instances with
> n
That's what I said.

> > Is there anyway to search and replace in a single colon command? Like ...
> >
> > :%s/^keyword/do_keystrokes/g
> > or
> > :%s/^keyword/do_a_macro/g
> It is not clear if you have some rule for the case required for various
> words. I notice that case occurs with different capitalisation where it
> hasn't obviously been mangled. If there's no rule, you're stuck with
> going through them all. The usual swap case is just
> ~
I know ~ and I have said that. Practically, there are many more keystrokes in different situations other than those of the letter case. Probably, my example is not good enough. My real question is that how to apply keystrokes in a single colon (:) command.

> So you can go through finding the next keyword with n and then right
> arrowing or tilding to get that line right.
> If on the other hand you can devise a rule for the capitalization, you
> can devise a set of commands such as
> :g/^keyword/s/toggle\c/TOGGLE/
> :g/^keyword/s/CASE\c/CASE/g
> :g/^keyword/s/CASE$/Case/
Probably, :g is what I am looking for. I previously thought of :%s. Thanks,

* 'Suresh Govindachar' via vim_use <vim_use@googlegroups.com> wrote:
> Yes -- see :help :g or :help multi-repeat
I shall try that.

Thank you very much.

--
Gua Chung Lim

Nothing ever exists entirely alone without dualities.

--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/YOq7Iva4YJTR//tQ%40gmail.com.

Saturday, July 10, 2021

Indentation file for jq

I want to indent jq files in vim. But I don't find a good vim indentation file. Does anybody know where is a well maintained jq indentation file for vim? Thanks.

--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/07d62a5e-6e6e-4c77-9aea-19afdabf2bc5n%40googlegroups.com.

Re: Seach and follow with keystrokes or a macro





------ Original Message ------
From: "Gua Chung Lim" <gua.chunglim@gmail.com>
To: vim_use@googlegroups.com
Sent: Saturday, 10 Jul, 2021 At 14:23
Subject: Seach and follow with keystrokes or a macro

Hi,

I have been using vim for years, I usually use @ macros. I have a question hard to explain. Assuming I have a text file ...

keyword: toggle CASE Retentive Case
keyword: TOGGLE case Retentive Case
keyword: togGLE CASE Retentive Case
...

And I want to toggle the case of some letters after ^keyword:.
Things I usually do is ...
/^keyword
then do the following keystrokes ...
9lv10l~0
And for the rest of file I can simply do ...
n.
to find the next match (n), and repeat the keystrokes (.)

Certainly, I can assign 9lv10l~0 to a macro. But what if I have 1,000+ lines like this, I would never want to use the macro for every line containing "^keyword". Is there anyway to search and replace in a single colon command? Like ...

:%s/^keyword/do_keystrokes/g
or
:%s/^keyword/do_a_macro/g

Thanks in advance,

--
Gua Chung Lim
Hi

as you say, the task is not terribly clear.

Once you've done a

/^keyword

you can find further instances with

n

It is not clear if you have some rule for the case required for various words. I notice that case occurs with different capitalisation where it hasn't obviously been mangled. If there's no rule, you're stuck with going through them all. The usual swap case is just

~

So you can go through finding the next keyword with n and then right arrowing or tilding to get that line right.

If on the other hand you can devise a rule for the capitalization, you can devise a set of commands such as

:g/^keyword/s/toggle\c/TOGGLE/
:g/^keyword/s/CASE\c/CASE/g
:g/^keyword/s/CASE$/Case/

which wd change all the toggles and cases to upper case, and then change all CASEs at the end of line to mixed case. The g command limits the change to lines starting keyword (lower case).

regards - Chris Willis
Nothing ever exists entirely alone without dualities.

--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/YOmfbxPeLlbqmz2M%40gmail.com.

Re: Seach and follow with keystrokes or a macro

On 7/10/2021 6:23 AM, Gua Chung Lim wrote:
> Hi,
>
> I have been using vim for years, I usually use @ macros. I have a question hard to explain. Assuming I have a text file ...
>
...
>
> Certainly, I can assign 9lv10l~0 to a macro. But what if I have 1,000+ lines like this, I would never want to [manually] use the macro for every line containing "^keyword". Is there anyway to search and replace in a single colon command? Like ...
>
> :%s/^keyword/do_keystrokes/g
> or
> :%s/^keyword/do_a_macro/g
>

Yes -- see :help :g or :help multi-repeat

--Suresh

--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/72de0cba-ab79-b933-b944-573c1e3cf583%40yahoo.com.

Re: Seach and follow with keystrokes or a macro


   > Is there anyway to search and replace in a single colon command?

Yes, use `:normal`, possibly in combination with `:global`.  Record your key presses (`    9lv10l~0`) into the macro `q`.  Then, execute:

    :%norm! @q

To execute the macro on all the lines in the file.

Or:

    :*norm! @q

To execute the macro on all the lines which were in the last visual selection.

Or:

    :g/^keyword:/norm! @q

To execute the macro on all the line starting with the text `keyword:`.


On Saturday, July 10, 2021 at 3:24:12 PM UTC+2 gua.ch...@gmail.com wrote:
Hi,

I have been using vim for years, I usually use @ macros. I have a question hard to explain. Assuming I have a text file ...

keyword: toggle CASE Retentive Case
keyword: TOGGLE case Retentive Case
keyword: togGLE CASE Retentive Case
...

And I want to toggle the case of some letters after ^keyword:.
Things I usually do is ...
/^keyword
then do the following keystrokes ...
9lv10l~0
And for the rest of file I can simply do ...
n.
to find the next match (n), and repeat the keystrokes (.)

Certainly, I can assign 9lv10l~0 to a macro. But what if I have 1,000+ lines like this, I would never want to use the macro for every line containing "^keyword". Is there anyway to search and replace in a single colon command? Like ...

:%s/^keyword/do_keystrokes/g
or
:%s/^keyword/do_a_macro/g

Thanks in advance,

--
Gua Chung Lim

Nothing ever exists entirely alone without dualities.

--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/bb67ddcd-3feb-4504-9662-a79530ce0837n%40googlegroups.com.

Seach and follow with keystrokes or a macro

Hi,

I have been using vim for years, I usually use @ macros. I have a question hard to explain. Assuming I have a text file ...

keyword: toggle CASE Retentive Case
keyword: TOGGLE case Retentive Case
keyword: togGLE CASE Retentive Case
...

And I want to toggle the case of some letters after ^keyword:.
Things I usually do is ...
/^keyword
then do the following keystrokes ...
9lv10l~0
And for the rest of file I can simply do ...
n.
to find the next match (n), and repeat the keystrokes (.)

Certainly, I can assign 9lv10l~0 to a macro. But what if I have 1,000+ lines like this, I would never want to use the macro for every line containing "^keyword". Is there anyway to search and replace in a single colon command? Like ...

:%s/^keyword/do_keystrokes/g
or
:%s/^keyword/do_a_macro/g

Thanks in advance,

--
Gua Chung Lim

Nothing ever exists entirely alone without dualities.

--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/YOmfbxPeLlbqmz2M%40gmail.com.

Friday, July 9, 2021

Re: [ANN] notmuch-vim 0.7 released

Hi,

On Fri, Jul 9, 2021 at 12:50 PM Steve Litt <slitt@troubleshooters.com> wrote:
> Felipe Contreras said on Wed, 07 Jul 2021 23:21:42 -0500

> >notmuch-vim is a fully-functional mail user agent implemented in vim.
> >It uses as inspiration other text-based MUAs such as mutt and sup, but
> >it's better because it uses two amazing programs: vim and notmuch.
> >
> >It by itself doesn't do much, following the UNIX philosophy you need
> >other tools to do anything useful: mbsync or offlineimap to fetch mail,
> >notmuch to index it, and sendmail or msmtp to send it, etc.
> >
> >Here's an example recorded session:
> >https://asciinema.org/a/oo4yUOQDDF2CrWZbzhZURFtTW
> >
> >For installation instructions and the works, check the GitHub repo:
> >https://github.com/felipec/notmuch-vim
> >
> >I stopped working on it in 2014, but I'm back.
>
> I've been looking to change email clients from Claws-Mail to something
> a little lighter. A couple questions about notmuch-vim...
>
> * If I use it with my local dovecot IMAP server, can I configure
> notmuch-vim to not delete messages I read, and only delete messages I
> explicitly delete from within notmuch-vim?

notmuch-vim doesn't really delete anything, tags are used to specify
what messages you want to see. If you search for "tag:unread", you'll
see messages that you haven't read, and once you mark a message as
read you won't see it in that view, but the message is still there
(similar to Gmail).

You can add a keymap to mark some messages as "deleted", and then
configure notmuch to exclude those messages from all the views, but
still, the messages are not really deleted, they just have the
"deleted" tag.

Furthermore you can synchronize some tags to Maildir flags, and
although at some point the "deleted" tag was synchronized to the
Trashed flag, that's not happening right now (although I think it
should).

So in short tags are mostly orthogonal to anything else.

> * When people send me HTML email, as they always do, is there something
> I can attach to notmuch-vim in order to format that HTML email as
> something readable, that shows links where they're supposed to be?
> (NOTE: I never SEND HTML email, so I'm only asking about receiving).

By default notmuch-vim uses "elinks -dump" to convert HTML email to
plain text, but you can configure any program you want.

Hopefully that answers your questions.

--
Felipe Contreras

--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/CAMP44s1_Dkt9%3DTDhcsRMTJkuzeS%2BXMwTJnF3agYoDxXo5fMB%2Bg%40mail.gmail.com.

Re: [ANN] notmuch-vim 0.7 released

Felipe Contreras said on Wed, 07 Jul 2021 23:21:42 -0500

>Hello,
>
>notmuch-vim is a fully-functional mail user agent implemented in vim.
>It uses as inspiration other text-based MUAs such as mutt and sup, but
>it's better because it uses two amazing programs: vim and notmuch.
>
>It by itself doesn't do much, following the UNIX philosophy you need
>other tools to do anything useful: mbsync or offlineimap to fetch mail,
>notmuch to index it, and sendmail or msmtp to send it, etc.
>
>Here's an example recorded session:
>https://asciinema.org/a/oo4yUOQDDF2CrWZbzhZURFtTW
>
>For installation instructions and the works, check the GitHub repo:
>https://github.com/felipec/notmuch-vim
>
>I stopped working on it in 2014, but I'm back.

I've been looking to change email clients from Claws-Mail to something
a little lighter. A couple questions about notmuch-vim...

* If I use it with my local dovecot IMAP server, can I configure
notmuch-vim to not delete messages I read, and only delete messages I
explicitly delete from within notmuch-vim?

* When people send me HTML email, as they always do, is there something
I can attach to notmuch-vim in order to format that HTML email as
something readable, that shows links where they're supposed to be?
(NOTE: I never SEND HTML email, so I'm only asking about receiving).

Thanks,

SteveT

Steve Litt
Spring 2021 featured book: Troubleshooting Techniques of the Successful
Technologist http://www.troubleshooters.com/techniques

--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/20210709135019.76dad717%40mydesk.domain.cxm.

Thursday, July 8, 2021

Re: Help converting function to Vim9 script

On 2021-07-07, lgc <jdupont655@gmail.com> wrote:
>> Any idea what would be the best way to convert the snippet above?
>
> Move the `i` variable in the script-local namespace.

Thanks for the thorough explanation. For now, I am keeping a function
instead of a def. But, as you say:

> FWIW, I would still refactor the code in Vim9. Mainly because of type
> checking, and for better readability.

I'll likely do that, using a script variable as you suggest.

Thanks,
Life.

--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/sc6u3t%2411j9%241%40ciao.gmane.io.

Wednesday, July 7, 2021

[ANN] notmuch-vim 0.7 released

Hello,

notmuch-vim is a fully-functional mail user agent implemented in vim.
It uses as inspiration other text-based MUAs such as mutt and sup, but
it's better because it uses two amazing programs: vim and notmuch.

It by itself doesn't do much, following the UNIX philosophy you need
other tools to do anything useful: mbsync or offlineimap to fetch mail,
notmuch to index it, and sendmail or msmtp to send it, etc.

Here's an example recorded session:
https://asciinema.org/a/oo4yUOQDDF2CrWZbzhZURFtTW

For installation instructions and the works, check the GitHub repo:
https://github.com/felipec/notmuch-vim

I stopped working on it in 2014, but I'm back.

Enjoy.

4 Aaron Borden
27 Felipe Contreras
1 Franz Fellner
1 John Gliksberg
1 Jules Aguillon

--
Felipe Contreras

--
--
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 on the web visit https://groups.google.com/d/msgid/vim_use/60e67d565af58_307445208a%40natae.notmuch.