Monday, October 31, 2022

Re: pb with nnoremap an imported vim9 defnot loaded

Hi Salman,

I copy paste this from $MYVIMRC
nnoremap n n<ScriptCmd> thatHelp.HLNext(80)<CR>
nnoremap N N<ScriptCmd> thatHelp.HLNext(80)<CR>

it's in reference to another post https://groups.google.com/g/vim_use/c/_U2ne7QlOWc/m/7pUuGJ2BAwAJ.

I cannot or don"'t know how to test it through command line because it calls an imported vim9 def func.


Le lundi 31 octobre 2022 à 15:16:52 UTC+1, Salman Halim a écrit :
Did you type the mappings in the email message or did you copy/paste them from your VIMRC? Are you able to get the mappings to work if you copy/paste them onto the command-line after Vim has started? The primary problem I can see with the mappings is that you have them defined as n<ScriptCmd> instead of just n:

...n<ScriptCmd> th... defines a mapping for n<ScriptCmd>
...n <ScriptCmd>th... defines a mapping for n that then executes a script command and is probably what you want

As an aside, the function you defined is technically correct, though inefficient in a few things, but that's not likely to be the cause of your woes.

On Mon, Oct 31, 2022 at 1:43 AM Nicolas <niva...@gmail.com> wrote:
Hi,


Using this def func to blink searched word I mapped it in $MYVIMRC as this but it seems that at vim startup, the nnoremap is not defined, no call occurs.

Thankyou for help
Nicolas

$MYVIMRC
import autoload './vimfiles/plugged/foobar.vim'
as thatHelp

nnoremap n   n<ScriptCmd> thatHelp.HLNext(80)<CR>
nnoremap N   N<ScriptCmd> thatHelp.HLNext(80)<CR>



foobar.vim
export def HLNext(blinktime: number): number
    # https://www.youtube.com/watch?v=aHm36-na4-4#t6m36s

  echomsg 'export def HLNext has been called.'

  highlight BlackOnBlack guibg=black guifg=#3c4c55 ctermbg=black ctermfg=black

  var [bufnum: number, lnum: number, col: number, off: number] = getpos('.')
  var target_pat: string = '\k*\%#\k*'
  target_pat = '\%#' .. @/
  target_pat = '\k*\%#\k*'
  var blinks: number = 3

  var sleep_duration: number = ( blinktime / (2 * blinks) )->float2nr()
  var sleep_cmd: string = 'sleep ' .. sleep_duration .. 'm'


  for n in range(1, blinks)

    # echomsg n
    var hide: number = matchadd('BlackOnBlack', target_pat, 101)
    redraw
    exec sleep_cmd
    matchdelete(hide)
    redraw
    exec sleep_cmd

  endfor

  return 0

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


--
 
Salman

I, too, shall something make and glory in the making.

--
--
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/d837331e-b4c2-42cc-836c-16b4c867cbf2n%40googlegroups.com.

Re: pb with nnoremap an imported vim9 defnot loaded

Did you type the mappings in the email message or did you copy/paste them from your VIMRC? Are you able to get the mappings to work if you copy/paste them onto the command-line after Vim has started? The primary problem I can see with the mappings is that you have them defined as n<ScriptCmd> instead of just n:

...n<ScriptCmd> th... defines a mapping for n<ScriptCmd>
...n <ScriptCmd>th... defines a mapping for n that then executes a script command and is probably what you want

As an aside, the function you defined is technically correct, though inefficient in a few things, but that's not likely to be the cause of your woes.

On Mon, Oct 31, 2022 at 1:43 AM Nicolas <nivaemail@gmail.com> wrote:
Hi,


Using this def func to blink searched word I mapped it in $MYVIMRC as this but it seems that at vim startup, the nnoremap is not defined, no call occurs.

Thankyou for help
Nicolas

$MYVIMRC
import autoload './vimfiles/plugged/foobar.vim'
as thatHelp

nnoremap n   n<ScriptCmd> thatHelp.HLNext(80)<CR>
nnoremap N   N<ScriptCmd> thatHelp.HLNext(80)<CR>



foobar.vim
export def HLNext(blinktime: number): number
    # https://www.youtube.com/watch?v=aHm36-na4-4#t6m36s

  echomsg 'export def HLNext has been called.'

  highlight BlackOnBlack guibg=black guifg=#3c4c55 ctermbg=black ctermfg=black

  var [bufnum: number, lnum: number, col: number, off: number] = getpos('.')
  var target_pat: string = '\k*\%#\k*'
  target_pat = '\%#' .. @/
  target_pat = '\k*\%#\k*'
  var blinks: number = 3

  var sleep_duration: number = ( blinktime / (2 * blinks) )->float2nr()
  var sleep_cmd: string = 'sleep ' .. sleep_duration .. 'm'


  for n in range(1, blinks)

    # echomsg n
    var hide: number = matchadd('BlackOnBlack', target_pat, 101)
    redraw
    exec sleep_cmd
    matchdelete(hide)
    redraw
    exec sleep_cmd

  endfor

  return 0

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/f6861e1f-9783-49b6-b151-b6f1625e6ce5n%40googlegroups.com.


