Sunday, January 30, 2022

Re: vim9 script : how to port legacy argue

OK Thank you 

Le dim. 30 janv. 2022 à 18:45, bfrg <bfrg100@gmail.com> a écrit :
Ni Va,

This is explained under ':help vim9-variable-arguments'. Example:

vim9script
def Test(...args: list<string>)
    for i in args
        echo i
    endfor
enddef
command -nargs=+ Test call Test(<f-args>)


On 2022-01-30, Ni Va wrote:
> HI,
>
> According <f-args> argue used in legacy vimscript
>
> *Legacy caller*
> command! -nargs=? Foobar           call foobar#bar#foo(<f-args>)
>
> *Called legacy func*.
> function!  foobar#bar#foo  (...) abort
>
> Thank!
> NV
>
> --
> --
> 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/9971d7bb-fc75-483e-8337-fb3ef6dc8f71n%40googlegroups.com.

--
--
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 a topic in the Google Groups "vim_use" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vim_use/fSSKzHf51lE/unsubscribe.
To unsubscribe from this group and all its topics, 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/YfbK7DpXNlrmQAXf%40laptop.homenetwork.

--
--
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/CAOKxv4G4RMWDmcPWZiJkq35WMVc%3D0b__exucoDo-WU52_LmFxw%40mail.gmail.com.

Re: vim9 script : how to port legacy argue

Ni Va,

This is explained under ':help vim9-variable-arguments'. Example:

vim9script
def Test(...args: list<string>)
for i in args
echo i
endfor
enddef
command -nargs=+ Test call Test(<f-args>)


On 2022-01-30, Ni Va wrote:
> HI,
>
> According <f-args> argue used in legacy vimscript
>
> *Legacy caller*
> command! -nargs=? Foobar call foobar#bar#foo(<f-args>)
>
> *Called legacy func*.
> function! foobar#bar#foo (...) abort
>
> Thank!
> NV
>
> --
> --
> 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/9971d7bb-fc75-483e-8337-fb3ef6dc8f71n%40googlegroups.com.

--
--
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/YfbK7DpXNlrmQAXf%40laptop.homenetwork.

vim9 script : how to port legacy argue

HI,

According <f-args> argue used in legacy vimscript 

Legacy caller
command! -nargs=? Foobar           call foobar#bar#foo(<f-args>)

Called legacy func.
function!  foobar#bar#foo  (...) abort

Thank!
NV

--
--
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/9971d7bb-fc75-483e-8337-fb3ef6dc8f71n%40googlegroups.com.

Friday, January 21, 2022

Re: Disable Help

On 2022-01-21, Joseph Wulf wrote:
> And the answer is:  "set paste" prevents the mapping of <F1> out of existence.
> Cannot set paste before or after the "map! <F1> <nop>"; just cannot set it at
> all.

Congratulations!

> Which is a problem in my/our world.... as we use vim and paste a lot.

I'm fortunate to work in an environment where Vim knows about my
mouse clicks and paste usually just works. In addition to what Tim
wrote, you might try Ingo Karkat's UnconditionalPaste plugin. I've
been using its glp and gcp commands a lot recently to have more
control over how things are pasted.

Regards,
Gary

--
--
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/20220121165128.GD14109%40phoenix.

Re: Disable Help

On 2022-01-21 04:04, Joseph Wulf wrote:
> And the answer is: "set paste" prevents the mapping of <F1> out of
> existence.
> Cannot set paste before or after the "map! <F1> <nop>"; just cannot
> set it at all.
>
> Which is a problem in my/our world.... as we use vim and paste a
> lot.

You might want to read up at

:help 'pastetoggle'

which is a setting that allows you to toggle 'paste', documented in

:help new-options-5.4

saying

'pastetoggle' option: Key sequence that toggles 'paste'. Works
around the problem that mappings don't work in Insert mode when
'paste' is set.

There might be a way to abuse this into turning <f1> into a <nop>

-tim


--
--
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/20220121075559.42dfdefc%40bigbox.attlocal.net.

Re: Disable Help

And the answer is:  "set paste" prevents the mapping of <F1> out of existence.
Cannot set paste before or after the "map! <F1> <nop>"; just cannot set it at all.

Which is a problem in my/our world.... as we use vim and paste a lot.

R,
-Joe Wulf;  RHCSA(RHEL7), FITSP-D, CISSP, VCP3, CPO(USN/RET)
Tony Robbins:  "Management is focusing on getting someone to get a result. Leadership is producing a standard in someone that when you're gone, they will live by to produce higher level results consistently".




On Fri, Jan 21, 2022 at 3:22 AM Joseph Wulf <joseph.c.wulf@gmail.com> wrote:
Gary,

Thank you for all you've said, including explaining.  Roger all that!
I fixed the 'set nocompatible' as you pointed out into my core .vimrc.

I echo'd  "map! <f1> <nop"  > f1test

Next I did:  "/usr/bin/vim -N -u f1test --noplugin"

<F1> in CommandMode brought up help.  Did ":q".
Did 'i' for insert mode and <F1>  and NADA!!!
Very helpful directive troubleshooting.

I then added "map <f1> <nop" into f1test; now it looks like:
map <F1> <Nop>
map! <F1> <Nop>
Retried "/usr/bin/vim -N -u f1test --noplugin"--- and CommandMode/InsertMode attempts to <F1> properly FAIL!
VOILA!!

My fallacy was that I KNEW everything else in my .vimrc was good to go---just needed one more little detail to 'work right'.

Ok, I'm off to layer back in my .vimrc content to find the real source of my problem.
I'll follow up with what I find.

Thank you, Gary (and everyone else who has helped)!!

R,
-Joe Wulf;  RHCSA(RHEL7), FITSP-D, CISSP, VCP3, CPO(USN/RET)
Tony Robbins:  "Management is focusing on getting someone to get a result. Leadership is producing a standard in someone that when you're gone, they will live by to produce higher level results consistently".




On Fri, Jan 21, 2022 at 3:04 AM Gary Johnson <garyjohn@spocom.com> wrote:
On 2022-01-21, Joseph Wulf wrote:
> Gary,
>
> I moved .vimrc out of the way.
> Executed "\vim"   to negate my bash alias which does:  "alias vim='/usr/bin/vim
> -u ~/.vimrc'"
>
> I first did '<F1>' and got the help, and quit out of it ":q"
> I next did 'a' and then did '<F1>' and got the help, and quit out of it ":q"
>
> The results from ":verbose map! <F1>" was "No mapping found"---------same for "
> :verbose map <F1>.
>
> Thank you... I appreciate the help.
> I've spent a couple hours this evening browsing through the VIM ":help".... to
> see what more I could learn.

