Sunday, October 23, 2022

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?

--
--
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.

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.

--
--
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/504dfa2b-e05e-478a-8ce1-39444a36a818n%40googlegroups.com.

Saturday, October 22, 2022

Re: Share variables between Two vim9 def functions

Hi Tommy

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.

Nicolas

Le jeudi 20 octobre 2022 à 09:23:46 UTC+2, tommy....@gmail.com a écrit :
I don't get what you mean really, I'd use a g:global variable personally, and not think more of it.

Hth

Tommy

tir. 18. okt. 2022, 6:50 p.m. skrev Nicolas <niva...@gmail.com>:
Hi,

All written in vim9script, I wonder how sharing variable between two def vim9 functions out of declaring these funcs as this :    
  • the first one imported and used throught _vimrc autocommand on BufEnter
  • the second one is declared inside the first one and is mapped just after in the code on event such as mouse double click.
The second one func, it needs variable dict computed by the first one on each BufEnter event.


In vimfiles/helper/autoload/helper.vim I got 
export def UnderLineHeaders(): void
  var headers: dict<string> = {}      
   .. some stuff
   ..  

  def g:OpeningHeader(): void       
     exe 'edit ' .. headers['goodIdxHeader'] ~path to the header file.
  enddef
  nnoremap <buffer> <2-Leftmouse> :call g:OpeningHeader()<CR>     <<< be carefull :)
enddef

In _vimrc i got:
  import autoload './vimfiles/plugged/helper.vim/autoload/helper.vim' as that
  autocmd BufEnter *.cpp,*.h thatUnderLineHeaders()                  <<< be carefull :)



Out of global var, I think there is a better way  to share something between first exported func and triggered on BufEnter and second one which needs variable computed of this triggered func, second one which occurs and called on mapped double click mouse event .


Thank you for your help
I can share the entire vimscript if needed.
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/86cfe413-7cc8-43b1-bc2c-446398bba367n%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/f35fda3a-35b1-4634-848b-4b0a1d09a278n%40googlegroups.com.

Thursday, October 20, 2022

Re: Share variables between Two vim9 def functions

I don't get what you mean really, I'd use a g:global variable personally, and not think more of it.

Hth

Tommy

tir. 18. okt. 2022, 6:50 p.m. skrev Nicolas <nivaemail@gmail.com>:
Hi,

All written in vim9script, I wonder how sharing variable between two def vim9 functions out of declaring these funcs as this :    
  • the first one imported and used throught _vimrc autocommand on BufEnter
  • the second one is declared inside the first one and is mapped just after in the code on event such as mouse double click.
The second one func, it needs variable dict computed by the first one on each BufEnter event.


In vimfiles/helper/autoload/helper.vim I got 
export def UnderLineHeaders(): void
  var headers: dict<string> = {}      
   .. some stuff
   ..  

  def g:OpeningHeader(): void       
     exe 'edit ' .. headers['goodIdxHeader'] ~path to the header file.
  enddef
  nnoremap <buffer> <2-Leftmouse> :call g:OpeningHeader()<CR>     <<< be carefull :)
enddef

In _vimrc i got:
  import autoload './vimfiles/plugged/helper.vim/autoload/helper.vim' as that
  autocmd BufEnter *.cpp,*.h thatUnderLineHeaders()                  <<< be carefull :)



Out of global var, I think there is a better way  to share something between first exported func and triggered on BufEnter and second one which needs variable computed of this triggered func, second one which occurs and called on mapped double click mouse event .


Thank you for your help
I can share the entire vimscript if needed.
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/86cfe413-7cc8-43b1-bc2c-446398bba367n%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/CAL3odWzSHJNW3R0Jb469L%3DVhtF%2BWLunZu297bu5sEKzqr2%3Drvg%40mail.gmail.com.

Tuesday, October 18, 2022

Share variables between Two vim9 def functions

Hi,

All written in vim9script, I wonder how sharing variable between two def vim9 functions out of declaring these funcs as this :    
  • the first one imported and used throught _vimrc autocommand on BufEnter
  • the second one is declared inside the first one and is mapped just after in the code on event such as mouse double click.
The second one func, it needs variable dict computed by the first one on each BufEnter event.


In vimfiles/helper/autoload/helper.vim I got 
export def UnderLineHeaders(): void
  var headers: dict<string> = {}      
   .. some stuff
   ..  

  def g:OpeningHeader(): void       
     exe 'edit ' .. headers['goodIdxHeader'] ~path to the header file.
  enddef
  nnoremap <buffer> <2-Leftmouse> :call g:OpeningHeader()<CR>     <<< be carefull :)
enddef

In _vimrc i got:
  import autoload './vimfiles/plugged/helper.vim/autoload/helper.vim' as that
  autocmd BufEnter *.cpp,*.h thatUnderLineHeaders()                  <<< be carefull :)



Out of global var, I think there is a better way  to share something between first exported func and triggered on BufEnter and second one which needs variable computed of this triggered func, second one which occurs and called on mapped double click mouse event .


Thank you for your help
I can share the entire vimscript if needed.
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/86cfe413-7cc8-43b1-bc2c-446398bba367n%40googlegroups.com.

Re: vim9script autocommand not recalled more than one time ??

Yes it works also as this :

in vimfiles/helper/autoload/helper.vim
export def TestExportedFunc(): void
  echomsg 'Exported Func Test is well imported and called for file ' .. expand("%:p")
enddef

in _vimrc
if has('autocmd')
  autocmd BufEnter *.h,*.cpp call that.TestExportedFunc()


Thank you Doug
Nicolas
Le mardi 18 octobre 2022 à 14:38:07 UTC+2, Doug Kearns a écrit :
On Sun, 16 Oct 2022 at 08:17, Nicolas <niva...@gmail.com> wrote:
>
> Hi,
>
> Using some stuff in helper and calling them through autocommand defined in _vimrc,
> it seems called vim9 def function is just called one time.
>
>
> This is the autocmd in _vimrc
> import './vimfiles/plugged/nv-helper.vim/autoload/nvhelper.vim' as that
> autocmd BufEnter *.h,*.cpp :call that.TestImportedFunc()
>
> This is the vim9 func:
> export def TestImportedFunc(): void
> echomsg 'Imported Func is well called and tested.'
> enddef
>
>
> Don't understand why only on first buffer as cpp, the echomsg of this func so this func is called: just one time ?

It works for me with Vim 9.0.0769.

Regards,
Doug

--
--
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/d3e50a8b-efb8-4639-8ffd-2f4c9bf6e359n%40googlegroups.com.

Re: vim9script autocommand not recalled more than one time ??

On Sun, 16 Oct 2022 at 08:17, Nicolas <nivaemail@gmail.com> wrote:
>
> Hi,
>
> Using some stuff in helper and calling them through autocommand defined in _vimrc,
> it seems called vim9 def function is just called one time.
>
>
> This is the autocmd in _vimrc
> import './vimfiles/plugged/nv-helper.vim/autoload/nvhelper.vim' as that
> autocmd BufEnter *.h,*.cpp :call that.TestImportedFunc()
>
> This is the vim9 func:
> export def TestImportedFunc(): void
> echomsg 'Imported Func is well called and tested.'
> enddef
>
>
> Don't understand why only on first buffer as cpp, the echomsg of this func so this func is called: just one time ?

It works for me with Vim 9.0.0769.

Regards,
Doug

--
--
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/CAJ1uvoAvwWgZy8JgEahHw%2BQzkpQ4gjxtJU0pjYbx3Z-aD3p18A%40mail.gmail.com.