--
 
Salman

I, too, shall something make and glory in the making.

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

Sunday, October 30, 2022

pb with nnoremap an imported vim9 defnot loaded

Hi,


Using this def func to blink searched word I mapped it in $MYVIMRC as this but it seems that at vim startup, the nnoremap is not defined, no call occurs.

Thankyou for help
Nicolas

$MYVIMRC
import autoload './vimfiles/plugged/foobar.vim'
as thatHelp

nnoremap n   n<ScriptCmd> thatHelp.HLNext(80)<CR>
nnoremap N   N<ScriptCmd> thatHelp.HLNext(80)<CR>



foobar.vim
export def HLNext(blinktime: number): number
    # https://www.youtube.com/watch?v=aHm36-na4-4#t6m36s

  echomsg 'export def HLNext has been called.'

  highlight BlackOnBlack guibg=black guifg=#3c4c55 ctermbg=black ctermfg=black

  var [bufnum: number, lnum: number, col: number, off: number] = getpos('.')
  var target_pat: string = '\k*\%#\k*'
  target_pat = '\%#' .. @/
  target_pat = '\k*\%#\k*'
  var blinks: number = 3

  var sleep_duration: number = ( blinktime / (2 * blinks) )->float2nr()
  var sleep_cmd: string = 'sleep ' .. sleep_duration .. 'm'


  for n in range(1, blinks)

    # echomsg n
    var hide: number = matchadd('BlackOnBlack', target_pat, 101)
    redraw
    exec sleep_cmd
    matchdelete(hide)
    redraw
    exec sleep_cmd

  endfor

  return 0

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/f6861e1f-9783-49b6-b151-b6f1625e6ce5n%40googlegroups.com.

Re: How to incude '/' in search(find) string on the fly

Glad you found a solution. I've just become really accustomed to escaping the slash so don't even think about it any more. 

Salman

On Sun, Oct 30, 2022, 07:39 'Carl Ponder US' via vim_use <vim_use@googlegroups.com> wrote:
It looks like this is giving me what I want:
```

:nnoremap / :call SlashEscape()<CR>/
:function SlashEscape()
:    cnoremap <CR> <C-\>eescape(getcmdline(), '/')<CR><CR>:cunmap <lt>CR><CR>
:endfunction

:nnoremap ? :call QuestionEscape()<CR>?
:function QuestionEscape()
:    cnoremap <CR> <C-\>eescape(getcmdline(), '?')<CR><CR>:cunmap <lt>CR><CR>
:endfunction
```
posted here:

--
--
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/38b347c1-6fc2-45c2-b873-3b6eb8a0b9e3n%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/CANuxnEf2USDtmQ5e_Kt0k0E8NQDnuAT%2B7%3DM-KX_BnL7O%2Bfc%3D%2BA%40mail.gmail.com.

vim9 script folding brackets near deffunc break syntax

Hi,

Aiming to fold all my declared def functions, I find usefull to add brackets' folding near def func definition.

It appears that it breaks syntax highlight of the enddef declaration and its block content too.

Is there a workaround keeping ability to fold the def func manually ?
Thank you 

NicolasCapture d'écran 2022-10-31 050949.pngCapture d'écran 2022-10-31 051025.png


--
--
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/4bb70c2d-79f1-4fc2-81cb-8c19d1b34e8en%40googlegroups.com.

Re: vim airline too consumption starting time

Removing airline in th e benefit of powerline, no comment.
Nicolas

Capture d'écran 2022-10-31 034413.png

Le lundi 31 octobre 2022 à 03:36:37 UTC+1, Nicolas a écrit :
Exact lines in $MYVIMRC

profile start $tmp/vimprofiler.log
profile file *                    
profile func *                    

Le dimanche 30 octobre 2022 à 20:56:33 UTC+1, Nicolas a écrit :
Hi Marek, 

Just as documented by vim's help in it's simple way:

vim --startuptime vim.log
profile func *
profile other thing *

I just noticed that airline consumption is 9 out of 13-15 seconds and find that amazing. 


Thank you for your help
Nicolas

Le dimanche 30 octobre 2022 à 20:34:50 UTC+1, mstep....@googlemail.com a écrit :
Bonsoir Nicolas,