Joe,

The point of the experiment was to try to discover what it is in
your setup that causes the insert- and command-mode mapping of <f1>
(i.e., "map! <f1> <nop>") to disappear or become ineffective.  If
you move your ~/.vimrc out of the way, we don't learn anything.

That said, it may not have been a very good experiment because the
:verbose command would not have said where F1 became unmapped.
(I'm experimenting with a very old 7.2.330 Vim on an even older
Ubuntu 10.04 system.)

One approach would be to create a file, say f1test, put in this one
line:

    map! <f1> <nop>

and start vim like this:

    /usr/bin/vim -N -u f1test

Then see if typing the F1 while in insert mode still brings up help.

If that works to stop F1 from bringing up help, then slowly add
lines to f1test from your ~/.vimrc until it fails.

If that doesn't work, then it may be a plugin.  You can start Vim as

    /usr/bin/vim -N -u f1test --noplugin

to see if that works.

I did see something in your ~/.vimrc that you should change.
I don't know whether or not it affects this problem, but it will
likely cause other problems.  You have

    set nocompatible

in the middle of that file.  It should be at the very top, the first
thing executed.  See

    :help 'compatible'

Regards,
Gary

--
--
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/20220121080435.GC14109%40phoenix.

--
--
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/CAJ8cad8MJaid6Z-fMq0LLOg5u3THBbm97MfCSOCNxa1SVrRf%2Bg%40mail.gmail.com.

Re: Disable Help

Gary,

Thank you for all you've said, including explaining.  Roger all that!
I fixed the 'set nocompatible' as you pointed out into my core .vimrc.

I echo'd  "map! <f1> <nop"  > f1test

Next I did:  "/usr/bin/vim -N -u f1test --noplugin"

<F1> in CommandMode brought up help.  Did ":q".
Did 'i' for insert mode and <F1>  and NADA!!!
Very helpful directive troubleshooting.

I then added "map <f1> <nop" into f1test; now it looks like:
map <F1> <Nop>
map! <F1> <Nop>
Retried "/usr/bin/vim -N -u f1test --noplugin"--- and CommandMode/InsertMode attempts to <F1> properly FAIL!
VOILA!!

My fallacy was that I KNEW everything else in my .vimrc was good to go---just needed one more little detail to 'work right'.

Ok, I'm off to layer back in my .vimrc content to find the real source of my problem.
I'll follow up with what I find.

Thank you, Gary (and everyone else who has helped)!!

R,
-Joe Wulf;  RHCSA(RHEL7), FITSP-D, CISSP, VCP3, CPO(USN/RET)
Tony Robbins:  "Management is focusing on getting someone to get a result. Leadership is producing a standard in someone that when you're gone, they will live by to produce higher level results consistently".




On Fri, Jan 21, 2022 at 3:04 AM Gary Johnson <garyjohn@spocom.com> wrote:
On 2022-01-21, Joseph Wulf wrote:
> Gary,
>
> I moved .vimrc out of the way.
> Executed "\vim"   to negate my bash alias which does:  "alias vim='/usr/bin/vim
> -u ~/.vimrc'"
>
> I first did '<F1>' and got the help, and quit out of it ":q"
> I next did 'a' and then did '<F1>' and got the help, and quit out of it ":q"
>
> The results from ":verbose map! <F1>" was "No mapping found"---------same for "
> :verbose map <F1>.
>
> Thank you... I appreciate the help.
> I've spent a couple hours this evening browsing through the VIM ":help".... to
> see what more I could learn.

Joe,

The point of the experiment was to try to discover what it is in
your setup that causes the insert- and command-mode mapping of <f1>
(i.e., "map! <f1> <nop>") to disappear or become ineffective.  If
you move your ~/.vimrc out of the way, we don't learn anything.

That said, it may not have been a very good experiment because the
:verbose command would not have said where F1 became unmapped.
(I'm experimenting with a very old 7.2.330 Vim on an even older
Ubuntu 10.04 system.)

One approach would be to create a file, say f1test, put in this one
line:

    map! <f1> <nop>

and start vim like this:

    /usr/bin/vim -N -u f1test

Then see if typing the F1 while in insert mode still brings up help.

If that works to stop F1 from bringing up help, then slowly add
lines to f1test from your ~/.vimrc until it fails.

If that doesn't work, then it may be a plugin.  You can start Vim as

    /usr/bin/vim -N -u f1test --noplugin

to see if that works.

I did see something in your ~/.vimrc that you should change.
I don't know whether or not it affects this problem, but it will
likely cause other problems.  You have

    set nocompatible

in the middle of that file.  It should be at the very top, the first
thing executed.  See

    :help 'compatible'

Regards,
Gary

--
--
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/20220121080435.GC14109%40phoenix.

--
--
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/CAJ8cad-Y43XFgW%2BTfXSZVXT-wtJBxYQskVe_WziOULbNrQtcDA%40mail.gmail.com.

Re: Disable Help

On 2022-01-21, Joseph Wulf wrote:
> Gary,
>
> I moved .vimrc out of the way.
> Executed "\vim"   to negate my bash alias which does:  "alias vim='/usr/bin/vim
> -u ~/.vimrc'"
>
> I first did '<F1>' and got the help, and quit out of it ":q"
> I next did 'a' and then did '<F1>' and got the help, and quit out of it ":q"
>
> The results from ":verbose map! <F1>" was "No mapping found"---------same for "
> :verbose map <F1>.
>
> Thank you... I appreciate the help.
> I've spent a couple hours this evening browsing through the VIM ":help".... to
> see what more I could learn.

Joe,

The point of the experiment was to try to discover what it is in
your setup that causes the insert- and command-mode mapping of <f1>
(i.e., "map! <f1> <nop>") to disappear or become ineffective. If
you move your ~/.vimrc out of the way, we don't learn anything.

That said, it may not have been a very good experiment because the
:verbose command would not have said where F1 became unmapped.
(I'm experimenting with a very old 7.2.330 Vim on an even older
Ubuntu 10.04 system.)

One approach would be to create a file, say f1test, put in this one
line:

map! <f1> <nop>

and start vim like this:

/usr/bin/vim -N -u f1test

Then see if typing the F1 while in insert mode still brings up help.

If that works to stop F1 from bringing up help, then slowly add
lines to f1test from your ~/.vimrc until it fails.

