Thursday, August 11, 2022

Re: Build Vim without +vim9script

> Is it possible to build Vim without support for Vim 9 script?
>
> I would like to build Vim without +vim9script for testing purposes.
> I have tried to pass --disable-vim9script to ./configure, but it does
> not recognize the option. And I can't find anything related to Vim
> 9 script in feature.h.

Simple answer: no.

--
You cannot propel yourself forward by patting yourself on the back.

/// 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/20220811191130.8302B1C4F14%40moolenaar.net.

Build Vim without +vim9script

Is it possible to build Vim without support for Vim 9 script?

I would like to build Vim without +vim9script for testing purposes.
I have tried to pass --disable-vim9script to ./configure, but it does
not recognize the option. And I can't find anything related to Vim
9 script in feature.h.

Thanks,
Life.


--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/td3hv7%2440u%241%40ciao.gmane.io.

Re: vim9 exported functions not recognized by ctags

Don't worry neither afraid. 😊
It will be solved soon.. 

Le jeu. 11 août 2022 à 19:55, Lifepillar <lifepillar@lifepillar.me> a écrit :
On 2022-08-11, N V <nivaemail@gmail.com> wrote:
> So I put it in *somewhereOvertherainbow\*Vim\vim90\.ctags.d

If you put Ctags configuration there, does `ctags --list-kinds=vim`
still use it?

> But it seems to not runnning well : does not displays vim9 exported
> functions

I'm afraid I can't help you with Windows-specific configuration, as I'm
not using Windows.

Life.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to a topic in the Google Groups "vim_use" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vim_use/hp4KeIsDlFU/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/td3fqm%24i13%241%40ciao.gmane.io.

--
--
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/CAOKxv4Em6aj%2BZ9r2eFxUurLZ3bXvaOh7mj9N%2BtrhNqxxjbQ0rw%40mail.gmail.com.

Re: vim9 exported functions not recognized by ctags

On 2022-08-11, N V <nivaemail@gmail.com> wrote:
> So I put it in *somewhereOvertherainbow\*Vim\vim90\.ctags.d

If you put Ctags configuration there, does `ctags --list-kinds=vim`
still use it?

> But it seems to not runnning well : does not displays vim9 exported
> functions

I'm afraid I can't help you with Windows-specific configuration, as I'm
not using Windows.

Life.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/td3fqm%24i13%241%40ciao.gmane.io.

Re: New version of vim unsolicitedly sourcing defaults.vim?

On Thu, Aug 11, 2022 at 11:31:22AM +0200, Tony Mechelynck wrote:
>On Tue, Aug 9, 2022 at 7:54 PM Tim Chase <vim@tim.thechases.com> wrote:
>>
>> I upgraded packages on my FreeBSD box yesterday and noticed that
>> vimrc behavior had changed.
[snip]
>> :scriptnames
>
> Yes, it's your distro admins giving you what they think is good for
> you.

that matches our conclusions (see the ticket on the FreeBSD bug-tracker)

> What I do near (but not at) the top of my ~/.vimrc is source the
> $VIMRUNTIME/vimrc_example.vim (which, in recent versions of Vim,
> sources the defaults.vim) and then undo whatever it sets that I don't
> like

I don't want to have to keep up with whatever new settings get put
in defaults.vim, undoing them back to what I want (i.e., what they
were before this whole defaults.vim thing). I feel vim did the
right thing with the "if they have a vimrc, don't source defaults.vim".
As detailed at that ticket, I believe the best solution is for
FreeBSD to not have a system vimrc that sources defaults.vim
unconditionally, but rather to have their ports process patch the
defaults.vim to contain the couple extra helper bits they want.

-tim




--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/YvUBhOIug2iSmAMa%40thechases.com.

Re: New version of vim unsolicitedly sourcing defaults.vim?