how do you start vimprofiler, please. I have a starting time over 20 seconds of VimR, after restarting my macOS. Second time it is starting normally. 

Best greetings


marek


On 30. Oct 2022, at 07:28, Nicolas <niva...@gmail.com> wrote:

Hi Christian,

Regarding this screenshot, is there a way to reduce Vim startup time consumed a lot by vim -airline, is there a port in vim9 of your plugin  ?

Thank you


<Capture d'écran 2022-10-30 072801.png>

Nicolas

--
--
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/9421ca3e-ed43-4168-be0a-d3f05e799406n%40googlegroups.com.
<Capture d'écran 2022-10-30 072801.png>

--
--
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/c2a449d4-fe4f-44d5-aa6e-84f2c37ae0c3n%40googlegroups.com.

Re: vim airline too consumption starting time

Exact lines in $MYVIMRC

profile start $tmp/vimprofiler.log
profile file *                    
profile func *                    

Le dimanche 30 octobre 2022 à 20:56:33 UTC+1, Nicolas a écrit :
Hi Marek, 

Just as documented by vim's help in it's simple way:

vim --startuptime vim.log
profile func *
profile other thing *

I just noticed that airline consumption is 9 out of 13-15 seconds and find that amazing. 


Thank you for your help
Nicolas

Le dimanche 30 octobre 2022 à 20:34:50 UTC+1, mstep....@googlemail.com a écrit :
Bonsoir Nicolas,

how do you start vimprofiler, please. I have a starting time over 20 seconds of VimR, after restarting my macOS. Second time it is starting normally. 

Best greetings


marek


On 30. Oct 2022, at 07:28, Nicolas <niva...@gmail.com> wrote:

Hi Christian,

Regarding this screenshot, is there a way to reduce Vim startup time consumed a lot by vim -airline, is there a port in vim9 of your plugin  ?

Thank you


<Capture d'écran 2022-10-30 072801.png>

Nicolas

--
--
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/9421ca3e-ed43-4168-be0a-d3f05e799406n%40googlegroups.com.
<Capture d'écran 2022-10-30 072801.png>

--
--
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/94771b38-2f57-4375-9633-1b01f0e02749n%40googlegroups.com.

Re: vim airline too consumption starting time

Hi Marek, 

Just as documented by vim's help in it's simple way:

vim --startuptime vim.log
profile func *
profile other thing *

I just noticed that airline consumption is 9 out of 13-15 seconds and find that amazing. 

It is near to that thread https://github.com/vim-airline/vim-airline/issues/1779

Thank you for your help
Nicolas

Le dimanche 30 octobre 2022 à 20:34:50 UTC+1, mstep....@googlemail.com a écrit :
Bonsoir Nicolas,

how do you start vimprofiler, please. I have a starting time over 20 seconds of VimR, after restarting my macOS. Second time it is starting normally. 

Best greetings


marek


On 30. Oct 2022, at 07:28, Nicolas <niva...@gmail.com> wrote:

Hi Christian,

Regarding this screenshot, is there a way to reduce Vim startup time consumed a lot by vim -airline, is there a port in vim9 of your plugin  ?

Thank you


<Capture d'écran 2022-10-30 072801.png>

Nicolas

--
--
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/9421ca3e-ed43-4168-be0a-d3f05e799406n%40googlegroups.com.
<Capture d'écran 2022-10-30 072801.png>

--
--
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/140c03b3-f5d4-4dc9-b2e4-32bc8b6a1cdbn%40googlegroups.com.

Re: vim airline too consumption starting time

Bonsoir Nicolas,

how do you start vimprofiler, please. I have a starting time over 20 seconds of VimR, after restarting my macOS. Second time it is starting normally. 

Best greetings


marek


On 30. Oct 2022, at 07:28, Nicolas <nivaemail@gmail.com> wrote:

Hi Christian,

Regarding this screenshot, is there a way to reduce Vim startup time consumed a lot by vim -airline, is there a port in vim9 of your plugin  ?

Thank you


<Capture d'écran 2022-10-30 072801.png>

Nicolas

--
--
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/9421ca3e-ed43-4168-be0a-d3f05e799406n%40googlegroups.com.
<Capture d'écran 2022-10-30 072801.png>

Re: Embedding Lua in vim9script breaks syntax highlight

Thank you a lot for advise Owajigbanam :) 
Nicolas. 

Le dim. 30 oct. 2022 à 19:23, Owajigbanam Ogbuluijah <xigbanam@gmail.com> a écrit :
Hi Nicolas,

I'd recommend having Lua code in a Lua file, then using the Lua region in Vim9script to import the Lua file — if you must.