If that doesn't work, then it may be a plugin. You can start Vim as

/usr/bin/vim -N -u f1test --noplugin

to see if that works.

I did see something in your ~/.vimrc that you should change.
I don't know whether or not it affects this problem, but it will
likely cause other problems. You have

set nocompatible

in the middle of that file. It should be at the very top, the first
thing executed. See

:help 'compatible'

Regards,
Gary

--
--
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/20220121080435.GC14109%40phoenix.

Thursday, January 20, 2022

Re: Disable Help

Gary,

I moved .vimrc out of the way.
Executed "\vim"   to negate my bash alias which does:  "alias vim='/usr/bin/vim -u ~/.vimrc'"

I first did '<F1>' and got the help, and quit out of it ":q"
I next did 'a' and then did '<F1>' and got the help, and quit out of it ":q"

The results from ":verbose map! <F1>" was "No mapping found"---------same for ":verbose map <F1>.

Thank you... I appreciate the help.
I've spent a couple hours this evening browsing through the VIM ":help".... to see what more I could learn.


R,
-Joe Wulf;  RHCSA(RHEL7), FITSP-D, CISSP, VCP3, CPO(USN/RET)
Tony Robbins:  "Management is focusing on getting someone to get a result. Leadership is producing a standard in someone that when you're gone, they will live by to produce higher level results consistently".




On Fri, Jan 21, 2022 at 2:00 AM Gary Johnson <garyjohn@spocom.com> wrote:
On 2022-01-20, Joseph Wulf wrote:

Joe,

> "map <F1> <Nop>" is all that works for me, so far, during Normal/Command mode
> to prevent bringing up VIM HELP.
> This is placed at the bottom of my .vimrc.
>
> Attempting, "map! <F1> <Nop>"  is accepted, but does not prevent the <F1>,
> while in INSERT mode, from bringing up VIM HELP .
> No form I tried of 'tmap' would be accepted by vim.
>
> For what it is worth, I'm using CentOS 7.9, with KDE desktop, Konsole terminal
> windows, patched via the latest yum update.
> VIM is version 7.4 (2013 Aug 10, compiled Dec 15 2020 16:44:08);  Included
> patches: 1-207, 209-629
> Konsole terminals are standardized black background, zero transparency and
> green text.
>
> I've included my entire .vimrc (current state) below my signature (and
> in-between the lines of dashes), for critique/reference/review.
> I'm really proud of my status line, too.

I didn't see anything there that should cause this.

I know we've been through this before in bits and pieces, but I'd
like to be sure that we're all on the same page.

Please try the following.

1.  Start vim without any arguments:

        vim

2.  Enter insert mode by typing

        a

3.  Type the F1 key.  This will presumably bring up Vim's help.

4.  Exit the help window by executing

        :q

5.  Execute this:

        :verbose map! <f1>

6.  Let us know the results of that last command.

Regards,
Gary

--
--
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/20220121070049.GB14109%40phoenix.

--
--
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/CAJ8cad-6K%2BXX9yGEWqhjbHMmjGsXt-fLtGFAGrnXQ1Ha1LyZ3Q%40mail.gmail.com.

Re: Disable Help

On 2022-01-20, Joseph Wulf wrote:

Joe,

> "map <F1> <Nop>" is all that works for me, so far, during Normal/Command mode
> to prevent bringing up VIM HELP.
> This is placed at the bottom of my .vimrc.
>
> Attempting, "map! <F1> <Nop>"  is accepted, but does not prevent the <F1>,
> while in INSERT mode, from bringing up VIM HELP .
> No form I tried of 'tmap' would be accepted by vim.
>
> For what it is worth, I'm using CentOS 7.9, with KDE desktop, Konsole terminal
> windows, patched via the latest yum update.
> VIM is version 7.4 (2013 Aug 10, compiled Dec 15 2020 16:44:08);  Included
> patches: 1-207, 209-629
> Konsole terminals are standardized black background, zero transparency and
> green text.
>
> I've included my entire .vimrc (current state) below my signature (and
> in-between the lines of dashes), for critique/reference/review.
> I'm really proud of my status line, too.

I didn't see anything there that should cause this.

I know we've been through this before in bits and pieces, but I'd
like to be sure that we're all on the same page.

Please try the following.

1. Start vim without any arguments:

vim

2. Enter insert mode by typing

a

3. Type the F1 key. This will presumably bring up Vim's help.

4. Exit the help window by executing

:q

5. Execute this:

:verbose map! <f1>

6. Let us know the results of that last command.

Regards,
Gary

--
--
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/20220121070049.GB14109%40phoenix.

Re: Disable Help

Tony,

"map <F1> <Nop>" is all that works for me, so far, during Normal/Command mode to prevent bringing up VIM HELP.
This is placed at the bottom of my .vimrc.

Attempting, "map! <F1> <Nop>"  is accepted, but does not prevent the <F1>, while in INSERT mode, from bringing up VIM HELP .
No form I tried of 'tmap' would be accepted by vim.

For what it is worth, I'm using CentOS 7.9, with KDE desktop, Konsole terminal windows, patched via the latest yum update.
VIM is version 7.4 (2013 Aug 10, compiled Dec 15 2020 16:44:08);  Included patches: 1-207, 209-629
Konsole terminals are standardized black background, zero transparency and green text.

I've included my entire .vimrc (current state) below my signature (and in-between the lines of dashes), for critique/reference/review.
I'm really proud of my status line, too.

Thank you to everyone who's been helping me on this!

R,
-Joe Wulf;  RHCSA(RHEL7), FITSP-D, CISSP, VCP3, CPO(USN/RET)
Tony Robbins:  "Management is focusing on getting someone to get a result. Leadership is producing a standard in someone that when you're gone, they will live by to produce higher level results consistently".

-----------------------------------------------------------------------------------
" .vimrc

" Standardized .vimrc file;  Written/implemented by:  Joe Wulf, 20220120@1925.
" Leading DoubleQuote--This is the right way to comment out a line in .vimrc.
" Primary Reference:  man 1 vim    -and-  :help (while in vim)

let $TMPDIR = expand('~/tmp')  " Should ease using VIM 'help', among other benefits of a local per-user-based 'tmp' storage.
                               " Supported by standard linux user-creation template which has ~/.tmp inherently there.

" Available/default colorschemes (RHEL7x/8x -- vim74+); typically found at: /usr/share/vim/vim<vernum>/colors
"colo blue
"colo darkblue
"colo default    " default
"colo delek      " ok; hard though with tons of RED
"colo desert
"colo elflord
"colo evening
"colo industry   " Only in RHEL8x
 colo koehler    " good +1 for GreenText w/ BlackBackground