On Tue, Aug 9, 2022 at 7:54 PM Tim Chase <vim@tim.thechases.com> wrote:
>
> I upgraded packages on my FreeBSD box yesterday and noticed that
> vimrc behavior had changed.
>
> Prior to the upgrade, if I had a ~/.vimrc it wouldn't source the
> defaults.vim file.
>
> :help VIMINIT
>
> > The first that exists is used, the others are ignored.
>
> and it proceeds to list .vimrc (which I have) and, later down,
> defaults.vim (which should be ignored because I have a .vimrc)
>
> However, 'scrolloff' and 'mouse' are now annoyingly getting set
> (along with other defaults.vim tweaks):
>
> :verbose set scrolloff? mouse?
> mouse=nvi
> Last set from /usr/local/share/vim/vim90/defaults.vim line 85
> scrolloff=5
> Last set from /usr/local/share/vim/vim90/defaults.vim line 51
>
> According to tracing startup:
>
> :scriptnames
> 1: /usr/local/etc/vim/vimrc
> 2: /usr/local/share/vim/vim90/defaults.vim
> 3: /usr/local/share/vim/vim90/filetype.vim
> 4: /usr/local/share/vim/vim90/ftplugin.vim
> 5: /usr/local/share/vim/vim90/indent.vim
> 6: /usr/local/share/vim/vim90/syntax/syntax.vim
> 7: /usr/local/share/vim/vim90/syntax/synload.vim
> 8: /usr/local/share/vim/vim90/syntax/syncolor.vim
> 9: /usr/local/share/vim/vim90/colors/lists/default.vim
> 10: /usr/local/share/vim/vim90/syntax/nosyntax.vim
> 11: ~/.vimrc
> [snip]
>
> it's the /usr/local/etc/vim/vimrc causing the issue.
>
> Is this a FreeBSD package customization problem (and I should go
> grumble to the FreeBSD package maintainer(s)), or did the default
> system vimrc start ignoring the description in `:help VIMINIT`, and
> force defaults.vim on those of us who detest it (in which case,
> please revert this)?
>
> -Tim

Yes, it's your distro admins giving you what they think is good for
you. That's the problem with Vim executables built by distro
maintainers: they often come with a "system vimrc" doing undesired
things. If you compile your own Vim with default directory settings,
it will look for a system vimrc at /usr/local/share/vim/vimrc, find
none, and happily proceed with your ~/.vimrc (which, in my own-built
Vim, comes at the very top of the :scriptnames). What I do near (but
not at) the top of my ~/.vimrc is source the
$VIMRUNTIME/vimrc_example.vim (which, in recent versions of Vim,
sources the defaults.vim) and then undo whatever it sets that I don't
like (e.g. I have a line "filetype indent off" to counteract the
"indent" part of its "filetype plugin indent on").

Best regards,
Tony.

--
--
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/CAJkCKXsbssjSJ%2BbJnZXEx0-hL1VhoadBZV3NgrJg2skzf0yiUg%40mail.gmail.com.

Re: vim9 exported functions not recognized by ctags

Thank you a lot Amazing Man LifePillar , 

  • Migh take account on the possibility of extended that ctags : Mine version on windows 10 is :  Universal Ctags 5.9.0(80ee839), Copyright (C) 2015-2022 Universal Ctags Team
            Version of Universal Ctags 5.9.0  is a little out of date don't you think ?
  • ctags --list-kinds=vim done and receive as you same values:
a  autocommand groups
c  user-defined commands
f  function definitions
m  maps
v  variable definitions
n  vimball filename
C  constant definitions


  • after extending :
somewhereOvertherainbow\Vim\vim90>ctags --list-kinds=vim
a  autocommand groups
c  user-defined commands
f  function definitions
m  maps
v  variable definitions
n  vimball filename
C  constant definitions
e  Vim 9 exported defs
g  Vim 9 global variables
K  Vim 9 constants

  • The only point that disturbs me is to have to create that :    ~/.ctags.d/vim.ctags        coupled to  OS-usersession. Because I use only standalone and portable own Vim distro that can be replicated on several machines.