A better recommendation would just be to write Vim9script though. I find it easier to write.

Best,
Igbanam

On Sun, Oct 30, 2022 at 5:38 AM Nicolas <nivaemail@gmail.com> wrote:
Hi,

it Seems that the lua print code line above, when embedded in lua region code breaks vim9 syntax highlight.

How to fix it ?
Thank you
Nicolas


--
--
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/fb697870-e489-4d98-ad05-1a28e5b793a0n%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/_lQU2GB4g9w/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/CAOmRJrfYr6pZT7DsAmYtMkz7hi9mrp_V2UjwdXVSrsrvyC2xxg%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/CAOKxv4H_d%2B0OTENpAMnxKS4Hb6vJWctoRa2F4Z3ETpBDG%2BB0Zw%40mail.gmail.com.

Re: Embedding Lua in vim9script breaks syntax highlight

Hi Nicolas,

I'd recommend having Lua code in a Lua file, then using the Lua region in Vim9script to import the Lua file — if you must.

A better recommendation would just be to write Vim9script though. I find it easier to write.

Best,
Igbanam

On Sun, Oct 30, 2022 at 5:38 AM Nicolas <nivaemail@gmail.com> wrote:
Hi,

it Seems that the lua print code line above, when embedded in lua region code breaks vim9 syntax highlight.

How to fix it ?
Thank you
Nicolas


--
--
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/fb697870-e489-4d98-ad05-1a28e5b793a0n%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/CAOmRJrfYr6pZT7DsAmYtMkz7hi9mrp_V2UjwdXVSrsrvyC2xxg%40mail.gmail.com.

Re: How to incude '/' in search(find) string on the fly

It looks like this is giving me what I want:
```

:nnoremap / :call SlashEscape()<CR>/
:function SlashEscape()
:    cnoremap <CR> <C-\>eescape(getcmdline(), '/')<CR><CR>:cunmap <lt>CR><CR>
:endfunction

:nnoremap ? :call QuestionEscape()<CR>?
:function QuestionEscape()
:    cnoremap <CR> <C-\>eescape(getcmdline(), '?')<CR><CR>:cunmap <lt>CR><CR>
:endfunction
```
posted here:
https://github.com/vim/vim/issues/11460

--
--
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/38b347c1-6fc2-45c2-b873-3b6eb8a0b9e3n%40googlegroups.com.

Re: How to incude '/' in search(find) string on the fly

I'm not using a mouse in the sense of being able to move the cursor by clicking within the text.
I'm only keyboarding the Vim operations, except to select/copy/paste text between the Vim session and windows with other activities.
This works file to insert text into the file being edited, but if I'm not in insert-mode, I still can't paste a sequence like
```
:s/foo/zap/g
```
into the session and have it work the way it would if I typed it in . Why is that?

--
--
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/661c1dc2-faef-416f-a273-1d749fcac662n%40googlegroups.com.

Saturday, October 29, 2022

Re: How to incude '/' in search(find) string on the fly

Carl,

The errors you are getting from the commands aren't about what you have on the RHS of the command, but rather because / and ? aren't valid command names. E182: Invalid command name. It's worth examining the error message as not all errors are the same.

You could call it something else, such as S or SS or something like that; the following works for me:

com! -nargs=1 SS let @/=<q-args>

Your mapping approach is fine, but might potentially require a other mappings around it; I can create a mapping to paste using the keyboard that works, but have no idea if it will work for the mouse as I don't use the mouse with Vim:

cnoremap <expr> <c-r>* getcmdtype() == '/' ? escape(@*, '/') : @*

Change the * above to the register that holds your clipboard contents. Note that if your copied text contains a newline, using the mapping above will end the search; if that ends up being an issue you see you'll have to write a custom function for that expr that both escapes the slashes in the clipboard contents and replaces newlines with '\n' so it doesn't actually press enter.

Hope this helps,

Salman

On Sat, Oct 29, 2022 at 10:51 PM 'Carl Ponder US' via vim_use <vim_use@googlegroups.com> wrote:
Also, it looks like this approach here
```
cnoremap <expr>  /  getcmdtype() == '/' ? '\/' : '/'
cnoremap <expr>  ?  getcmdtype() == '?' ? '\?' : '?'
```
does the escaping when I type-in the pattern but not when I copy/paste it using the mouse.

--
--
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/b23bc7b1-e562-418f-af09-12b9baad3877n%40googlegroups.com.


--
 
Salman

I, too, shall something make and glory in the making.

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

vim airline too consumption starting time

Hi Christian,

Regarding this screenshot, is there a way to reduce Vim startup time consumed a lot by vim -airline, is there a port in vim9 of your plugin  ?

Thank you