"colo morning
"colo murphy
"colo pablo      " ok
"colo peachpuff
"colo ron
"colo shine
"colo slate      " good
"colo torte
"colo zellner

scriptencoding utf-8           " Do all the sets
set autoread                   " Attempts to monitor currently open file(s); watching for changes outside of VI/VIM and notifying you
set background=dark            "
set bs=eol,indent,start        " Allow backspacing over everything while in insert mode
set confirm                    " Always raise a dialog instead of failing out
set cursorline                 " Default highlight current line; opposite of [set nocursorline]; on by default
set fileencoding=utf-8         " Rounds out environment locale compliance with  'LANG=en_US.UTF-8'
set encoding=utf-8             " Rounds out environment locale compliance with  'LANG=en_US.UTF-8'
set history=10000              " Sufficiently voluminous history of VIM commands, per user
set hlsearch                   " Highlight search-term/matches
set incsearch                  " Highlight / immediately search as characters are typed
set laststatus=2               " Always display the status line
set modelines=0                " Addresses security issues; Ref:  https://www.gilesorr.com/blog/vim-tips-22-modelines.html
set mouse-=a                   " Disable automatically entering visual mode
"et mouse=a                    " Enable the mouse for scrolling (bad for pasting via mouse)
set noeb novb t_vb=            " NoErrorbells and t_VisualBell; unset; is another opportunity to achieve blessed silence
set noflash                    " Disable visual flashing for error(s)
set noignorecase               " Force ignoring cAsE when [/?] searching, off by default
set novb                       " Disable visual bell for error(s)
"et number                     " Would enable line numbering; not advisable as a default
set paste                      " Allows pasting in, without typical auto-formatting
"et scrolloff=5                " This will keep the cursor at least 5 lines away from the top or bottom of the editor window (not advisable); Nbr can be locally adjusted
"et showcmd                    " Shows partial commands in the last line of the screen, but by default, do not want this behavior
set showmatch                  " Highlight matching pairs of the following sets of character-pairs:  "[{('``')}]", even works across multiple lines
set showmode                   " Always indicate mode (Command/Insert) on the ruler/status line
set t_Co=256                   " Explicitly force the state where the terminal has 256 colors
set title                      " Change the terminal's title based on the file being edited; very useful in a terminal window with multiple tabs (i.e. KDE Konsole)
set undolevels=1000            " Provide for many mucho levels of undo, per vi-session, per file

                               " Next are the unsets
set nocompatible               " Gets rid of the crap that Vim does to be vi compatible, thus vim is substantially improved
"et nocursorline               " Does the opposite of (set cursorline) which highlights the current line with and edge-to-edge underline; off by default
set noerrorbells               " No damned audible 'bell' to bother with;    Ref:  https://vim.fandom.com/wiki/Disable_beeping
set nomodeline                 " Addresses security issues; Ref:  https://alioth-lists-archive.debian.net/pipermail/pkg-vim-maintainers/2007-June/004020.html
"et nopaste                    " Toggled off, allows formatting of pasted content; opposite of 'set paste'
set novisualbell               " No damned visual 'bell' to be bothered by;  Ref:  https://vim.fandom.com/wiki/Disable_beeping

syntax reset                   " Puts syntax color highlighting back to sane defaults
set syntax=on                  " Set syntax color highlighting on by default or use:  ':syntax off' to disable
syntax on                      " Further ensures syntax highlighting is on/enabled

" Reference:  https://vim.fandom.com/wiki/Have_Vim_check_automatically_if_the_file_has_changed_externally; specifically see:  'Alternative Solutions'!
" -- Will reload target file content when entering the buffer or gaining focus; trigger autoread reload when changing buffers or coming back to vim
au FocusGained,BufEnter * :silent! !
" -- Will save when exiting the buffer or losing focus; not enabled by default; must still TEST, use with caution.
" au FocusLost,WinLeave * :silent! w

if has('autocmd') && has('gui_running')
   " Disables beeping and visual bells even in Vim GUI.
   " If-check prevents error when /usr/bin/vim isn't compiled with autoCMD; typically it is by default.
   autoCMD GUIEnter * set noerrorbells novisualbell t_vb=
endif

" Set this StatusLine look/feel 'after' the colorscheme is merged in (up above).
" Reference:  http://vimdoc.sourceforge.net/htmldoc/options.html#'statusline'
" This statusline example is 'OK' on Green Text w/ Black Background
" hi StatusLine     term=bold,reverse  cterm=bold ctermfg=black ctermbg=cyan gui=bold guifg=blue guibg=white"
" This statusline example is 'Great' on GreenText w/ BlackBackground
hi StatusLine     term=bold,reverse  cterm=bold ctermfg=white ctermbg=blue gui=bold guifg=blue guibg=white"

" Must still document this line structure!!!
" Construct a highly useful standard status line to be displayed [example ruler/status line view; 'set' command which achieves it].
" Modern version--viable in a terminal only 80 columns wide; generally most useful in terminal 90+ columns wide (based on length of filename being edited).
" [RO] [+] -(x)- Buf[1]                                          Fmt[unix[conf]] (C:001|L:001/329)  A[035] H[23] (  0%|b:00001)-
"
set statusline=%<%r\ %m\ -(%f)-%w\ Buf[%n]%=\ Fmt[%{&ff}%y]\ (C:%03c\|L:%03l/%03L)\ A[\%03.3b]\ H[%02.2B]\ (%3p%%\|b:%05o)-

" This will center the next forward (/) found search result into the center of the shell window.
" Reference:  https://vi.stackexchange.com/questions/13641/how-can-i-center-the-window-on-each-search-result
function! CenteredFindNext(forward)
    " save the current value for later restore
    let s:so_curr=&scrolloff
    set scrolloff=999
    try
        if a:forward
            silent normal! n
        else
            silent normal! N
        endif
    finally
        " restore no matter what
        let &scrolloff=s:so_curr
    endtry
endfunction
nnoremap <silent>n :call CenteredFindNext(1)<CR>
nnoremap <silent>N :call CenteredFindNext(0)<CR>