So I put it in somewhereOvertherainbow\Vim\vim90\.ctags.d


But it seems to not runnning well : does not displays vim9 exported functions

Capture.PNG



Thank for help
Nicolas




Le jeudi 11 août 2022 à 09:03:07 UTC+2, Lifepillar a écrit :
On 2022-08-10, Lifepillar <lifep...@lifepillar.me> wrote:
> On 2022-08-10, N V <niva...@gmail.com> wrote:
>> Hi,
>>
>> Exported functions in New vim9 are not found by exubérant ctags, universal
>> ctags and not displayed by tagbar plugin
>> https://github.com/preservim/tagbar
>>
>> Is there a work around.

I'd like to elaborate a bit more on my previous reply, as I had just
played a bit more with the issue. In the following, "Ctags" means
Universal Ctags, because that is what I am using.

Ctags supports Vim out of the box. You may check which entities are
supported with `ctags --list-kinds=vim` from the command-line. That
currently gives me:

a autocommand groups
c user-defined commands
f function definitions
m maps
v variable definitions
n vimball filename
C constant definitions

Each "kind" (i.e., entity) is identified by a letter, and has a name
(not shown) and description. You may extend Ctags support for Vim by
creating a ~/.ctags.d/vim.ctags configuration file. In that file, you
define new "kinds" and corresponding regexes to recognize them. Each new
kind is also identified by a letter: be careful not to use the already
defined letters!

My current ~/.ctags.d/vim.ctags looks as follows:

--kinddef-vim=e,export,Vim 9 exported defs
--kinddef-vim=g,global,Vim 9 global variables
--kinddef-vim=K,const,Vim 9 constants
--regex-vim=/^\s*export\s+def\s+([^(]+)/\1/e,export/
--regex-vim=/^(\s*export\s+)?const\s+(\w+)/\2/K,const/
--regex-vim=/^(\s*export\s+)?final\s+(\w+)/\2/K,const/

The value of --kinddef is a triple <letter>,<name>,<description>. Each
regex item has three parts /A/B/C/:

- A is the pattern that recognizes an entity;
- B is the value that should be returned for that entity (what Tagbar
will display);
- C is the identifier of the entity, as defined in --kinddef.

So, the logic is: "if a line matches A, return the value B of kind C".

You may check that your configuration is correct by running `ctags
--list-kinds=vim` again. With the configuration file in place, you
should get:

a autocommand groups
c user-defined commands
f function definitions
m maps
v variable definitions
n vimball filename
C constant definitions
e Vim 9 exported defs
g Vim 9 global variables
K Vim 9 constants

Now, you need to configure Tagbar. Create
`~/.vim/after/ftplugin/vim.vim` and execute:

:TagbarGetTypeConfig vim

This will paste into the buffer Tagbar's current configuration, which
should look like this:

let g:tagbar_type_vim = {
\ 'kinds' : [
\ 'n:vimball filenames',
\ 'v:variables:1:0',
\ 'f:functions',
\ 'a:autocommand groups:1',
\ 'c:commands:0:0',
\ 'm:maps:1:0',
\ ],
\ }

Now, it's a matter of adding the new kinds, possibly removing those that
you don't need, and reordering the items the way you want them
displayed. I like to use vim9script, so my current script looks as
follows:

vim9script

if !exists('g:tagbar_type_vim')
g:tagbar_type_vim = {
'kinds': [
'e:exported defs',
'f:functions',
'v:variables:1:0',
'g:global variables',
'K:constants',
'c:commands:0:0',
'a:autocommand groups:1',
'm:maps:1:0',
],
}
endif

That's it! You may need to restart Vim for the changes to take effect.

You will notice that def's parameters are not shown for exported defs,
and that is intentional, because I don't find them useful. But you may
of course adapt Ctags's regexps to include those, and in general to fit
your taste.

Hope this helps,
Life.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/7bc94b73-39ac-4ee7-a0e6-a12e65cc1368n%40googlegroups.com.