Capture d'écran 2022-10-30 072801.png

Nicolas

--
--
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/9421ca3e-ed43-4168-be0a-d3f05e799406n%40googlegroups.com.

Embedding Lua in vim9script breaks syntax highlight

Hi,

it Seems that the lua print code line above, when embedded in lua region code breaks vim9 syntax highlight.

How to fix it ?
Thank you
Nicolas

Capture d'écran 2022-10-30 063445.png
Capture d'écran 2022-10-30 063530.png

--
--
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/fb697870-e489-4d98-ad05-1a28e5b793a0n%40googlegroups.com.

Re: How to incude '/' in search(find) string on the fly

Also, it looks like this approach here
```
cnoremap <expr>  /  getcmdtype() == '/' ? '\/' : '/'
cnoremap <expr>  ?  getcmdtype() == '?' ? '\?' : '?'
```
does the escaping when I type-in the pattern but not when I copy/paste it using the mouse.

--
--
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/b23bc7b1-e562-418f-af09-12b9baad3877n%40googlegroups.com.

Re: How to incude '/' in search(find) string on the fly

Solutions were posted on this page
https://vim.fandom.com/wiki/Searching_for_expressions_which_include_slashes
that, if I read correctly, define a new search-operator that allows the embedded '/' characters.
The operator being "S" or "s" or "Ss" or something. Maybe '#' could be re-mapped the same way.

But in my case, I still want to use "/" and "?" as before. I tried using analogous forms to re-map these characters
```
command! -nargs=1 / let @/ = escape(<q-args>, '/')|normal! /<C-R>/<CR>
command! -nargs=1 ? let @? = escape(<q-args>, '?')|normal! /<C-R>/<CR>
command! -nargs=1 / let @/ = <q-args>|set hlsearch
command! -nargs=1 '/' let @/ = <q-args>
```
but they all gave vim-errors.

--
--
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/f1d88ec6-7419-4251-8bb7-acfdeef93125n%40googlegroups.com.

Re: How to autosave files when terminal is closed

> On Sat, 29 Oct 2022 00:03:17 +0100, Bram Moolenaar wrote:
> >
> > > On Fri, 28 Oct 2022 22:23:31 +0100, Bram Moolenaar wrote:
> > > >
> > > > > "au VimLeavePre * w" only works when I exit vim with something
> > > > > like ":q!" but not if I close my terminal window.
> > > > >
> > > > > Error detected while processing VimLeavePre Autocommands for
> > > > > "*": E749: Empty buffer
> > > > >
> > > > > VimLeave[Pre] is being called, but the buffer is not saved,
> > > > > probably because it's closed before that event is triggered. Is
> > > > > there another event that gets triggered during the closing
> > > > > sequence that will allow me to autosave, or another way to do
> > > > > this?
> > > >
> > > > Do you already have the 'autowriteall' option set?
> > >
> > > I think that only affects closing via :quit and the like. Closing my
> > > xterm apparently doesn't follow that same exit pathway.
> >
> > It is supposed to, but perhaps the catching of signals is not properly
> > setup. Not sure how to try it out other than closing the xterm
> > normally. If you "kill -9" the xterm it might not work. Closing the
> > window manager should also work OK. At least this mechanism is used
> > to avoid leaving swap files laying around, and that works quite well,
> > thus 'autowriteall' should also work. But I don't think there is a
> > test for it.
>
> Yea, I guess signal catching isn't properly setup. It seems that my wm
> is sending vim a SIGHUP when it closes the xterm window:
>
> Vim: Caught deadly signal HUP
> Vim: preserving files...
> Vim: Finished.
>
> Manually killing vim with "kill (-1|-3|-15)" does not trigger that nice
> autowriteall (awa) feature, even though vim's output says "preserving
> files..."