" Unmap <F1> from being the ESC out to VI help.  ":help" clearly will always continue to work.
" Reference:  https://vim.fandom.com/wiki/Disable_F1_built-in_help_key
cmap <F1> <Nop>
imap <F1> <Nop>
lmap <F1> <Nop>
map <F1> <Nop>
map! <F1> <nop>
nmap <F1> <Nop>
omap <F1> <Nop>
smap <F1> <Nop>
vmap <F1> <Nop>
xmap <F1> <Nop>
"
"map! <F1> <nop>   " Doesn't work
"tmap <F1> <Nop>   " Doesn't work
"imap! <F1> <nop>  " BAD
"nmap! <F1> <nop>  " BAD
"iu <F1>           " BAD
"unm <F1>          " BAD
"imap <F1> :echo<CR>
"nmap <F1> :echo<CR>
"inoremap <F1> <esc>
"inoremap <F1> <Nop>

"
" NUGGETS/LessonsLearned of vim goodies:
" -  /[^\x00-\x7f]   " This will do a NEGATIVE search; good for finding non-ascii characters.
" -  :%s/\\n/\r/g    " This will convert all null's (\n) in a given text file, to real CR's
" -  set nowrap      " This will stop vi from wrapping lines of text in the window (leaveing some longer lines visually 'chopped off'; sometimes helpful).
"
" Additional helpful VI references:
" -  https://unix.stackexchange.com/questions/199203/why-does-vim-indent-pasted-code-incorrectly
" -  https://vim.fandom.com/wiki/Disable_automatic_comment_insertion
" -  https://vim.fandom.com/wiki/Pasting_code_with_syntax_coloring_in_emails
"

-----------------------------------------------------------------------------------


On Thu, Jan 20, 2022 at 4:30 PM Tony Mechelynck <antoine.mechelynck@gmail.com> wrote:
On Thu, Jan 20, 2022 at 4:26 PM Joseph Wulf <joseph.c.wulf@gmail.com> wrote:
>
> Gary,
>
> Little closer......The results for "i' were:
> i  <F1>          <Nop>         Last set from ~/.vimrc
> In my previous email, I showed that (I thought) I'd addressed ALL the modes (c, i, l, n, o, s, v, x).

Normally, using

        map <F1> <Nop>
        map! <F1> <Nop>

ought to work for all usual modes: with exclamation mark for Insert
and Command-line modes, without it for Normal, Visual (i.e. s+x) and
Operator-pending. If you use the terminal window you may have to add a
tmap. Language mappings are used when keymaps are active (i.e.
'iminsert' is equal to 1, toggled by Ctrl-^), any key with no langmap
defined defaults to whatever it does in "standard" Insert mode. See
:help :map-commands

Best regards,
Tony.
>
> R,
> -Joe Wulf;  RHCSA(RHEL7), FITSP-D, CISSP, VCP3, CPO(USN/RET)
> Tony Robbins:  "Management is focusing on getting someone to get a result. Leadership is producing a standard in someone that when you're gone, they will live by to produce higher level results consistently".
>
>
>
>
> On Wed, Jan 19, 2022 at 7:38 PM Gary Johnson <garyjohn@spocom.com> wrote:
>>
>> On 2022-01-19, Joseph Wulf wrote:
>> > Gary,
>> >
>> > Thank you.
>> >
>> > That's interesting.
>> > In doing  ":verbose map <f1>", I get the following output:
>> > x  <F1>          <Nop>               Last set from ~/.vimrc
>> > s  <F1>          <Nop>               Last set from ~/.vimrc
>> > o  <F1>          <Nop>               Last set from ~/.vimrc
>> > n  <F1>          <Nop>               Last set from ~/.vimrc
>> >
>> > While in my .vimrc, I have:
>> > cmap <F1> <nop>
>> > imap <F1> <nop>
>> > lmap <F1> <nop>
>> > nmap <F1> <nop>
>> > omap <F1> <nop>
>> > smap <F1> <nop>
>> > vmap <F1> <nop>
>> > xmap <F1> <nop>
>> >
>> > At the moment, in command-mode, <F1> is properly NOT working, while in INSERT
>> > mode, <F1> still does bring up the help.
>> > I can see I'm getting closer, as I'm half-way there.
>>
>> Joe,
>>
>> Thanks for showing all that.  Interesting that your insert-mode
>> mapping doesn't work.  I was thinking that
>>
>>     verbose map <f1>
>>
>> would show all maps of <f1>, but it doesn't.  It doesn't show
>> insert-mode maps.  Obvious on reflection, but I don't always
>> reflect.  To see those, execute
>>
>>     :verbose imap <f1>
>>
>> HTH,
>> Gary
>>
>> --
>> --
>> 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/20220120003914.GA14109%40phoenix.
>
> --
> --
> 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/CAJ8cad-aZORqWSjdqiZMexQwUQ%2BsSyQ%2BzLazhpzO2GQVxE1XTw%40mail.gmail.com.

--
--
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/CAJkCKXutxVKcinNVcSkyTL9AKP47ZnfXrSwXuO5amF1tJU32Hw%40mail.gmail.com.

--
--
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/CAJ8cad_e68%2BpOKjzvQdQtCK8jsZav5DXQMgT03Apeoz5OdUoXQ%40mail.gmail.com.

Re: Disable Help

On Thu, Jan 20, 2022 at 4:26 PM Joseph Wulf <joseph.c.wulf@gmail.com> wrote:
>
> Gary,
>
> Little closer......The results for "i' were:
> i <F1> <Nop> Last set from ~/.vimrc
> In my previous email, I showed that (I thought) I'd addressed ALL the modes (c, i, l, n, o, s, v, x).

Normally, using

map <F1> <Nop>
map! <F1> <Nop>

ought to work for all usual modes: with exclamation mark for Insert
and Command-line modes, without it for Normal, Visual (i.e. s+x) and
Operator-pending. If you use the terminal window you may have to add a
tmap. Language mappings are used when keymaps are active (i.e.
'iminsert' is equal to 1, toggled by Ctrl-^), any key with no langmap
defined defaults to whatever it does in "standard" Insert mode. See
:help :map-commands

