> - From vim9 help I see *Functions and variables are script-local by
> default*
>
> So s: is no mandatory no?, because if I put s: I see E1268:
> Cannot use s: in Vim9 script: s:yml_f = yml_fpath.
You need to declare the variable at the script level first. You cannot
create a script variable in a function. This is so that when accessing
the variable from a compiled function it knows where it is, it does not
need to be looked up by name (which is much faster).
> - So I delete s: and obtain this
>
> 3.12.0b1 (tags/v3.12.0b1:5612078, May 22 2023, 16:20:31) [MSC
> v.1934 64 bit (AMD64)]
> <vim.dictionary object at 0x0000020790DC9380>
>
> regarding this code :
> vim9script
>
> def Py3_SimpleMinimalTest(yml_fpath: string): void
> var yml_f: string = yml_fpath
> exe 'py3 print(sys.version)'
> exe 'py3 print(vim.current.buffer.vars)'
> exe 'py3 print(vim.current.buffer.vars[''yml_f''])'
> enddef
This will certainly not work, since "vim.current.buffer.vars[]" refers
to buffer-local variables. You could change the first line in this
function:
b:yml_f = yml_fpath
But is this really buffer related? And it does require a runtime lookup
by name. Using a script-local variable will work better.
--
There's no place like $(HOME)!
/// 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/20230531213005.3A2D11C1B32%40moolenaar.net.
Wednesday, May 31, 2023
Re: The package you uploaded (vim-noweb.tgz) is empty
> > > Just curious if this works with a zip extension or a simple .vmb for vimball.
> >
> > Great question. I had not heard of vimball. I will try it and see if
> > that gets around the error.
>
> See :h vimball
>
> > Is vimball the most portable format? Should the example be updated
> > on vim.org?
>
> I think vimball format was invented to have a nice way to distribute
> plguins in some kind of archive form (but only works well for text
> files). Nowadays, it seems it is rarely used and github plugin links
> have become the de-facto standard.
Right, those who don't mind pulling plugins directly from github, using
a plugin manager, won't use vimballs. Those who prefer the good old
"download & install" will find vimball fits their usage better. It's
mostly a choice the plugin writer makes and usually finds it less work
to just keep doing the same. But some support both, it's a little work
up front but little maintenance.
> That document should shows an example. It may make sense to update this:
> ping @bram
This was written by Charles Campbell. Is the help for ":MkVimball" not
sufficient? If someone wants to propose an improvement then ask Charles
to review it.
--
From "know your smileys":
% Bike accident. A bit far-fetched, I suppose; although...
o _ _ _
_o /\_ _ \\o (_)\__/o (_)
_< \_ _>(_) (_)/<_ \_| \ _|/' \/
(_)>(_) (_) (_) (_) (_)' _\o_
/// 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/20230531213005.351E31C1B27%40moolenaar.net.
> >
> > Great question. I had not heard of vimball. I will try it and see if
> > that gets around the error.
>
> See :h vimball
>
> > Is vimball the most portable format? Should the example be updated
> > on vim.org?
>
> I think vimball format was invented to have a nice way to distribute
> plguins in some kind of archive form (but only works well for text
> files). Nowadays, it seems it is rarely used and github plugin links
> have become the de-facto standard.
Right, those who don't mind pulling plugins directly from github, using
a plugin manager, won't use vimballs. Those who prefer the good old
"download & install" will find vimball fits their usage better. It's
mostly a choice the plugin writer makes and usually finds it less work
to just keep doing the same. But some support both, it's a little work
up front but little maintenance.
> That document should shows an example. It may make sense to update this:
> ping @bram
This was written by Charles Campbell. Is the help for ":MkVimball" not
sufficient? If someone wants to propose an improvement then ask Charles
to review it.
--
From "know your smileys":
% Bike accident. A bit far-fetched, I suppose; although...
o _ _ _
_o /\_ _ \\o (_)\__/o (_)
_< \_ _>(_) (_)/<_ \_| \ _|/' \/
(_)>(_) (_) (_) (_) (_)' _\o_
/// 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/20230531213005.351E31C1B27%40moolenaar.net.
Re: Multiple windows get corrupted
Ok. So as expected it happened again. And I followed the steps you (Bram) mentioned. I have following diffs between the bad (left side) and good (right side):
columns=258 <-----> columns=120
lines=72 <-----> lines=60
modified <-----> nomodified
scroll=35 <-----> scroll=29
window=71 <-----> window=59
--
--
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/92d48f21-370c-4e61-a589-d01540070420n%40googlegroups.com.
columns=258 <-----> columns=120
lines=72 <-----> lines=60
modified <-----> nomodified
scroll=35 <-----> scroll=29
window=71 <-----> window=59
lines, columns, and window are set in my .gvimrc. I am experimenting with commenting them out to see if any effect.
Any ideas from your side?
Thanks.
On Wednesday, May 31, 2023 at 10:11:40 AM UTC-4 Ben Mehmet wrote:
Thank you. I will follow the troubleshooting steps you highlighted.On Wednesday, May 31, 2023 at 7:48:24 AM UTC-4 Bram Moolenaar wrote:
> Everybody FYI... I thank all the replies I have gotten related to this
> issue which I should mention I have not figured out what the cause is. I
> followed the suggestion provided and was not able to find which, if any,
> plugin caused it. However, by pure chance I recently discovered one thing.
> So when that text garbling happened (and happened very often), I just used
> exit my vim session and open all files in session until next time it
> misbehaved again. Well the discovery that I made recently is that when that
> happened to me, instead of exiting, I could either *pull *the right edge of
> the window either in or out for a pixel or two OR *snap *the vim session
> window to either left or right (on linux like using super key and
> left/right arrow keys) of the screen and it refreshed my windows/buffers
> and things would look normal until next time it misbehaved.
> Does this discovery point in any direction as to what my issue is and how
> to remedy it permanently?
Perhaps a window resize event makes Vim recompute some things and then
it works again? Just guessing.
If some option gets a wrong value, such as 'lines' or 'columns', that
would cause display errors. You could do the following:
redir > /tmp/settings_1
set! all
redir END
Do this when everything works OK and later when things are wrong, using
a different file name. Then compare the output and try to spot the
difference. If you see an option with a suspect value, you can possibly
find out where it was set with e.g.:
:verbose set lines?
--
From "know your smileys":
8<}} Glasses, big nose, beard
/// 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/92d48f21-370c-4e61-a589-d01540070420n%40googlegroups.com.
Re: passing vim9 vars to python3
- From vim9 help I see Functions and variables are script-local by default
So s: is no mandatory no?, because if I put s: I see E1268: Cannot use s: in Vim9 script: s:yml_f = yml_fpath.
- So I delete s: and obtain this
3.12.0b1 (tags/v3.12.0b1:5612078, May 22 2023, 16:20:31) [MSC v.1934 64 bit (AMD64)]
<vim.dictionary object at 0x0000020790DC9380>
<vim.dictionary object at 0x0000020790DC9380>
regarding this code :
vim9script
def Py3_SimpleMinimalTest(yml_fpath: string): void
var yml_f: string = yml_fpath
exe 'py3 print(sys.version)'
exe 'py3 print(vim.current.buffer.vars)'
def Py3_SimpleMinimalTest(yml_fpath: string): void
var yml_f: string = yml_fpath
exe 'py3 print(sys.version)'
exe 'py3 print(vim.current.buffer.vars)'
exe 'py3 print(vim.current.buffer.vars[''yml_f''])'
enddef
Py3_SimpleMinimalTest('foobar.yml')
enddef
Py3_SimpleMinimalTest('foobar.yml')
Then I got
3.12.0b1 (tags/v3.12.0b1:5612078, May 22 2023, 16:20:31) [MSC v.1934 64 bit (AMD64)]
<vim.dictionary object at 0x0000020790DFFF00>Traceback (most recent call last):
File "<string>", line 1, in <module>
KeyError: 'yml_f'
Le mercredi 31 mai 2023 à 16:13:20 UTC+2, Bram Moolenaar a écrit :
> Thank you I knew, this is working
>
> vim9script
>
> def g:Py3_SimpleMinimalTest(yml_fpath: string): void
> w:yml_f = yml_fpath
> exe 'py3 print(sys.version)'
> exe 'py3 print(vim.current.window.vars[''yml_f''])'
> enddef
>
> and what about making this works
>
> def g:Py3_SimpleMinimalTest(yml_fpath: string): void
> *var yml_f:string =* yml_fpath
> exe 'py3 print(sys.version)'
> exe 'py3 print(vim.current.*????*.vars[''yml_f''])'
> enddef
Do you mean you want to access variables local to a compiled function by
name? That is not possible. The "l:" namespace that exists in legacy
functions was intentionally left out in compiled functions, because it
adds quite a bit of overhead. You can use a script-local variable to
make this work. It does mean you go outside of the function scope, but
it's still inside the scope of the script file. That means it won't
interfere with what happens in other scripts.
--
From "know your smileys":
<>:-) Bishop
/// 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/77f05256-1798-48fd-a794-265031be87e2n%40googlegroups.com.
Re: The package you uploaded (vim-noweb.tgz) is empty
On Di, 30 Mai 2023, Edward McGuire wrote:
> On Tuesday, May 30, 2023 at 12:38:34 PM UTC Christian Brabandt wrote:
> > What is the script id? I might be able to check it on the server (no promises
> however).
>
> Originally "vim-noweb", and also when I ran into the problem I tried making the
> ID the same as the filename "vim-noweb.tar.gz" and "vim-noweb.tgz".
No, I was referring to the vim.org URL, which should contain a script id.
>
> > Also is there a reason, you are using the tgz/tar.gz extension?
>
> I was following "https://www.vim.org/scripts/add_script.php". There I see the
> example, "if I was writing a script foo.vim that also had vim help file and a
> README file I would name the script foo.vim but my script package would be
> foo.tar.gz". So of course that is the example I followed.
I would just call it "foo" or in your case "vim-noweb"
> > Just curious if this works with a zip extension or a simple .vmb for vimball.
>
> Great question. I had not heard of vimball. I will try it and see if that gets
> around the error.
See :h vimball
> Is vimball the most portable format? Should the example be updated on vim.org?
I think vimball format was invented to have a nice way to distribute
plguins in some kind of archive form (but only works well for text
files). Nowadays, it seems it is rarely used and github plugin links
have become the de-facto standard.
That document should shows an example. It may make sense to update this:
ping @bram
Best,
Christian
--
In der Realität ist die Wirklichkeit ganz anders.
--
--
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/ZHdZA15n4Qv2c7OU%40256bit.org.
> On Tuesday, May 30, 2023 at 12:38:34 PM UTC Christian Brabandt wrote:
> > What is the script id? I might be able to check it on the server (no promises
> however).
>
> Originally "vim-noweb", and also when I ran into the problem I tried making the
> ID the same as the filename "vim-noweb.tar.gz" and "vim-noweb.tgz".
No, I was referring to the vim.org URL, which should contain a script id.
>
> > Also is there a reason, you are using the tgz/tar.gz extension?
>
> I was following "https://www.vim.org/scripts/add_script.php". There I see the
> example, "if I was writing a script foo.vim that also had vim help file and a
> README file I would name the script foo.vim but my script package would be
> foo.tar.gz". So of course that is the example I followed.
I would just call it "foo" or in your case "vim-noweb"
> > Just curious if this works with a zip extension or a simple .vmb for vimball.
>
> Great question. I had not heard of vimball. I will try it and see if that gets
> around the error.
See :h vimball
> Is vimball the most portable format? Should the example be updated on vim.org?
I think vimball format was invented to have a nice way to distribute
plguins in some kind of archive form (but only works well for text
files). Nowadays, it seems it is rarely used and github plugin links
have become the de-facto standard.
That document should shows an example. It may make sense to update this:
ping @bram
Best,
Christian
--
In der Realität ist die Wirklichkeit ganz anders.
--
--
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/ZHdZA15n4Qv2c7OU%40256bit.org.
Re: passing vim9 vars to python3
> Thank you I knew, this is working
>
> vim9script
>
> def g:Py3_SimpleMinimalTest(yml_fpath: string): void
> w:yml_f = yml_fpath
> exe 'py3 print(sys.version)'
> exe 'py3 print(vim.current.window.vars[''yml_f''])'
> enddef
>
> and what about making this works
>
> def g:Py3_SimpleMinimalTest(yml_fpath: string): void
> *var yml_f:string =* yml_fpath
> exe 'py3 print(sys.version)'
> exe 'py3 print(vim.current.*????*.vars[''yml_f''])'
> enddef
Do you mean you want to access variables local to a compiled function by
name? That is not possible. The "l:" namespace that exists in legacy
functions was intentionally left out in compiled functions, because it
adds quite a bit of overhead. You can use a script-local variable to
make this work. It does mean you go outside of the function scope, but
it's still inside the scope of the script file. That means it won't
interfere with what happens in other scripts.
--
From "know your smileys":
<>:-) Bishop
/// 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/20230531141312.17DE91C0916%40moolenaar.net.
>
> vim9script
>
> def g:Py3_SimpleMinimalTest(yml_fpath: string): void
> w:yml_f = yml_fpath
> exe 'py3 print(sys.version)'
> exe 'py3 print(vim.current.window.vars[''yml_f''])'
> enddef
>
> and what about making this works
>
> def g:Py3_SimpleMinimalTest(yml_fpath: string): void
> *var yml_f:string =* yml_fpath
> exe 'py3 print(sys.version)'
> exe 'py3 print(vim.current.*????*.vars[''yml_f''])'
> enddef
Do you mean you want to access variables local to a compiled function by
name? That is not possible. The "l:" namespace that exists in legacy
functions was intentionally left out in compiled functions, because it
adds quite a bit of overhead. You can use a script-local variable to
make this work. It does mean you go outside of the function scope, but
it's still inside the scope of the script file. That means it won't
interfere with what happens in other scripts.
--
From "know your smileys":
<>:-) Bishop
/// 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/20230531141312.17DE91C0916%40moolenaar.net.
Re: Multiple windows get corrupted
Thank you. I will follow the troubleshooting steps you highlighted.
--
--
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/b99aad18-784a-4267-b505-e65f3a415d57n%40googlegroups.com.
On Wednesday, May 31, 2023 at 7:48:24 AM UTC-4 Bram Moolenaar wrote:
> Everybody FYI... I thank all the replies I have gotten related to this
> issue which I should mention I have not figured out what the cause is. I
> followed the suggestion provided and was not able to find which, if any,
> plugin caused it. However, by pure chance I recently discovered one thing.
> So when that text garbling happened (and happened very often), I just used
> exit my vim session and open all files in session until next time it
> misbehaved again. Well the discovery that I made recently is that when that
> happened to me, instead of exiting, I could either *pull *the right edge of
> the window either in or out for a pixel or two OR *snap *the vim session
> window to either left or right (on linux like using super key and
> left/right arrow keys) of the screen and it refreshed my windows/buffers
> and things would look normal until next time it misbehaved.
> Does this discovery point in any direction as to what my issue is and how
> to remedy it permanently?
Perhaps a window resize event makes Vim recompute some things and then
it works again? Just guessing.
If some option gets a wrong value, such as 'lines' or 'columns', that
would cause display errors. You could do the following:
redir > /tmp/settings_1
set! all
redir END
Do this when everything works OK and later when things are wrong, using
a different file name. Then compare the output and try to spot the
difference. If you see an option with a suspect value, you can possibly
find out where it was set with e.g.:
:verbose set lines?
--
From "know your smileys":
8<}} Glasses, big nose, beard
/// 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/b99aad18-784a-4267-b505-e65f3a415d57n%40googlegroups.com.
Re: passing vim9 vars to python3
Hi Bram,
--
--
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/d1af74ca-a97b-4e41-8069-e37d10ff68ddn%40googlegroups.com.
Thank you I knew, this is working
vim9script
def g:Py3_SimpleMinimalTest(yml_fpath: string): void
w:yml_f = yml_fpath
exe 'py3 print(sys.version)'
exe 'py3 print(vim.current.window.vars[''yml_f''])'
enddef
def g:Py3_SimpleMinimalTest(yml_fpath: string): void
w:yml_f = yml_fpath
exe 'py3 print(sys.version)'
exe 'py3 print(vim.current.window.vars[''yml_f''])'
enddef
and what about making this works
def g:Py3_SimpleMinimalTest(yml_fpath: string): void
var yml_f:string = yml_fpath
exe 'py3 print(sys.version)'
exe 'py3 print(vim.current.????.vars[''yml_f''])'
enddef
var yml_f:string = yml_fpath
exe 'py3 print(sys.version)'
exe 'py3 print(vim.current.????.vars[''yml_f''])'
enddef
Thank you
Le mercredi 31 mai 2023 à 13:48:23 UTC+2, Bram Moolenaar a écrit :
> Seeing the legacy vimscript func* Test_python3_vars()* in
> *src\testdir\test_python3.vim*,
>
> Can you confirm that in vim9script, those setlines test are no possible to
> be written in same way to be passed to python3 world ?
>
> func Test_python3_vars()
> let g:foo = 'bac' -- << -- THE ONLY ONE CAN BE USED in vim9 ?
> let w:abc3 = 'def' -- << -- NOT POSSIBLE in vim9
> let b:baz = 'bar' -- << -- NOT POSSIBLE in vim9
> let t:bar = 'jkl' -- << -- NOT POSSIBLE in vim9
I guess you mean that in Vim9 script and in a :def function the "let"
command doesn't work. You can just leave it out, e.g.:
w:abc3 = 'def'
> Beyond a simple variable, is it possible to move a VIM9 class to the
> python3 world?
You mean to pass a reference of the class and use it in Python? No,
that is not possible. The class implementation is only halfway, but
even when the work has been done a Python script will not be able to
access a Vim class directly. You can only use it in a Vim script
context, such as using "vim.eval()".
--
Do not trust atoms, they make up everything.
/// 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/d1af74ca-a97b-4e41-8069-e37d10ff68ddn%40googlegroups.com.
Re: passing vim9 vars to python3
> Seeing the legacy vimscript func* Test_python3_vars()* in
> *src\testdir\test_python3.vim*,
>
> Can you confirm that in vim9script, those setlines test are no possible to
> be written in same way to be passed to python3 world ?
>
> func Test_python3_vars()
> let g:foo = 'bac' -- << -- THE ONLY ONE CAN BE USED in vim9 ?
> let w:abc3 = 'def' -- << -- NOT POSSIBLE in vim9
> let b:baz = 'bar' -- << -- NOT POSSIBLE in vim9
> let t:bar = 'jkl' -- << -- NOT POSSIBLE in vim9
I guess you mean that in Vim9 script and in a :def function the "let"
command doesn't work. You can just leave it out, e.g.:
w:abc3 = 'def'
> Beyond a simple variable, is it possible to move a VIM9 class to the
> python3 world?
You mean to pass a reference of the class and use it in Python? No,
that is not possible. The class implementation is only halfway, but
even when the work has been done a Python script will not be able to
access a Vim class directly. You can only use it in a Vim script
context, such as using "vim.eval()".
--
Do not trust atoms, they make up everything.
/// 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/20230531114816.CA8211C1B32%40moolenaar.net.
> *src\testdir\test_python3.vim*,
>
> Can you confirm that in vim9script, those setlines test are no possible to
> be written in same way to be passed to python3 world ?
>
> func Test_python3_vars()
> let g:foo = 'bac' -- << -- THE ONLY ONE CAN BE USED in vim9 ?
> let w:abc3 = 'def' -- << -- NOT POSSIBLE in vim9
> let b:baz = 'bar' -- << -- NOT POSSIBLE in vim9
> let t:bar = 'jkl' -- << -- NOT POSSIBLE in vim9
I guess you mean that in Vim9 script and in a :def function the "let"
command doesn't work. You can just leave it out, e.g.:
w:abc3 = 'def'
> Beyond a simple variable, is it possible to move a VIM9 class to the
> python3 world?
You mean to pass a reference of the class and use it in Python? No,
that is not possible. The class implementation is only halfway, but
even when the work has been done a Python script will not be able to
access a Vim class directly. You can only use it in a Vim script
context, such as using "vim.eval()".
--
Do not trust atoms, they make up everything.
/// 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/20230531114816.CA8211C1B32%40moolenaar.net.
Re: Multiple windows get corrupted
> Everybody FYI... I thank all the replies I have gotten related to this
> issue which I should mention I have not figured out what the cause is. I
> followed the suggestion provided and was not able to find which, if any,
> plugin caused it. However, by pure chance I recently discovered one thing.
> So when that text garbling happened (and happened very often), I just used
> exit my vim session and open all files in session until next time it
> misbehaved again. Well the discovery that I made recently is that when that
> happened to me, instead of exiting, I could either *pull *the right edge of
> the window either in or out for a pixel or two OR *snap *the vim session
> window to either left or right (on linux like using super key and
> left/right arrow keys) of the screen and it refreshed my windows/buffers
> and things would look normal until next time it misbehaved.
> Does this discovery point in any direction as to what my issue is and how
> to remedy it permanently?
Perhaps a window resize event makes Vim recompute some things and then
it works again? Just guessing.
If some option gets a wrong value, such as 'lines' or 'columns', that
would cause display errors. You could do the following:
redir > /tmp/settings_1
set! all
redir END
Do this when everything works OK and later when things are wrong, using
a different file name. Then compare the output and try to spot the
difference. If you see an option with a suspect value, you can possibly
find out where it was set with e.g.:
:verbose set lines?
--
From "know your smileys":
8<}} Glasses, big nose, beard
/// 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/20230531114816.C4F711C1B27%40moolenaar.net.
> issue which I should mention I have not figured out what the cause is. I
> followed the suggestion provided and was not able to find which, if any,
> plugin caused it. However, by pure chance I recently discovered one thing.
> So when that text garbling happened (and happened very often), I just used
> exit my vim session and open all files in session until next time it
> misbehaved again. Well the discovery that I made recently is that when that
> happened to me, instead of exiting, I could either *pull *the right edge of
> the window either in or out for a pixel or two OR *snap *the vim session
> window to either left or right (on linux like using super key and
> left/right arrow keys) of the screen and it refreshed my windows/buffers
> and things would look normal until next time it misbehaved.
> Does this discovery point in any direction as to what my issue is and how
> to remedy it permanently?
Perhaps a window resize event makes Vim recompute some things and then
it works again? Just guessing.
If some option gets a wrong value, such as 'lines' or 'columns', that
would cause display errors. You could do the following:
redir > /tmp/settings_1
set! all
redir END
Do this when everything works OK and later when things are wrong, using
a different file name. Then compare the output and try to spot the
difference. If you see an option with a suspect value, you can possibly
find out where it was set with e.g.:
:verbose set lines?
--
From "know your smileys":
8<}} Glasses, big nose, beard
/// 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/20230531114816.C4F711C1B27%40moolenaar.net.
passing vim9 vars to python3
Hi,
--
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/9e8fa53c-df9b-4f71-b3ee-01c03aed5e42n%40googlegroups.com.
Seeing the legacy vimscript func Test_python3_vars() in src\testdir\test_python3.vim,
Can you confirm that in vim9script, those setlines test are no possible to be written in same way to be passed to python3 world ?
func Test_python3_vars()
let g:foo = 'bac' -- << -- THE ONLY ONE CAN BE USED in vim9 ?
let w:abc3 = 'def' -- << -- NOT POSSIBLE in vim9
let b:baz = 'bar' -- << -- NOT POSSIBLE in vim9
let t:bar = 'jkl' -- << -- NOT POSSIBLE in vim9
let g:foo = 'bac' -- << -- THE ONLY ONE CAN BE USED in vim9 ?
let w:abc3 = 'def' -- << -- NOT POSSIBLE in vim9
let b:baz = 'bar' -- << -- NOT POSSIBLE in vim9
let t:bar = 'jkl' -- << -- NOT POSSIBLE in vim9
Beyond a simple variable, is it possible to move a VIM9 class to the python3 world?
Thank you
N i c o l a s
-- --
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/9e8fa53c-df9b-4f71-b3ee-01c03aed5e42n%40googlegroups.com.
Tuesday, May 30, 2023
Re: Multiple windows get corrupted
Everybody FYI... I thank all the replies I have gotten related to this issue which I should mention I have not figured out what the cause is. I followed the suggestion provided and was not able to find which, if any, plugin caused it. However, by pure chance I recently discovered one thing. So when that text garbling happened (and happened very often), I just used exit my vim session and open all files in session until next time it misbehaved again. Well the discovery that I made recently is that when that happened to me, instead of exiting, I could either pull the right edge of the window either in or out for a pixel or two OR snap the vim session window to either left or right (on linux like using super key and left/right arrow keys) of the screen and it refreshed my windows/buffers and things would look normal until next time it misbehaved.
Does this discovery point in any direction as to what my issue is and how to remedy it permanently?
Thanks in advance.
Ben
--
--
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/9093484c-7a71-403b-8853-f4213c33e8b9n%40googlegroups.com.
Does this discovery point in any direction as to what my issue is and how to remedy it permanently?
Thanks in advance.
Ben
On Saturday, December 31, 2022 at 5:38:50 AM UTC-6 Enan Ajmain wrote:
On Fri, 30 Dec 2022 21:17:26 -0800 (PST)
Ben Mehmet <ozu...@gmail.com> wrote:
> Could you help with recommending how to proceed with my .vimrc and
> plugins to find the culprit? I mean how should I start incorporating
> my settings in?
https://vi.stackexchange.com/questions/2003/how-do-i-debug-my-vimrc-file
--
Enan
3nan....@gmail.com
https://git.sr.ht/~enan/
https://www.github.com/3N4N
--
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/9093484c-7a71-403b-8853-f4213c33e8b9n%40googlegroups.com.
Re: Multiple windows get corrupted
Everybody FYI... I thank all the replies I have gotten related to this issue which I should mention I have not figured out what the cause is. I followed the suggestion provided and was not able to find which, if any, plugin caused it. However, by pure chance I recently discovered one thing. So when that text garbling happened (and happened very often), I just used exit my vim session and open all files in session until next time it misbehaved again. Well the discovery that I made recently is that when that happened to me, instead of exiting, I could just snap the vim session window to either left or right (on linux like using super key and left/right arrow keys) of the screen and it refreshed my windows/buffers and things would look normal until next time it misbehaved.
--
--
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/983bffb6-1183-4d8d-b4a3-743952f3aa68n%40googlegroups.com.
Does this discovery point in any direction as to what my issue is and how to remedy it permanently?
Thanks in advance.
Ben
On Saturday, December 31, 2022 at 5:38:50 AM UTC-6 Enan Ajmain wrote:
On Fri, 30 Dec 2022 21:17:26 -0800 (PST)
Ben Mehmet <ozu...@gmail.com> wrote:
> Could you help with recommending how to proceed with my .vimrc and
> plugins to find the culprit? I mean how should I start incorporating
> my settings in?
https://vi.stackexchange.com/questions/2003/how-do-i-debug-my-vimrc-file
--
Enan
3nan....@gmail.com
https://git.sr.ht/~enan/
https://www.github.com/3N4N
--
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/983bffb6-1183-4d8d-b4a3-743952f3aa68n%40googlegroups.com.
Re: The package you uploaded (vim-noweb.tgz) is empty
On Tuesday, May 30, 2023 at 12:38:34 PM UTC Christian Brabandt wrote:
> What is the script id? I might be able to check it on the server (no promises however).
Originally "vim-noweb", and also when I ran into the problem I tried making the ID the same as the filename "vim-noweb.tar.gz" and "vim-noweb.tgz".
> Also is there a reason, you are using the tgz/tar.gz extension?
--
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/c2187aaf-d174-47f2-a2bd-748f28329adan%40googlegroups.com.
> What is the script id? I might be able to check it on the server (no promises however).
Originally "vim-noweb", and also when I ran into the problem I tried making the ID the same as the filename "vim-noweb.tar.gz" and "vim-noweb.tgz".
> Also is there a reason, you are using the tgz/tar.gz extension?
I was following "https://www.vim.org/scripts/add_script.php". There I see the example, "if I was writing a script foo.vim that also had vim help file and a README file I would name the script foo.vim but my script package would be foo.tar.gz". So of course that is the example I followed.
> Just curious if this works with a zip extension or a simple .vmb for vimball.
> Just curious if this works with a zip extension or a simple .vmb for vimball.
Great question. I had not heard of vimball. I will try it and see if that gets around the error.
Is vimball the most portable format? Should the example be updated on vim.org?
Cheers! Edward
-- --
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/c2187aaf-d174-47f2-a2bd-748f28329adan%40googlegroups.com.
Re: The package you uploaded (vim-noweb.tgz) is empty
On Fr, 26 Mai 2023, Edward McGuire wrote:
> This is my first time to try to contribute a Vim plugin to vim.org.
> Where is this newbie going wrong?
>
> I offered a tarball containing an ftdetect, a syntax, and a README and LICENSE.
> The site replied: "The package you uploaded (vim-noweb.tgz) is empty".
>
> I have already extracted my own tarball to double check the contents.
> I have also tried renaming to vim-noweb.tar.gz, in case it was to do with naming .
>
> The plugin I'm trying to contribute lives at
> https://metaed.com/papers/vim-noweb/
> and the actual tarball is there.
Hi,
I am not sure. What is the script id? I might be able to check it on the
server (no promises however).
Also is there a reason, you are using the tgz/tar.gz extension? That is
always a bit troublesome to extract on Windows, so just curious if this
works with a zip extension or a simple .vmb for vimball.
Thanks,
Chris
--
Wenn jeder Mensch ahnte, von wie vielen er durchschaut wird!
-- Elias Canetti (Die Provinz des Menschen. 1942-1972)
--
--
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/ZHXuQuCqARVAs0C5%40256bit.org.
> This is my first time to try to contribute a Vim plugin to vim.org.
> Where is this newbie going wrong?
>
> I offered a tarball containing an ftdetect, a syntax, and a README and LICENSE.
> The site replied: "The package you uploaded (vim-noweb.tgz) is empty".
>
> I have already extracted my own tarball to double check the contents.
> I have also tried renaming to vim-noweb.tar.gz, in case it was to do with naming .
>
> The plugin I'm trying to contribute lives at
> https://metaed.com/papers/vim-noweb/
> and the actual tarball is there.
Hi,
I am not sure. What is the script id? I might be able to check it on the
server (no promises however).
Also is there a reason, you are using the tgz/tar.gz extension? That is
always a bit troublesome to extract on Windows, so just curious if this
works with a zip extension or a simple .vmb for vimball.
Thanks,
Chris
--
Wenn jeder Mensch ahnte, von wie vielen er durchschaut wird!
-- Elias Canetti (Die Provinz des Menschen. 1942-1972)
--
--
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/ZHXuQuCqARVAs0C5%40256bit.org.
Sunday, May 28, 2023
Re: vim autoformat ?
On Sun, 28 May 2023 09:35:00 +0200
Igor Lerinc <igor.lerinc7@gmail.com> wrote:
> So if I understood correctly, external tools won't help me more than
> Vim already has ?
> On Sun, May 28, 2023 at 6:53 AM Owajigbanam Ogbuluijah
> <xigbanam@gmail.com> wrote:
>
> > Hey Igor,
> >
> > Formatting in Vim is pretty simple. Vim already understands how to
> > format many filetypes. Try not to use too many plugins to
> > complicate things; especially if you're not mandated or forced to.
I agree with what Owajigbanam said, except external tools not helping.
First, Vim is great _because_ it can interface with any commandline
tools so effortlessly. And if there is a tool that specialize in
something, you _should_ use that. You will still be able to use the
'={motion}' keys, but underneath Vim will call the external tool (that's
what ':h formatprg' exists for). I understand your reservations about
not wanting to spawn new processes, but most commandline tools are tiny
and consume virtually no resource at all.
Vim takes time to familirize with. Be patient and go through the help
docs. That would be better than asking people broad questions such as
how formatting in Vim works, because everyone is at different level of
understanding and no one knows from which level to talk to you. If the
question is specific, e.g., how do I open a new tab?, then that's fine to
ask the next person instead of going through the manual. But if the
question is broad, e.g., how does formatting work? or how do jumplists
work?, then you'd do better reading the manual.
So I suggest again as --
I wrote on Sat, 27 May 2023 23:02:24 +0600:
> see ':h formatprg', ':h formatoptions', ':h formatexpr', etc.
--
Enan
--
--
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/20230529113214.7c0a4da7%40cirdan.
Igor Lerinc <igor.lerinc7@gmail.com> wrote:
> So if I understood correctly, external tools won't help me more than
> Vim already has ?
> On Sun, May 28, 2023 at 6:53 AM Owajigbanam Ogbuluijah
> <xigbanam@gmail.com> wrote:
>
> > Hey Igor,
> >
> > Formatting in Vim is pretty simple. Vim already understands how to
> > format many filetypes. Try not to use too many plugins to
> > complicate things; especially if you're not mandated or forced to.
I agree with what Owajigbanam said, except external tools not helping.
First, Vim is great _because_ it can interface with any commandline
tools so effortlessly. And if there is a tool that specialize in
something, you _should_ use that. You will still be able to use the
'={motion}' keys, but underneath Vim will call the external tool (that's
what ':h formatprg' exists for). I understand your reservations about
not wanting to spawn new processes, but most commandline tools are tiny
and consume virtually no resource at all.
Vim takes time to familirize with. Be patient and go through the help
docs. That would be better than asking people broad questions such as
how formatting in Vim works, because everyone is at different level of
understanding and no one knows from which level to talk to you. If the
question is specific, e.g., how do I open a new tab?, then that's fine to
ask the next person instead of going through the manual. But if the
question is broad, e.g., how does formatting work? or how do jumplists
work?, then you'd do better reading the manual.
So I suggest again as --
I wrote on Sat, 27 May 2023 23:02:24 +0600:
> see ':h formatprg', ':h formatoptions', ':h formatexpr', etc.
--
Enan
--
--
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/20230529113214.7c0a4da7%40cirdan.
Re: vim autoformat ?
> BTW, I suspect that Bram monitors vim-use, so cc-ing him just means he'll
> get two copies of the message.
So long as it's one message sent to different mail addresses, the
Message-ID field will be equal and they can be de-duplicated easily.
--
From "know your smileys":
O:-) Saint
/// 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/20230528172233.74DC11C0B0E%40moolenaar.net.
> get two copies of the message.
So long as it's one message sent to different mail addresses, the
Message-ID field will be equal and they can be de-duplicated easily.
--
From "know your smileys":
O:-) Saint
/// 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/20230528172233.74DC11C0B0E%40moolenaar.net.
Re: vim autoformat ?
If it's Perl code, there's a utility called perltidy, which is stand-alone.
BTW, I suspect that Bram monitors vim-use, so cc-ing him just means he'll
get two copies of the message.
--
--
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/c75d3fd2be5a38a2ee7ac379486f4058.squirrel%40webmail.vybenetworks.com.
BTW, I suspect that Bram monitors vim-use, so cc-ing him just means he'll
get two copies of the message.
--
--
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/c75d3fd2be5a38a2ee7ac379486f4058.squirrel%40webmail.vybenetworks.com.
Re: vim autoformat ?
So if I understood correctly, external tools won't help me more than Vim already has ?
Specifically, here is an example, for some use case, where I would need a formatter to fix ?
Or another, extreme example, or cluttered code.
Because I always thought of just writing code, in line, and then leaving editor format the rest, so I don't have to worry about readability .
Of course, that doesn't replace improper usage of indentation or blocks of code (like, for python it needs to have good indentation to work in the right way).
But it could help, if it at least helped when I write code inline, for it to format, as it sees fit. Not changing the meaning of code, just for readability, how much language allows of course.
First example uses .yaml, and sometimes it can change the meaning of a file, by indenting it, as you know for .yaml files..
On Sun, May 28, 2023 at 6:53 AM Owajigbanam Ogbuluijah <xigbanam@gmail.com> wrote:
Hey Igor,Formatting in Vim is pretty simple. Vim already understands how to format many filetypes. Try not to use too many plugins to complicate things; especially if you're not mandated or forced to.I'll second what Bram, and the others, said here earlier.You can start by formatting the entire file gg=G and checking that into Git. Subsequently, when you code, you can format-as-you-go. Remember = can take motions as well :help = has more details.p.s: the "motions" bit means you can do something like =ip to format the lines in a code blockAll the best,Igbanam--On Sun, May 28, 2023 at 3:54 AM Igor Lerinc <igor.lerinc7@gmail.com> wrote:But what about plugins likeThat use some external formatters.I find them slow, because it need to start program when called from Vim.And they say, it means you need to have some type of service running on your system.Like for 'prettier', you need 'prettierd' to not have lag when calling it.But I tried to setup 'prettierd', and got lost.And there is also some efm-langserver , which they say is fastest, because it formats only lines that need to be formatted (if I understood correctly).But I just have no idea what to do with this, how to install it, how to connect it to other external formatters, Vim plugins..https://github.com/mattn/efm-langserverVim-autoformat have explanation how to setup. But as I said, it takes time to start up program, so it already need to be running, using some sort of something, like efm-langserver ?I don't know really how to do this.I just want to have code more readable.--sub, 27. maj 2023. 23:22 Bram Moolenaar <Bram@moolenaar.net> је написао/ла:
> I can't wrap my head around Vim autoformat at all.
> I want to have autoformat on save feature.
> I don't want it to have delays, so when i press `:w` it immediatelly saves
> and formats indentation properly.
>
> I have no idea what is going on in (neo)Vim discussions about this
> autoformating. Looks like those people never coded in their life, and never
> do any useful thing with their godly configs other than to brag.
>
> Using Vim feature `gg=G` i format and indent whole file.
> This is what I want to have, but discussions related to this are so
> complicated. They just say 'look at my config', but I have no idea, what is
> that I should look into his config, or just copying his whole config with a
> lot of bloat.
>
> Please help.
To get you started:
au FileType pascal au BufWritePre <buffer> * normal gg=G
This will add a BufWritePre autocommand to a buffer where 'filetype' is
set to "pascal". You probably want to ehance this. E.g. add an augroup,
so you can delete the autocommand again.
Although this is what you asked for, you probably soon find out that
formatting text only when editing it works better. Formatting the whole
file may mess things up without you noticing.
--
From "know your smileys":
:-) Funny
|-) Funny Oriental
(-: Funny Australian
/// 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/CADZsa2rhiA%3Dh7SvXPJLDdHWM5cHKqS26tNLhkxBnD%2BkPSojz%3Dw%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 a topic in the Google Groups "vim_use" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vim_use/69sd3p5DVlM/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/CAOmRJreAjb0Omvs%3D8Z757rT-%3DeZHZLc6O1aRtPUAUrgXjbqrRA%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/CADZsa2pgUc6yvFJa0nK%3Dpe5K6xmiCMnD9rCg-176w47DHqCutQ%40mail.gmail.com.
Saturday, May 27, 2023
Re: vim autoformat ?
Hey Igor,
Formatting in Vim is pretty simple. Vim already understands how to format many filetypes. Try not to use too many plugins to complicate things; especially if you're not mandated or forced to.
I'll second what Bram, and the others, said here earlier.
You can start by formatting the entire file gg=G and checking that into Git. Subsequently, when you code, you can format-as-you-go. Remember = can take motions as well :help = has more details.
p.s: the "motions" bit means you can do something like =ip to format the lines in a code block
All the best,
Igbanam
On Sun, May 28, 2023 at 3:54 AM Igor Lerinc <igor.lerinc7@gmail.com> wrote:
But what about plugins likeThat use some external formatters.I find them slow, because it need to start program when called from Vim.And they say, it means you need to have some type of service running on your system.Like for 'prettier', you need 'prettierd' to not have lag when calling it.But I tried to setup 'prettierd', and got lost.And there is also some efm-langserver , which they say is fastest, because it formats only lines that need to be formatted (if I understood correctly).But I just have no idea what to do with this, how to install it, how to connect it to other external formatters, Vim plugins..https://github.com/mattn/efm-langserverVim-autoformat have explanation how to setup. But as I said, it takes time to start up program, so it already need to be running, using some sort of something, like efm-langserver ?I don't know really how to do this.I just want to have code more readable.--sub, 27. maj 2023. 23:22 Bram Moolenaar <Bram@moolenaar.net> је написао/ла:
> I can't wrap my head around Vim autoformat at all.
> I want to have autoformat on save feature.
> I don't want it to have delays, so when i press `:w` it immediatelly saves
> and formats indentation properly.
>
> I have no idea what is going on in (neo)Vim discussions about this
> autoformating. Looks like those people never coded in their life, and never
> do any useful thing with their godly configs other than to brag.
>
> Using Vim feature `gg=G` i format and indent whole file.
> This is what I want to have, but discussions related to this are so
> complicated. They just say 'look at my config', but I have no idea, what is
> that I should look into his config, or just copying his whole config with a
> lot of bloat.
>
> Please help.
To get you started:
au FileType pascal au BufWritePre <buffer> * normal gg=G
This will add a BufWritePre autocommand to a buffer where 'filetype' is
set to "pascal". You probably want to ehance this. E.g. add an augroup,
so you can delete the autocommand again.
Although this is what you asked for, you probably soon find out that
formatting text only when editing it works better. Formatting the whole
file may mess things up without you noticing.
--
From "know your smileys":
:-) Funny
|-) Funny Oriental
(-: Funny Australian
/// 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/CADZsa2rhiA%3Dh7SvXPJLDdHWM5cHKqS26tNLhkxBnD%2BkPSojz%3Dw%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/CAOmRJreAjb0Omvs%3D8Z757rT-%3DeZHZLc6O1aRtPUAUrgXjbqrRA%40mail.gmail.com.
Re: vim autoformat ?
But what about plugins like
That use some external formatters.
I find them slow, because it need to start program when called from Vim.
And they say, it means you need to have some type of service running on your system.
Like for 'prettier', you need 'prettierd' to not have lag when calling it.
But I tried to setup 'prettierd', and got lost.
And there is also some efm-langserver , which they say is fastest, because it formats only lines that need to be formatted (if I understood correctly).
But I just have no idea what to do with this, how to install it, how to connect it to other external formatters, Vim plugins..
Vim-autoformat have explanation how to setup. But as I said, it takes time to start up program, so it already need to be running, using some sort of something, like efm-langserver ?
I don't know really how to do this.
I just want to have code more readable.
sub, 27. maj 2023. 23:22 Bram Moolenaar <Bram@moolenaar.net> је написао/ла:
> I can't wrap my head around Vim autoformat at all.
> I want to have autoformat on save feature.
> I don't want it to have delays, so when i press `:w` it immediatelly saves
> and formats indentation properly.
>
> I have no idea what is going on in (neo)Vim discussions about this
> autoformating. Looks like those people never coded in their life, and never
> do any useful thing with their godly configs other than to brag.
>
> Using Vim feature `gg=G` i format and indent whole file.
> This is what I want to have, but discussions related to this are so
> complicated. They just say 'look at my config', but I have no idea, what is
> that I should look into his config, or just copying his whole config with a
> lot of bloat.
>
> Please help.
To get you started:
au FileType pascal au BufWritePre <buffer> * normal gg=G
This will add a BufWritePre autocommand to a buffer where 'filetype' is
set to "pascal". You probably want to ehance this. E.g. add an augroup,
so you can delete the autocommand again.
Although this is what you asked for, you probably soon find out that
formatting text only when editing it works better. Formatting the whole
file may mess things up without you noticing.
--
From "know your smileys":
:-) Funny
|-) Funny Oriental
(-: Funny Australian
/// 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/CADZsa2rhiA%3Dh7SvXPJLDdHWM5cHKqS26tNLhkxBnD%2BkPSojz%3Dw%40mail.gmail.com.
Re: vim autoformat ?
> I can't wrap my head around Vim autoformat at all.
> I want to have autoformat on save feature.
> I don't want it to have delays, so when i press `:w` it immediatelly saves
> and formats indentation properly.
>
> I have no idea what is going on in (neo)Vim discussions about this
> autoformating. Looks like those people never coded in their life, and never
> do any useful thing with their godly configs other than to brag.
>
> Using Vim feature `gg=G` i format and indent whole file.
> This is what I want to have, but discussions related to this are so
> complicated. They just say 'look at my config', but I have no idea, what is
> that I should look into his config, or just copying his whole config with a
> lot of bloat.
>
> Please help.
To get you started:
au FileType pascal au BufWritePre <buffer> * normal gg=G
This will add a BufWritePre autocommand to a buffer where 'filetype' is
set to "pascal". You probably want to ehance this. E.g. add an augroup,
so you can delete the autocommand again.
Although this is what you asked for, you probably soon find out that
formatting text only when editing it works better. Formatting the whole
file may mess things up without you noticing.
--
From "know your smileys":
:-) Funny
|-) Funny Oriental
(-: Funny Australian
/// 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/20230527212235.DA4821C0F36%40moolenaar.net.
> I want to have autoformat on save feature.
> I don't want it to have delays, so when i press `:w` it immediatelly saves
> and formats indentation properly.
>
> I have no idea what is going on in (neo)Vim discussions about this
> autoformating. Looks like those people never coded in their life, and never
> do any useful thing with their godly configs other than to brag.
>
> Using Vim feature `gg=G` i format and indent whole file.
> This is what I want to have, but discussions related to this are so
> complicated. They just say 'look at my config', but I have no idea, what is
> that I should look into his config, or just copying his whole config with a
> lot of bloat.
>
> Please help.
To get you started:
au FileType pascal au BufWritePre <buffer> * normal gg=G
This will add a BufWritePre autocommand to a buffer where 'filetype' is
set to "pascal". You probably want to ehance this. E.g. add an augroup,
so you can delete the autocommand again.
Although this is what you asked for, you probably soon find out that
formatting text only when editing it works better. Formatting the whole
file may mess things up without you noticing.
--
From "know your smileys":
:-) Funny
|-) Funny Oriental
(-: Funny Australian
/// 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/20230527212235.DA4821C0F36%40moolenaar.net.
Re: vim autoformat ?
On Sat, May 27, 2023, 13:02 Enan Ajmain <3nan.ajmain@gmail.com> wrote:
Igor: I second Matvey's caution. If you are working on a project that
has an autoformat tool which all contributors are supposed to be using,
e.g., uncrustify, then autoformatting could possibly be useful. But if
you're working on a project that imposes no such formatting guideline,
then auto formatting code someone else wrote, which doesn't concern the
logic you're coding in a particular commit, is at best unhelpful for the
other contributors. And I mention other contributors because judging by
your comments such as "Looks like those people never coded in their
life," it's reasonable to expect you code in projects with multiple
people, not just yourself.
And as for a suggestion to your original question: see ':h formatprg',
':h formatoptions', ':h formatexpr', etc.
--
Enan
The other problem with reformatting an entire file is that you lose history. Git, for example, has a feature called blame (or credit, depending on your frame of mind) that will tell you the last person who modified each line and the corresponding git commit, which is useful if you have questions about a particular block of code and want to know whom to ask. If you reformat the entire file, though, then it will appear as if you wrote the entire file. Regrettably, this isn't just hypothetical: I've occasionally asked a developer about some code only to be told that they only reformatted it to make it pretty and can't actually explain what it's doing.
A better solution would be for you to figure out exactly which lines you've changed and only operate on those. I did recently write something in Vim9 to do this and use it to strip trailing spaces and things like that, but only from lines I've added or modified. (Back when I wrote it, I asked if there was any interest and no one expressed any, so it's not really in a state where it's ready to be consumed by other people as a proper plugin.)
Salman
--
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/CANuxnEcwo%2BUZ-SwATzBmm52__VX9Q-%2Bp-Tk50G61qDzt5oRTGw%40mail.gmail.com.
Re: vim autoformat ?
On Sat, 27 May 2023 19:32:31 +0300
M <matthewtarasov@gmail.com> wrote:
> ____, 27 ______ 2023 __., 18:31 Igor Lerinc <igor.lerinc7@gmail.com>:
> > [...]
> > I have no idea what is going on in (neo)Vim discussions about this
> > autoformating. Looks like those people never coded in their life.
>
> [...]
> However, note that such "auto-features" quickly become very annoying, so
> think twice on what conditions to apply or to bypass it.
Igor: I second Matvey's caution. If you are working on a project that
has an autoformat tool which all contributors are supposed to be using,
e.g., uncrustify, then autoformatting could possibly be useful. But if
you're working on a project that imposes no such formatting guideline,
then auto formatting code someone else wrote, which doesn't concern the
logic you're coding in a particular commit, is at best unhelpful for the
other contributors. And I mention other contributors because judging by
your comments such as "Looks like those people never coded in their
life," it's reasonable to expect you code in projects with multiple
people, not just yourself.
And as for a suggestion to your original question: see ':h formatprg',
':h formatoptions', ':h formatexpr', etc.
--
Enan
--
--
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/20230527230200.00006c5c%40gmail.com.
M <matthewtarasov@gmail.com> wrote:
> ____, 27 ______ 2023 __., 18:31 Igor Lerinc <igor.lerinc7@gmail.com>:
> > [...]
> > I have no idea what is going on in (neo)Vim discussions about this
> > autoformating. Looks like those people never coded in their life.
>
> [...]
> However, note that such "auto-features" quickly become very annoying, so
> think twice on what conditions to apply or to bypass it.
Igor: I second Matvey's caution. If you are working on a project that
has an autoformat tool which all contributors are supposed to be using,
e.g., uncrustify, then autoformatting could possibly be useful. But if
you're working on a project that imposes no such formatting guideline,
then auto formatting code someone else wrote, which doesn't concern the
logic you're coding in a particular commit, is at best unhelpful for the
other contributors. And I mention other contributors because judging by
your comments such as "Looks like those people never coded in their
life," it's reasonable to expect you code in projects with multiple
people, not just yourself.
And as for a suggestion to your original question: see ':h formatprg',
':h formatoptions', ':h formatexpr', etc.
--
Enan
--
--
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/20230527230200.00006c5c%40gmail.com.
Re: vim autoformat ?
сб, 27 мая 2023 г., 18:31 Igor Lerinc <igor.lerinc7@gmail.com>:
I can't wrap my head around Vim autoformat at all.I want to have autoformat on save feature.I don't want it to have delays, so when i press `:w` it immediatelly saves and formats indentation properly.I have no idea what is going on in (neo)Vim discussions about this autoformating. Looks like those people never coded in their life, and never do any useful thing with their godly configs other than to brag.Using Vim feature `gg=G` i format and indent whole file.This is what I want to have, but discussions related to this are so complicated. They just say 'look at my config', but I have no idea, what is that I should look into his config, or just copying his whole config with a lot of bloat.Please help.--
--
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/961e2663-4abb-46d7-aabe-c5be9ac94498n%40googlegroups.com.
Basically, you need to catch BufWritePre event and do whatever it takes to format file there.
However, note that such "auto-features" quickly become very annoying, so think twice on what conditions to apply or to bypass it.
Kind regards,
Matvey
--
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/CAFsTB%2BJ74fWwSj%2BW0U6GU8tCLku%3DVujHN4kGkvuzduj2BOkw5A%40mail.gmail.com.
vim autoformat ?
I can't wrap my head around Vim autoformat at 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/961e2663-4abb-46d7-aabe-c5be9ac94498n%40googlegroups.com.
I want to have autoformat on save feature.
I don't want it to have delays, so when i press `:w` it immediatelly saves and formats indentation properly.
I have no idea what is going on in (neo)Vim discussions about this autoformating. Looks like those people never coded in their life, and never do any useful thing with their godly configs other than to brag.
Using Vim feature `gg=G` i format and indent whole file.
This is what I want to have, but discussions related to this are so complicated. They just say 'look at my config', but I have no idea, what is that I should look into his config, or just copying his whole config with a lot of bloat.
Please help.
-- --
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/961e2663-4abb-46d7-aabe-c5be9ac94498n%40googlegroups.com.
Friday, May 26, 2023
The package you uploaded (vim-noweb.tgz) is empty
This is my first time to try to contribute a Vim plugin to vim.org.
Where is this newbie going wrong?
--
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/73468e15-2bf5-41dc-8599-3112626df371n%40googlegroups.com.
Where is this newbie going wrong?
I offered a tarball containing an ftdetect, a syntax, and a README and LICENSE.
The site replied: "The package you uploaded (vim-noweb.tgz) is empty".
I have already extracted my own tarball to double check the contents.
I have also tried renaming to vim-noweb.tar.gz, in case it was to do with naming .
The plugin I'm trying to contribute lives at
https://metaed.com/papers/vim-noweb/
and the actual tarball is there.
Cheers!
Edward
-- --
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/73468e15-2bf5-41dc-8599-3112626df371n%40googlegroups.com.
Tuesday, May 23, 2023
Re: E123 when referring to function argument
On May 23, 2023, at 09:48, Bram Moolenaar <Bram@moolenaar.net> wrote:
The argument of the "func" command is a function name, not an
expression. You are passing a variable, which is an expression.
There is a trick you can use: Assign the function reference to a global
variable. Function names exist in the global namespace where the global
variable can also be found:
def g:LambdaText(Op: func(): number): void
g:ThatFunction = Op
func g:ThatFunction
unlet g:ThatFunction
enddef
I also learned I can call string(function(Op)) to get the lambda's name, and then call execute('func ' .. lambda_name) to get the lambda's body.
Matan
Re: E123 when referring to function argument
> I want to peek into a lambda so I can evaluate it in a new Vim process. Why
> do I get 'E123: Undefined function: Op' when I source this script?
>
> vim9script
> def! g:LambdaText(Op: func(): number): void
> func Op
> enddef
>
> def! g:TestRun(): void
> g:LambdaText(() => 2 * 4)
> enddef
>
> g:TestRun()
The argument of the "func" command is a function name, not an
expression. You are passing a variable, which is an expression.
There is a trick you can use: Assign the function reference to a global
variable. Function names exist in the global namespace where the global
variable can also be found:
def g:LambdaText(Op: func(): number): void
g:ThatFunction = Op
func g:ThatFunction
unlet g:ThatFunction
enddef
--
Be thankful to be in a traffic jam, because it means you own a car.
/// 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/20230523134823.1939E1C0F38%40moolenaar.net.
> do I get 'E123: Undefined function: Op' when I source this script?
>
> vim9script
> def! g:LambdaText(Op: func(): number): void
> func Op
> enddef
>
> def! g:TestRun(): void
> g:LambdaText(() => 2 * 4)
> enddef
>
> g:TestRun()
The argument of the "func" command is a function name, not an
expression. You are passing a variable, which is an expression.
There is a trick you can use: Assign the function reference to a global
variable. Function names exist in the global namespace where the global
variable can also be found:
def g:LambdaText(Op: func(): number): void
g:ThatFunction = Op
func g:ThatFunction
unlet g:ThatFunction
enddef
--
Be thankful to be in a traffic jam, because it means you own a car.
/// 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/20230523134823.1939E1C0F38%40moolenaar.net.
Monday, May 22, 2023
E123 when referring to function argument
Hello.
I want to peek into a lambda so I can evaluate it in a new Vim process. Why do I get 'E123: Undefined function: Op' when I source this script?
def! g:LambdaText(Op: func(): number): void
func Op
enddef
def! g:TestRun(): void
g:LambdaText(() => 2 * 4)
enddef
g:TestRun()
Matan
--
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/CAATngTObX3maQ32K6TFSRmSsLuY9D0S2m2Ob-fYGYwuPsobQ9A%40mail.gmail.com.
Subscribe to:
Posts (Atom)