I suppose TERM and HUP are handled differently. But that is logical,
I'm not sure we should handle them the same way. 'autowriteall' is
boolean, not sure what would be a good way to make another choice of how
to handle TERM. Well, maybe we can just change it, for most users they
will do the same thing anyway, just come from different causes (that you
don't have control over).

--
FIRST VILLAGER: We have found a witch. May we burn her?
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

/// 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/20221029120439.0053B1C0739%40moolenaar.net.

Friday, October 28, 2022

Re: How to autosave files when terminal is closed

On Sat, 29 Oct 2022 00:03:17 +0100, Bram Moolenaar wrote:
>
> > On Fri, 28 Oct 2022 22:23:31 +0100, Bram Moolenaar wrote:
> > >
> > > > "au VimLeavePre * w" only works when I exit vim with something
> > > > like ":q!" but not if I close my terminal window.
> > > >
> > > > Error detected while processing VimLeavePre Autocommands for
> > > > "*": E749: Empty buffer
> > > >
> > > > VimLeave[Pre] is being called, but the buffer is not saved,
> > > > probably because it's closed before that event is triggered. Is
> > > > there another event that gets triggered during the closing
> > > > sequence that will allow me to autosave, or another way to do
> > > > this?
> > >
> > > Do you already have the 'autowriteall' option set?
> >
> > I think that only affects closing via :quit and the like. Closing my
> > xterm apparently doesn't follow that same exit pathway.
>
> It is supposed to, but perhaps the catching of signals is not properly
> setup. Not sure how to try it out other than closing the xterm
> normally. If you "kill -9" the xterm it might not work. Closing the
> window manager should also work OK. At least this mechanism is used
> to avoid leaving swap files laying around, and that works quite well,
> thus 'autowriteall' should also work. But I don't think there is a
> test for it.

Yea, I guess signal catching isn't properly setup. It seems that my wm
is sending vim a SIGHUP when it closes the xterm window:

Vim: Caught deadly signal HUP
Vim: preserving files...
Vim: Finished.

Manually killing vim with "kill (-1|-3|-15)" does not trigger that nice
autowriteall (awa) feature, even though vim's output says "preserving
files..."

--
--
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/20221028232302.357aed6770c1adce3cbd556c%40dennisn.mooo.com.

Re: How to autosave files when terminal is closed

> On Fri, 28 Oct 2022 22:23:31 +0100, Bram Moolenaar wrote:
> >
> > > "au VimLeavePre * w" only works when I exit vim with something like
> > > ":q!" but not if I close my terminal window.
> > >
> > > Error detected while processing VimLeavePre Autocommands for "*":
> > > E749: Empty buffer
> > >
> > > VimLeave[Pre] is being called, but the buffer is not saved, probably
> > > because it's closed before that event is triggered. Is there another
> > > event that gets triggered during the closing sequence that will
> > > allow me to autosave, or another way to do this?
> >
> > Do you already have the 'autowriteall' option set?
>
> I think that only affects closing via :quit and the like. Closing my
> xterm apparently doesn't follow that same exit pathway.

It is supposed to, but perhaps the catching of signals is not properly
setup. Not sure how to try it out other than closing the xterm
normally. If you "kill -9" the xterm it might not work. Closing the
window manager should also work OK. At least this mechanism is used to
avoid leaving swap files laying around, and that works quite well, thus
'autowriteall' should also work. But I don't think there is a test for
it.

--
A village. Sound of chanting of Latin canon, punctuated by short, sharp
cracks. It comes nearer. We see it is a line of MONKS ala SEVENTH SEAL
flagellation scene, chanting and banging themselves on the foreheads with
wooden boards.
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

/// 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/20221028230317.12B871C0739%40moolenaar.net.

Re: Share variables between Two vim9 def functions

OK export Var and import from files that i know reduce variable consumption scope. 
Entiendo. 
Thank you a lot Bram, Courage. 
Nicolas

Le vendredi 28 octobre 2022 à 23:44:16 UTC+2, Bram Moolenaar a écrit :

> Vim9script introduces the fact of having to use a global to pass values
> ​​between a P function, producing its values, used for example in an
> autocommand and a second C function consuming its data / values ​​which
> would be called on a key mapping for example. The fact is that going
> through globals is not very elegant and forced to create a new global named
> different in each new case explained above. So I was looking for another
> way.

With Vim9 script the recommended way is to put the variable in one
script where it is exported, and then import it whereever you want to
use it. That way you have control over where the value is changed, make
it a constant, etc. See help for "vim9-scopes" and ":import".

--
Westheimer's Discovery:
A couple of months in the laboratory can
frequently save a couple of hours in the library.

/// 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/5c0b6195-55eb-421d-a283-7c8c52381c02n%40googlegroups.com.

Re: Share variables between Two vim9 def functions

> Vim9script introduces the fact of having to use a global to pass values
> ​​between a P function, producing its values, used for example in an
> autocommand and a second C function consuming its data / values ​​which
> would be called on a key mapping for example. The fact is that going
> through globals is not very elegant and forced to create a new global named
> different in each new case explained above. So I was looking for another
> way.

With Vim9 script the recommended way is to put the variable in one
script where it is exported, and then import it whereever you want to
use it. That way you have control over where the value is changed, make
it a constant, etc. See help for "vim9-scopes" and ":import".

--
Westheimer's Discovery:
A couple of months in the laboratory can
frequently save a couple of hours in the library.

/// 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/20221028214359.A00A91C0739%40moolenaar.net.

Re: How to autosave files when terminal is closed

On Fri, 28 Oct 2022 22:23:31 +0100, Bram Moolenaar wrote:
>
> > "au VimLeavePre * w" only works when I exit vim with something like
> > ":q!" but not if I close my terminal window.
> >
> > Error detected while processing VimLeavePre Autocommands for "*":
> > E749: Empty buffer
> >
> > VimLeave[Pre] is being called, but the buffer is not saved, probably
> > because it's closed before that event is triggered. Is there another
> > event that gets triggered during the closing sequence that will
> > allow me to autosave, or another way to do this?
>
> Do you already have the 'autowriteall' option set?

I think that only affects closing via :quit and the like. Closing my
xterm apparently doesn't follow that same exit pathway.

--
--
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/20221028174128.8f56ede56155963b2724a7f4%40dennisn.mooo.com.

Re: How to autosave files when terminal is closed

> "au VimLeavePre * w" only works when I exit vim with something like
> ":q!" but not if I close my terminal window.
>
> Error detected while processing VimLeavePre Autocommands for "*":
> E749: Empty buffer
>
> VimLeave[Pre] is being called, but the buffer is not saved, probably
> because it's closed before that event is triggered. Is there another
> event that gets triggered during the closing sequence that will allow
> me to autosave, or another way to do this?

Do you already have the 'autowriteall' option set?

--
Mrs Abbott: I'm a paediatrician.
Basil: Feet?
Mrs Abbott: Children.
Sybil: Oh, Basil!
Basil: Well, children have feet, don't they? That's how they move
around, my dear. You must take a look next time, it's most
interesting. (Fawlty Towers)

/// 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/20221028212331.6965E1C11B0%40moolenaar.net.

Re: E117: Unknown function: plug#begin

It's not finding where you put it. I do the following:

" installed at
~/.vim/autoload/plug.vim

" All my plugins are installed into this path
call plug#begin('~/.vim/plugged')

HTH

Bob

On Wednesday, October 26, 2022 at 3:48:50 PM UTC-4 Rellot wrote:
this error occured when conifiguring vim plugin
full error message:
```
Error detected while processing .vimrc:
line 5:
E117: Unknown function: plug#begin
line 7:
E492: Not an editor command: Plugin 'neoclide/coc.nvim'
line 9:
E117: Unknown function: plug

Thursday, October 27, 2022

Re: FTP servers can't be reached

> Hello, the main FTP servers listed at https://www.vim.org/mirrors.php
> appear to be unreachable at the moment.
>
> Some of the mirrors seem OK but I didn't check them all.

The man ftp site is hosted by nluug.nl, do they show a status update?
Sometimes a disk breaks and it takes a little while to fix.

--
ARTHUR: Old woman!
DENNIS: Man!
ARTHUR: Man. I'm sorry. Old man, What knight live in that castle over there?
DENNIS: I'm thirty-seven.
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

/// 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/20221027220540.EE5BF1C0363%40moolenaar.net.

Wednesday, October 26, 2022

Re: E117: Unknown function: plug#begin

Hi Rellot,

From the syntax, you may be trying to use junegunn/vim-plug. Ensure vim-plug is properly installed. These errors mean Vim can't find the functions which would have normally been registered by the plugin.

3 things
  1. Ensure the plugin is properly installed
  2. Use Plug, not Plugin
  3. Ensure you provide the plugin directory in plug#begin(<directory>)

Cheers,
Igbanam.

On Wed, Oct 26, 2022 at 7:48 PM Rellot <jkanimations71@gmail.com> wrote:

Hello, I was setting up vim plug when this error occured:

Error detected while processing .vimrc:
line 5:
E117: Unknown function: plug#begin
line 7:
E492: Not an editor command: Plug 'neoclide/coc.nvim'
line 9:
E117: Unknown function: plug

Re: E117: Unknown function: plug#begin

This sounds like an issue that is better suited for the vim-plug issue
tracker. I would guess that their first suggestion would be to check
that you downloaded the vim-plug plugin to the correct directory. I
suggest you include this in your description when you ask this at the
vim-plug repository.

Good luck - DLD

--
--
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/Y1mx%2B41QBiMIX5AK%40icerm-dld.

Re: E117: Unknown function: plug#begin

On Wed, Oct 26, 2022 at 9:48 PM Rellot <jkanimations71@gmail.com> wrote:
>
>
> Hello, I was setting up vim plug when this error occured:
>
> Error detected while processing .vimrc:
> line 5:
> E117: Unknown function: plug#begin
> line 7:
> E492: Not an editor command: Plug 'neoclide/coc.nvim'
> line 9:
> E117: Unknown function: plug

E117: Unknown function: plug#begin

this error occured when conifiguring vim plugin
full error message:
```
Error detected while processing .vimrc:
line 5:
E117: Unknown function: plug#begin
line 7:
E492: Not an editor command: Plugin 'neoclide/coc.nvim'
line 9:
E117: Unknown function: plug

E117: Unknown function: plug#begin


https://pastebin.com/VSAQn61h

--
--
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/cb7e2da1-45d8-400b-8687-98036b2a8506n%40googlegroups.com.

E117: Unknown function: plug#begin


Hello, I was setting up vim plug when this error occured:

Error detected while processing .vimrc:
line 5:
E117: Unknown function: plug#begin
line 7:
E492: Not an editor command: Plug 'neoclide/coc.nvim'
line 9:
E117: Unknown function: plug

Tuesday, October 25, 2022

Help / Bram

Hi,

I am looking for someone who knows Bram and/or lives somewhat close to him.

If you do, can you please contact me.

It seems to be kind of urgent.

You probably don't know me - I'm the person running the registration &
DNS for vim.org

Thanks,
Sec
--
Just to confirm, I se my modem's pccard.conf driver setting to sio1
(from sio2) and I got the required panic. Cool!

--
--
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/20221025090455.GE47630%40ice.42.org.

Monday, October 24, 2022

Re: How to autosave files when terminal is closed

SigUSR1 didn't work. I wonder why SigTERM isn't in autocmd-events.

That plugin is a bit overkill (vim already stores unsaved changes in
swap files), and hooks into events like CursorHold (cursor inactivity)
and CompleteDone.

Why isn't this possible in VimLeavePre (if not VimLeave)? :|

On Mon, 24 Oct 2022 09:16:55 +0000, Owajigbanam Ogbuluijah wrote:
> Hi Dennis,
>
> Are you asking for an event which fires when you close the terminal
> within Vim — opened with *:term* — *or* the terminal window that's
> housing Vim?
>
> If it's the later, I wonder if SigUSR1 may help here? — where SigUSR1
> is the interrupt your terminal sends to Vim in the event that it's
> being closed impromptu — *disclaimer: I haven't tried this; I'm just
> inferring from the docs* — *:h autocmd-events*
>
> If you want to autosave, there's a nifty battle-tested Vim plugin —
> vim-auto-save <https://github.com/vim-scripts/vim-auto-save> — which
> I've entrusted to doing this for me.
>
>
> Best,
> Igbanam.
>
> On Mon, Oct 24, 2022 at 6:42 AM Dennis Nezic
> <dennisn@dennisn.mooo.com> wrote:
>
> > "au VimLeavePre * w" only works when I exit vim with something like
> > ":q!" but not if I close my terminal window.
> >
> > Error detected while processing VimLeavePre Autocommands for "*":
> > E749: Empty buffer
> >
> > VimLeave[Pre] is being called, but the buffer is not saved, probably
> > because it's closed before that event is triggered. Is there another
> > event that gets triggered during the closing sequence that will
> > allow me to autosave, or another way to do this?
> >
> > --
> > --
> > 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/20221023224251.eaf04689726b89d749e73d9b%40dennisn.mooo.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/CAOmRJreOa6xqQ6%3D%2BU8zX7D3N7DpXfrJ4nPVaoP3yGzjNMoLaUQ%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/20221024093653.1b9ffc61469df49044f71997%40dennisn.mooo.com.

Re: How to autosave files when terminal is closed

Hi Dennis,

Are you asking for an event which fires when you close the terminal within Vim — opened with :termor the terminal window that's housing Vim?

If it's the later, I wonder if SigUSR1 may help here? — where SigUSR1 is the interrupt your terminal sends to Vim in the event that it's being closed impromptu — disclaimer: I haven't tried this; I'm just inferring from the docs:h autocmd-events

If you want to autosave, there's a nifty battle-tested Vim plugin — vim-auto-save — which I've entrusted to doing this for me. 


Best,
Igbanam.

On Mon, Oct 24, 2022 at 6:42 AM Dennis Nezic <dennisn@dennisn.mooo.com> wrote:
"au VimLeavePre * w" only works when I exit vim with something like
":q!" but not if I close my terminal window.

Error detected while processing VimLeavePre Autocommands for "*":
E749: Empty buffer

VimLeave[Pre] is being called, but the buffer is not saved, probably
because it's closed before that event is triggered. Is there another
event that gets triggered during the closing sequence that will allow
me to autosave, or another way to do this?

--
--
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/20221023224251.eaf04689726b89d749e73d9b%40dennisn.mooo.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/CAOmRJreOa6xqQ6%3D%2BU8zX7D3N7DpXfrJ4nPVaoP3yGzjNMoLaUQ%40mail.gmail.com.