Best regards,
Tony.
>
> R,
> -Joe Wulf; RHCSA(RHEL7), FITSP-D, CISSP, VCP3, CPO(USN/RET)
> Tony Robbins: "Management is focusing on getting someone to get a result. Leadership is producing a standard in someone that when you're gone, they will live by to produce higher level results consistently".
>
>
>
>
> On Wed, Jan 19, 2022 at 7:38 PM Gary Johnson <garyjohn@spocom.com> wrote:
>>
>> On 2022-01-19, Joseph Wulf wrote:
>> > Gary,
>> >
>> > Thank you.
>> >
>> > That's interesting.
>> > In doing ":verbose map <f1>", I get the following output:
>> > x <F1> <Nop> Last set from ~/.vimrc
>> > s <F1> <Nop> Last set from ~/.vimrc
>> > o <F1> <Nop> Last set from ~/.vimrc
>> > n <F1> <Nop> Last set from ~/.vimrc
>> >
>> > While in my .vimrc, I have:
>> > cmap <F1> <nop>
>> > imap <F1> <nop>
>> > lmap <F1> <nop>
>> > nmap <F1> <nop>
>> > omap <F1> <nop>
>> > smap <F1> <nop>
>> > vmap <F1> <nop>
>> > xmap <F1> <nop>
>> >
>> > At the moment, in command-mode, <F1> is properly NOT working, while in INSERT
>> > mode, <F1> still does bring up the help.
>> > I can see I'm getting closer, as I'm half-way there.
>>
>> Joe,
>>
>> Thanks for showing all that. Interesting that your insert-mode
>> mapping doesn't work. I was thinking that
>>
>> verbose map <f1>
>>
>> would show all maps of <f1>, but it doesn't. It doesn't show
>> insert-mode maps. Obvious on reflection, but I don't always
>> reflect. To see those, execute
>>
>> :verbose imap <f1>
>>
>> HTH,
>> Gary
>>
>> --
>> --
>> 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/20220120003914.GA14109%40phoenix.
>
> --
> --
> 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/CAJ8cad-aZORqWSjdqiZMexQwUQ%2BsSyQ%2BzLazhpzO2GQVxE1XTw%40mail.gmail.com.

--
--
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/CAJkCKXutxVKcinNVcSkyTL9AKP47ZnfXrSwXuO5amF1tJU32Hw%40mail.gmail.com.

Re: Disable Help

Gary,

Little closer......The results for "i' were:
i  <F1>          <Nop>         Last set from ~/.vimrc
In my previous email, I showed that (I thought) I'd addressed ALL the modes (c, i, l, n, o, s, v, x).

R,
-Joe Wulf;  RHCSA(RHEL7), FITSP-D, CISSP, VCP3, CPO(USN/RET)
Tony Robbins:  "Management is focusing on getting someone to get a result. Leadership is producing a standard in someone that when you're gone, they will live by to produce higher level results consistently".




On Wed, Jan 19, 2022 at 7:38 PM Gary Johnson <garyjohn@spocom.com> wrote:
On 2022-01-19, Joseph Wulf wrote:
> Gary,
>
> Thank you.
>
> That's interesting.
> In doing  ":verbose map <f1>", I get the following output:
> x  <F1>          <Nop>               Last set from ~/.vimrc
> s  <F1>          <Nop>               Last set from ~/.vimrc
> o  <F1>          <Nop>               Last set from ~/.vimrc
> n  <F1>          <Nop>               Last set from ~/.vimrc
>
> While in my .vimrc, I have:
> cmap <F1> <nop>
> imap <F1> <nop>
> lmap <F1> <nop>
> nmap <F1> <nop>
> omap <F1> <nop>
> smap <F1> <nop>
> vmap <F1> <nop>
> xmap <F1> <nop>
>
> At the moment, in command-mode, <F1> is properly NOT working, while in INSERT
> mode, <F1> still does bring up the help.
> I can see I'm getting closer, as I'm half-way there.

Joe,

Thanks for showing all that.  Interesting that your insert-mode
mapping doesn't work.  I was thinking that

    verbose map <f1>

would show all maps of <f1>, but it doesn't.  It doesn't show
insert-mode maps.  Obvious on reflection, but I don't always
reflect.  To see those, execute

    :verbose imap <f1>

HTH,
Gary

--
--
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/20220120003914.GA14109%40phoenix.

--
--
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/CAJ8cad-aZORqWSjdqiZMexQwUQ%2BsSyQ%2BzLazhpzO2GQVxE1XTw%40mail.gmail.com.

Wednesday, January 19, 2022

Re: Disable Help

On 2022-01-19, Joseph Wulf wrote:
> Gary,
>
> Thank you.
>
> That's interesting.
> In doing  ":verbose map <f1>", I get the following output:
> x  <F1>          <Nop>               Last set from ~/.vimrc
> s  <F1>          <Nop>               Last set from ~/.vimrc
> o  <F1>          <Nop>               Last set from ~/.vimrc
> n  <F1>          <Nop>               Last set from ~/.vimrc
>
> While in my .vimrc, I have:
> cmap <F1> <nop>
> imap <F1> <nop>
> lmap <F1> <nop>
> nmap <F1> <nop>
> omap <F1> <nop>
> smap <F1> <nop>
> vmap <F1> <nop>
> xmap <F1> <nop>
>
> At the moment, in command-mode, <F1> is properly NOT working, while in INSERT
> mode, <F1> still does bring up the help.
> I can see I'm getting closer, as I'm half-way there.

Joe,

Thanks for showing all that. Interesting that your insert-mode
mapping doesn't work. I was thinking that

verbose map <f1>

would show all maps of <f1>, but it doesn't. It doesn't show
insert-mode maps. Obvious on reflection, but I don't always
reflect. To see those, execute

:verbose imap <f1>

HTH,
Gary

--
--
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/20220120003914.GA14109%40phoenix.

Re: Disable Help

Gary,

Thank you.

That's interesting.
In doing  ":verbose map <f1>", I get the following output:
x  <F1>          <Nop>               Last set from ~/.vimrc
s  <F1>          <Nop>               Last set from ~/.vimrc
o  <F1>          <Nop>               Last set from ~/.vimrc
n  <F1>          <Nop>               Last set from ~/.vimrc

While in my .vimrc, I have:
cmap <F1> <nop>
imap <F1> <nop>
lmap <F1> <nop>
nmap <F1> <nop>
omap <F1> <nop>
smap <F1> <nop>
vmap <F1> <nop>
xmap <F1> <nop>

At the moment, in command-mode, <F1> is properly NOT working, while in INSERT mode, <F1> still does bring up the help.
I can see I'm getting closer, as I'm half-way there.


R,
-Joe Wulf;  RHCSA(RHEL7), FITSP-D, CISSP, VCP3, CPO(USN/RET)
Tony Robbins:  "Management is focusing on getting someone to get a result. Leadership is producing a standard in someone that when you're gone, they will live by to produce higher level results consistently".




On Wed, Jan 19, 2022 at 1:04 PM Gary Johnson <garyjohn@spocom.com> wrote:
On 2022-01-19, Tim Chase wrote:
> On 2022-01-19 07:23, Joseph Wulf wrote:
> > When using vim I wish to disable the <F1> from popping up the help.
> [snip]
> > :nmap <F1> <nop>
> [snip]
> > I place the SAME string without the quotes or leading colon in
> > .vimrc, close/open a new vim session, and <F1> immediately brings
> > up the help menu.
>
> You're on the right track, but it sounds like something is
> re-instituting the F1=help mapping after you set it.

    :verbose map <f1>

should show where the mapping was done.

Regards,
Gary

--
--
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/20220119180458.GA5754%40phoenix.

--
--
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/CAJ8cad9HvKaS%3D59P3enEMvEz2NHM02%2BYM_57uky2HwykH3PTGA%40mail.gmail.com.

Re: Disable Help

On 2022-01-19, Tim Chase wrote:
> On 2022-01-19 07:23, Joseph Wulf wrote:
> > When using vim I wish to disable the <F1> from popping up the help.
> [snip]
> > :nmap <F1> <nop>
> [snip]
> > I place the SAME string without the quotes or leading colon in
> > .vimrc, close/open a new vim session, and <F1> immediately brings
> > up the help menu.
>
> You're on the right track, but it sounds like something is
> re-instituting the F1=help mapping after you set it.

:verbose map <f1>

should show where the mapping was done.

Regards,
Gary

--
--
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/20220119180458.GA5754%40phoenix.

Re: Disable Help

On 2022-01-19 07:23, Joseph Wulf wrote:
> When using vim I wish to disable the <F1> from popping up the help.
[snip]
> :nmap <F1> <nop>
[snip]
> I place the SAME string without the quotes or leading colon in
> .vimrc, close/open a new vim session, and <F1> immediately brings
> up the help menu.

You're on the right track, but it sounds like something is
re-instituting the F1=help mapping after you set it. Are you putting
it at the top of your vimrc, the bottom of your vimrc, or somewhere
in the middle?

If it's not at the bottom, try moving it to the bottom so it trumps
other settings/plugins in your vimrc.

If it *is* already at the bottom, it might help to check if it only
happens with certain file-types (in which case some filetype plugin
might be playing the jerk and messing with it). You might have to
try selectively disabling plugins until you find the guilty party.

But I feel your pain -- I create mappings similar to yours,
doing

inoremap <f1> <esc>

in my vimrc because the ESC key is right next to the F1 key on my
laptop and I often accidentally hit F1 when I'm mashing for ESC.

-tim



--
--
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/20220119095048.12e5ebb4%40bigbox.attlocal.net.

Disable Help

When using vim I wish to disable the <F1> from popping up the help.  I use vim exclusively via shell terminal windows in Linux.  I've not yet been successful, though below is what I've attempted so far.  Further, I searched this google group for such a thing but didn't come up with any relevant results.

I have found this <seemingly> helpful link:   "https://vim.fandom.com/wiki/Disable_F1_built-in_help_key", yet none of the facets of its implementation have worked for me.  I have experimented with placing:  ":nmap <F1> <nop>" manually in a vim session---that manual effort seems to correctly provide the result I want (i.e. <F1> does no operation) during command-mode.  I place the SAME string without the quotes or leading colon in .vimrc, close/open a new vim session, and <F1> immediately brings up the help menu.  Other combinations attempted from the same link, ":nmap <F1> :echo<CR> " and ":imap <F1> <C-o>:echo<CR>" in the .vimrc, but once vim is reloaded,<F1> still brings up the help.

Next, grasping at straws---in my .vimrc I have placed:
     cmap <F1> <nop>
     imap <F1> <nop>
     ljjmap <F1> <nop>
     nmap <F1> <nop>
     omap <F1> <nop>
     vmap <F1> <nop>
Which hasn't solved the problem, either.

I would like to understand this problem I am having, better.  Additionally I wish to put in my .vimrc the right commands/functions to prevent <F1> from bringing up the HELP during 'command' and 'insert' modes.

Thank you.
R,
-Joe Wulf

--
--
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/8c49eaac-c8d8-4282-a6d4-06091584dabfn%40googlegroups.com.

Sunday, January 16, 2022

Re: vim9 script lambda

This is found

   def <lambda>7(l: list<any>)
        Last set from D:\Logiciels\Vim\vimfiles\plugged\nv-helper.vim\autoload\helper.vim line 263
1        # echomsg 'OutCb' .. string(l)
2        # eval [][0]


Here in Red 

    def OutCb(l: list<any>) #2{{{
      # echomsg 'OutCb' .. string(l)
      # eval [][0]
    enddef #2}}}
 
    def ExitCb(l: list<any>) #2{{{
      # echomsg 'ExitCb' .. string(l)
          # sleep 1m
          # source += l
          # echomsg 'Exiting ' .. string(l) .. ' ' .. string(@z)
    enddef #2}}}

Le dimanche 16 janvier 2022 à 16:53:16 UTC+1, Bram Moolenaar a écrit :

Ni Va wrote:

> Using this simple vim9script imported from $MYVIMRC, I encounter a lambda
> error that I don't happen to find the origin.
> [image: Capture.PNG]

The code you included does not have a lambda definition. You can
probably find out where they were coming from with:

:verbose func <lambda>7

> *Code*
> com! -nargs=1 -bang -complete=dir Zip call MainHelper.ZipUpDir(<bang>
> '<args>')

This "<bang>" appears to be misplaced.

Otherwise, the lines have been split in the mail system, thus it's a it
difficult to reproduce anything.


--
You know you use Vim too much when you have this alias in your
~/.bashrc file: alias :e=/bin/vim (Eljay Love-Jensen)

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.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/09554f69-31a2-4408-9fa4-b7ba385c56ecn%40googlegroups.com.

Re: vim9 script lambda

This is a link of simple test.

https://github.com/niva-xx/Zip

Le dimanche 16 janvier 2022 à 16:53:16 UTC+1, Bram Moolenaar a écrit :

Ni Va wrote:

> Using this simple vim9script imported from $MYVIMRC, I encounter a lambda
> error that I don't happen to find the origin.
> [image: Capture.PNG]

The code you included does not have a lambda definition. You can
probably find out where they were coming from with:

:verbose func <lambda>7

> *Code*
> com! -nargs=1 -bang -complete=dir Zip call MainHelper.ZipUpDir(<bang>
> '<args>')

This "<bang>" appears to be misplaced.

Otherwise, the lines have been split in the mail system, thus it's a it
difficult to reproduce anything.


--
You know you use Vim too much when you have this alias in your
~/.bashrc file: alias :e=/bin/vim (Eljay Love-Jensen)

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.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/8862a35e-45a5-473a-83d6-b14745678aacn%40googlegroups.com.

Re: vim9 script lambda

Ni Va wrote:

> Using this simple vim9script imported from $MYVIMRC, I encounter a lambda
> error that I don't happen to find the origin.
> [image: Capture.PNG]

The code you included does not have a lambda definition. You can
probably find out where they were coming from with:

:verbose func <lambda>7

> *Code*
> com! -nargs=1 -bang -complete=dir Zip call MainHelper.ZipUpDir(<bang>
> '<args>')

This "<bang>" appears to be misplaced.

Otherwise, the lines have been split in the mail system, thus it's a it
difficult to reproduce anything.


--
You know you use Vim too much when you have this alias in your
~/.bashrc file: alias :e=/bin/vim (Eljay Love-Jensen)

/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.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/20220116155304.C3AE11C0519%40moolenaar.net.

vim9 script lambda

Hi,

Using this simple vim9script imported from $MYVIMRC, I encounter a lambda error that I don't happen to find the origin.
Capture.PNG



Config Win10 Gvim 8.2.4103


Code
com! -nargs=1 -bang -complete=dir Zip call MainHelper.ZipUpDir(<bang> '<args>')

export def ZipUpDir(path: string) #{{{

  if !isdirectory(path)
        echomsg 'This is not a valid directory ' .. path
        return
  else
        echomsg 'This is a valid directory ' .. path
  endif


  var sevenZ: dict<string> = { 'exe':  expand('$vimruntime/7za.exe '), 'compression': ' -mx9 ', 'exclusion': '' }


  var forbidden_extensions: list<string> = ['*.pack', '*.gif', '*.obj', '*.png', '*.vader', '*.git', '*\\.git/']
  forbidden_extensions                  += [ '*.ncb', '*.ipch', '*.vgr', '*.bin', '*.raw', 'Browse.VC.db'] #Special E10-E12
  var extensions: list<string>           = ['*.obj', '*.git', '*\\.git/']
  sevenZ.exclusion                       = join(map(copy(forbidden_extensions), '"-xr!" .. v:val'))


  var zipSourcePath: string = fnamemodify(path, ':p:h')->substitute("\\", "/", "g")
  var zipName:       string = split(zipSourcePath, '/')[-1] .. '.7z'
  var zipNameOnly:   string = fnamemodify(zipName, ":t:r")


  # Create stamped directory or simple base directory
  var baseDir:    string = expand('$userprofile/desktop/') .. zipNameOnly  .. '/'
  var stampedDir: string = expand('$userprofile/desktop/') .. strftime('%Y%m%d_') .. zipNameOnly .. '/'
  call mkdir(stampedDir, "p", 0x777)


  # Zip command line
  @z = stampedDir .. zipName
  var zip_cmd: string = sevenZ.exe .. sevenZ.exclusion  .. ' a "' .. @z .. '" "' .. zipSourcePath .. '"' .. sevenZ.compression


  # Zip's job
  var jobid: job
  var source: list<number>

  def OutCb(l: list<any>) #2{{{
    # echomsg 'OutCb' .. string(l)
    # eval [][0]
  enddef #2}}}

  def ExitCb(l: list<any>) #2{{{
    # echomsg 'ExitCb' .. string(l)
        # sleep 1m
        # source += l
        # echomsg 'Exiting ' .. string(l) .. ' ' .. string(@z)
  enddef #2}}}

  jobid = job_start(zip_cmd, { out_cb: OutCb, exit_cb:  ExitCb, mode: 'raw', timeout: 1200000 } )
  echomsg 'Jobid: ' .. string(jobid)

enddef #}}}

--
--
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/6f7415c8-6f56-4bc9-b751-1987faecee44n%40googlegroups.com.

Saturday, January 15, 2022

Re: Pasting some yank line is slow

Hum, maybe using coc.vim with LSP clangd, it seems to be slow not on cpp but on cs file.

Le samedi 15 janvier 2022 à 10:53:16 UTC+1, Ni Va a écrit :
Thank you and best wishes Mr Chase.



1) seeing mapping, it's an ocean because of vimplug and plugins installed.  
     Behind this ocean world of mapping, it would be great to filter them with suspected letter.

   I had two own mapping that began by p but without them no diff, not at the origin of pb.

nnoremap           pc    :silent! vim9cmd @* = expand('%:p')<CR>:echo 'In Clipboard : ' . @* <CR>
nnoremap           ph    :silent! vim9cmd @* = expand('%:p:h')<CR>:echo 'In Clipboard : ' . @* <CR>


2)syn off, I do same observation than you about long line in xml, no effect in my case.

3) Bisecting plugins installed, deleting them and pasting them one by one in my vim-plug dir, no diff.


it appears that my paste key take normal time again without any change in my own config 
out of building vim from 8.2.4090 to 4092 but don't see the reason.

Thank you for helping
NiVa

Le vendredi 14 janvier 2022 à 16:36:25 UTC+1, Tim Chase a écrit :
On 2022-01-14 01:04, Ni Va wrote:
> I encounter a recent problem pasting some yank things (lines or
> sentences' part).
>
> don't see why because my updatetime is et to 300 and redrawtime is
> set to 500.

A couple candidates occur to me:

1) if the paste itself is slow to activate, do you have some mapping
interfering? I'd start by checking the output of

:map
:imap
:vmap

to see if there's anything that might be causing problems. You can
also try tweaking 'timeoutlen' to see if increasing the value makes
it worse and shortening the timeout makes it better. Or if hitting
<space> (or some other character) while waiting causes it to paste
quickly. If this is the case, you likely have some mapping that vim
is waiting to see if you'll complete it before the timeout. Usually
the best solution here is to change the mapping(s) to remove the
overlap.


2) in some cases, syntax highlighting can cause some serious
slow-down. I've noticed it most with XML containing long lines. Try
turning off syntax highlighting

:syn off

doing the paste, and see if it's faster. If so, it would help to
know the filetype in question.

3) plugins may also interfere. Have you tried doing the paste
without any plugins enabled? Sometimes a plugin will interfere or do
strange/pathological things. If you can bisect your .vimrc and
track it down to a misbehaving plugin, you can go nudge its author
for help.

Hopefully this gives you some mechanisms to track diagnose the issue,

-tim



--
--
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/1cffaf73-1c70-4d45-b540-939e2eef73b1n%40googlegroups.com.