Re: error list

2020-05-22 Thread Lifepillar
On 2020-05-22, Joseph wrote: > Is there an easy way to dump the error list to the current vim > buffer/window? > > Actually, is there a general way to do this for other commands too? I use this code, which you may adapt to your needs: " Send the output of a Vim command to a new scratch buffe

Status of sound support in Vim

2020-07-05 Thread Lifepillar
What is the status of +sound in Vim? In particular, is anyone working on adding support for macOS? The manual has examples mentioning Ubuntu, so I infer that Ubuntu should be supported, but I cannot get any sound. I have tried with .wav, .oga and .ogg files, so I don't think it's a format issue. A

Re: Status of sound support in Vim

2020-07-05 Thread Lifepillar
On 2020-07-05, Bram Moolenaar wrote: > > Dominique wrote: > >> Lifepillar wrote: >> >> > What is the status of +sound in Vim? In particular, is anyone working on >> > adding support for macOS? >> > >> > The manual has examples mentionin

Re: Status of sound support in Vim

2020-07-06 Thread Lifepillar
On 2020-07-05, Lifepillar wrote: > On 2020-07-05, Bram Moolenaar wrote: >> >> Dominique wrote: >> >>> Lifepillar wrote: >>> >>> > What is the status of +sound in Vim? In particular, is anyone working on >>> > adding support for mac

Re: Status of sound support in Vim

2020-07-06 Thread Lifepillar
On 2020-07-06, rwmit...@gmail.com wrote: > > > On Monday, July 6, 2020 at 4:05:41 AM UTC-4 Lifepillar wrote: > >> On 2020-07-05, Lifepillar wrote: >> >> >>> Lifepillar wrote: >> >>> >> >>> > What is the status of +sound in

Retrieve synID of highlight group by name

2020-07-11 Thread Lifepillar
Is there an efficient way to get the syntax ID given the name of a highlight group? I.e., the inverse of synIDattr(id, 'name') 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 informatio

errorformat for LaTeX

2020-07-16 Thread Lifepillar
The log of a typeset LaTeX document of mine has the following warning: LaTeX Warning: Reference `sec:encryption' on page 1 undefined on input line 113 6 (In case the formatting changes when sending, the above message is all on a single line, except for the last digit of the line number, which is

Re: How can I find where one word is close to another word?

2020-07-26 Thread Lifepillar
On 2020-07-25, Adrian Keister wrote: > > > As most people on this forum are likely aware, searching for a word is > straight-forward enough. If I want to find occurrences of the word 'arc', I > can type / arc , with spaces around the three letters, to find basic > occurrences of the word (ignoring

Handling v:count in popup filters

2020-09-03 Thread Lifepillar
How do you handle counts with a popup menu filter? Something like this almost works: let s:n = 0 fun MyFilter(winid, key) if a:key == '+' let s:n += v:count1 call popup_settext(a:winid, printf('Value: %d', s:n)) return 1 endif return 0 endf

How to get SpellBad highlighting under the cursor?

2020-09-07 Thread Lifepillar
Is there a way in Vim Script to get the highlighting under the cursor when it is SpellBad or similar group? For instance, after: :new :set ft=c :set spell i// Whaat? I would like to determine that "Whaat" is highlighted with SpellBad. I have tried with synIDattr(), but it always

Re: [vim colours + iTerm2 colours]

2020-09-23 Thread Lifepillar
On 2020-09-22, Maxim Abalenkov wrote: > Dear all, > > How are you? Potentially, I have another very simple question for you, > vim experts. My usual working environment is Vim running in an iTerm2 > session. I tend to use both vim colours and iTerm2 colour scheme. If > I understand correctly, the

Re: [vim colours + iTerm2 colours]

2020-09-24 Thread Lifepillar
On 2020-09-23, Maxim Abalenkov wrote: > Thank you for your reply. I will check. I'm not certain about the "gui" > part of the command. I'm not using Gvim. The termguicolors option is specifically for terminals supporting millions of colors, such as iTerm2. It tells Vim to use the "gui" color spec

Re: [vim colours + iTerm2 colours]

2020-09-24 Thread Lifepillar
On 2020-09-23, 'Grant Taylor' via vim_use wrote: > On 9/22/20 7:33 AM, Maxim Abalenkov wrote: >> I tend to use both vim colours and iTerm2 colour scheme. If I understand >> correctly, the resulting colours that I see are a mixture of both Vim >> and iTerm2 colour profiles superimposed. Therefore,

Re: [vim colours + iTerm2 colours]

2020-09-24 Thread Lifepillar
On 2020-09-24, Maxim Abalenkov wrote: > > Thank you very much for your thorough explanations! Now we are very > close to the solution. My end goal is the opposite. I would like to > _disable_ iTerm2 colours, when I use Vim. I would like to use _pure_ > Vim colour scheme, without the interference o

Lambdas and "typedefs" in Vim9

2020-09-27 Thread Lifepillar
I have not followed the development of Vim9 script closely, but yesterday I have started to play with it. I was pleasantly surprised to see how far it's got already: I could convert some scripts of mine without much effort and make them run just fine! I have two questions/curiosities: 1. I was no

Re: Lambdas and "typedefs" in Vim9

2020-09-27 Thread Lifepillar
On 2020-09-27, Bram Moolenaar wrote: >> I have two questions/curiosities: >> >> 1. I was not able to pass lambdas to defs, only funcrefs. Can/will this >>be supported? > > Can you give an example of what does not work? This is what I have tried: vim9script def Filter(l: list, Cond:

Re: Lambdas and "typedefs" in Vim9

2020-09-27 Thread Lifepillar
On 2020-09-27, Bram Moolenaar wrote: > >> Filter(x, { v -> v =~ '^b' }) >> # E1013 > > Well, in a sense that is correct. The Filter() functions accepts a > function reference with a specific type, and what is passed in is a > function reference without any known type. Ok, that might be e

How to grep #tag?

2020-10-10 Thread Lifepillar
How can I grep text with a special symbol, such as #? I would like to search a bunch of files containing various #tags, but if I try from the command line: :grep #sometag that does not work. Escaping the hash causes grep to exit with an error: :grep \#sometag Any idea? Thanks, Life.

Re: How to grep #tag?

2020-10-11 Thread Lifepillar
On 2020-10-11, Shlomi Fish wrote: > On Sat, 10 Oct 2020 21:09:26 - (UTC) > Lifepillar wrote: > >> How can I grep text with a special symbol, such as #? > > Either: > > :grep \\#p > > Or: > > :grep '\#p' > > Seem to work h

Re: How to grep #tag?

2020-10-11 Thread Lifepillar
On 2020-10-11, @lbutlr wrote: > On 11 Oct 2020, at 06:22, Bram Moolenaar wrote: >> You can use any special character to surround the pattern, it's a lot >> easier than escaping. I often use ":grep /pattern/ *", unless the >> pattern contains a slash. > As soon as I learned you could use any del

Re: syntax highlighting legend

2021-02-20 Thread Lifepillar
On 2021-02-15, Matthew Pritchard wrote: > Hello I am wondering what is the color code for the different colors vim > displays. I am also assuming that these colors can be customized. How do I > do this? I'd recommend to start with: :help coloring In particular, some conventional names are l

Re: mapping :W to :w...

2021-02-24 Thread Lifepillar
>>On 02/23 11:11, Salman Halim wrote: >> I actually prefer to never hit shift, so map ; to : instead. >> >On 2021-02-24, tu...@posteo.de wrote: > Hi Salman, > > oh! :) > > The first is genious Keep in mind that ; is a useful mapping in Vim. Sure, you can remap it to :, but, in my experience, in t

Vim9: call function from variadic function?

2021-02-28 Thread Lifepillar
This might be a bit of a stretch, but... is it possible to "expand/split" variable arguments to call another function with fixed arguments? I would like to define a function that takes as input another function F and some values v1, vn... , and applies F to v1, ..., vn. For example, I can define:

Re: Vim9: call function from variadic function?

2021-03-01 Thread Lifepillar
On 2021-03-01, Bram Moolenaar wrote: > > Stan Brown wrote: > >> :h curly-braces-names Thanks, I didn't know about that feature. > Note that in Vim9 script curly-braces are not supported. They have > always been a bit problematic, and compiling an expression with > curly-braces is not possible,

Re: Vim9: call function from variadic function?

2021-03-01 Thread Lifepillar
On 2021-03-01, Bram Moolenaar wrote: > > >> This might be a bit of a stretch, but... is it possible to >> "expand/split" variable arguments to call another function with fixed >> arguments? I would like to define a function that takes as input another >> function F and some values v1, vn... , and

Help with indenting code

2021-03-10 Thread Lifepillar
I would like to indent code structured as follows: if X then ( if Y then ( ... ) ) else ... To make Python look like a language that is easy to indent, this language has `if... then... [else]` blocks without `endif`. I get can get

Vim9: E1096 Returning a value in a function without return type

2021-05-08 Thread Lifepillar
I am getting the error in the subject in a script I am writing. I have found that the culprit is the use of statements in a lambda. This is a minimal example showing the problem: vim9script def Bind(x: number): func(string): any return (s) => x enddef def Bind2(x: number):

Re: Vim9: E1096 Returning a value in a function without return type

2021-05-08 Thread Lifepillar
On 2021-05-08, Bram Moolenaar wrote: > > Christian wrote: > >> I am getting the error in the subject in a script I am writing. I have >> found that the culprit is the use of statements in a lambda. >> >> This is a minimal example showing the problem: >> >> vim9script >> >> def Bind(x: numb

Plans (if any) for Vim9 runtime scripts?

2021-05-29 Thread Lifepillar
What is the vision for future runtime scripts? Is there a plan to move everything to Vim9—including, say, syntax scripts? What is your recommendation to contributors? Is it too early to translate runtime scripts to Vim9? Is it better to stick with the current Vim Script for the time being? I'd li

Vim9: how to invoke callback with additional arguments?

2021-05-30 Thread Lifepillar
I am trying to understand how to invoke a callback in Vim9 script. I have started from this example (from the excellent lacygoill's wiki): vim9script def Callback(_j: job, _e: number) echom 'callback' enddef def Func() job_start(['/bin/bash', '-c', ':'], {exit_cb:

Re: Vim9: how to invoke callback with additional arguments?

2021-05-31 Thread Lifepillar
>> What is Vim9's equivalent of the following? >> >> fun Callback(value, _j, _e) >> echom 'callback with value: ' .. a:value >> endf >> >> fun Func() >> call job_start(['/bin/bash', '-c', ':'], >> \ {'exit_cb': function('Callback', [42])}) >> endf >> >> c

Translating complete functions to Vim9

2021-06-19 Thread Lifepillar
Is there a way to turn a completion function (:h complete-functions) into Vim9 script? The issue is that such functions are called twice, and they are expected to return values of different types in each call. Thanks, Life. -- -- You received this message from the "vim_use" maillist. Do not to

Search for pattern in the first few lines of a buffer

2021-06-20 Thread Lifepillar
I need to programmatically search for a pattern in the first ten lines of a given buffer, and save the match in a variable when found. Say, the pattern is: % KEY = value I need to extract the value if the above appears in the first lines of the buffer. Of course, the state of the buffer's win

Re: Search for pattern in the first few lines of a buffer

2021-06-21 Thread Lifepillar
On 2021-06-21, Yegappan Lakshmanan wrote: > Hi, > > On Sun, Jun 20, 2021 at 3:59 AM Lifepillar wrote: >> >> I need to programmatically search for a pattern in the first ten lines >> of a given buffer, and save the match in a variable when found. Say, the >> pa

syntaxcomplete#Complete() and nested filetypes

2021-06-21 Thread Lifepillar
I would like to use syntaxcomplete#Complete() in a filetype that includes a nested filetype. The only way I have found so far is to define my own completion function that checks whether the current position is within the nested filetype, then calls OmniSyntaxList() with the appropriate regular expr

Re: syntaxcomplete#Complete() and nested filetypes

2021-06-21 Thread Lifepillar
On 2021-06-21, Lifepillar wrote: > I would like to use syntaxcomplete#Complete() in a filetype that > includes a nested filetype. This is what I have so far, which appears to be working in filetype `foobar` with nested filetype `xyz`: def foobarcomplete#Complete(findstart: number

Re: syntaxcomplete#Complete() and nested filetypes

2021-06-22 Thread Lifepillar
On 2021-06-22, David Fishburn wrote: > Life, > > I am not sure I quite understand your use case for the plugin. Thanks for the feedback. My goal is to have some sort of context-sensitive completion. My use case is ConTeXt, which can include MetaPost blocks: \starttext TeX code here: fi

Help converting function to Vim9 script

2021-07-04 Thread Lifepillar
The MetaPost plugin in Vim contains the following definition to replace the n-th occurrence of `beginfig(...)` with `beginfig(n)`: function! s:fix_beginfigs() let i = 1 g/^beginfig(\d*);$/s//\='beginfig('.i.');'/ | let i = i + 1 endfunction command -nargs=0 FixBeginfigs ca

Re: Help converting function to Vim9 script

2021-07-08 Thread Lifepillar
On 2021-07-07, lgc wrote: >> Any idea what would be the best way to convert the snippet above? > > Move the `i` variable in the script-local namespace. Thanks for the thorough explanation. For now, I am keeping a function instead of a def. But, as you say: > FWIW, I would still refactor the code

Statusline's minwidth not respected?

2021-08-02 Thread Lifepillar
Vim gurus, if I set the statusline as follows: set statusline=X%1MX the % item does not occupy any space if the buffer is unmodified, despite the minimum width of one character. Is that expected behaviour? What I would expect is what I get with: set statusline=X%1(%M%)X Thanks, Life.

[vim9script] Why is a forward declaration needed?

2021-08-19 Thread Lifepillar
Hi, I have tried to port this TypeScript script: https://github.com/sigma-engineering/blog-combinators/blob/master/index.ts to Vim9 script (please find the full code at the end of this message). It appears to work, but to make it work I had to add a "forward declaration" of the Call() functio

Re: [vim9script] Why is a forward declaration needed?

2021-08-19 Thread Lifepillar
On 2021-08-19, Bram Moolenaar wrote: > You are using "Call" in Expr(), and Expr is used in an expression > to set "TrailingArg". To be able to check the type there, Expr() is > compiled, which requires "Call" to exist. Got it. > NumberLiteral is defined just before setting "TrailingArg". Too s

How to replace pattern with shell command's output using matched pattern

2021-09-04 Thread Lifepillar
Use case at hand: replace Unix timestamps with date/time in a log file: [1630720618] unbound[63495:0] info: 127.0.0.1 foo.bar.com IN [1630720618] unbound[63495:1] info: 127.0.0.1 foo.bar.com A IN ... The shell command I'd apply is `date -r `. How would you perform the substitution? The desi

Re: How to replace pattern with shell command's output using matched pattern

2021-09-04 Thread Lifepillar
On 2021-09-04, rwmit...@gmail.com wrote: > I'm just curious, is the file being otherwise edited in vim? I usually > just use less to view logs, in which case, a command line filter would be > more efficient (for me). Thanks that's a good suggestion in general. In this case, yes, I am going to pe

Re: New User Several Questions and Concerns

2021-09-17 Thread Lifepillar
On 2021-09-17, Bernard wrote: > I assumed each tab would be identified w/ a number Yes, that is the case. If you want the number to show up in the tab label, you may customize the tab line. See `:help setting-tabline`. > so one can merely type something like ":gototab3" :3tabnext (See `:help :

Re: goyo plugin and artifacts in TTY

2021-10-30 Thread Lifepillar
On 2021-10-30, meine wrote: > When starting Goyo, artifacts of the previous screen-wide display of the > text stay. Scrolling though the text doesn't remove them (as opposed to > Goyo in a GUI, where resizing the window removes the artifacts). I do not have a solution, but I use Goyo and I cannot

Re: Vim9 script feature-complete

2022-01-03 Thread Lifepillar
["Followup-To:" header set to gmane.editors.vim.] On 2021-12-30, Bram Moolenaar wrote: > The work on Vim9 script is coming to a point where the syntax and > semantics are practially done. There might be some more tests > uncovering problems that need to be fixed and perhaps some tiny tweaks, > bu

Re: Vim9 import [was Vim9 script feature-complete]

2022-01-03 Thread Lifepillar
On 2022-01-03, Marvin Renich wrote: > Don't bother with the > import MyClass from "myclass.vim" > import {someValue, MyClass} from "thatscript.vim" > > syntax, and only provide > > import "myclass.vim" > import "myclass.vim" as Other > > and require use of the namespace prefix: > > Othe

Re: [VIM] Re: Persistent undo and swapfile

2022-01-03 Thread Lifepillar
On 2022-01-03, Walter Cazzola wrote: > Out of curiosity: which plugin are you using for the persistent undo. Do you mean, to navigate the (not necessarily persistent) undo history? I use undotree (https://github.com/mbbill/undotree). I prefer it over other choices mainly because it is pure Vim sc

Re: [VIM] Re: [VIM] Re: Persistent undo and swapfile

2022-01-03 Thread Lifepillar
On 2022-01-03, Manfred Lotz wrote: > Another point might be interesting. In the undo directory there are > undo files where the real files don't exist any longer. Not sure if > there is some cleanup procedure avalaible. I use this command to remove undo files that haven't changed in a long time:

Re: [VIM] Re: [VIM] Re: Persistent undo and swapfile

2022-01-03 Thread Lifepillar
On 2022-01-03, Walter Cazzola wrote: > On Mon, 3 Jan 2022, Lifepillar wrote: > >> On 2022-01-03, Walter Cazzola wrote: >>> Out of curiosity: which plugin are you using for the persistent undo. >> >> Do you mean, to navigate the (not necessarily persistent) undo

Re: Vim9 import [was Vim9 script feature-complete]

2022-01-05 Thread Lifepillar
On 2022-01-04, Marvin Renich wrote: > * Bram Moolenaar [220104 12:26]: >> While using: >> >> import "thatscript.vim" >> >> Or: >> >> import "thatscript.vim" as that >> >> Is nice and short, no need for "from". The help for ":import" becomes >> much shorter. The implementation will als

Re: vim/colorschemes: Request For Comments

2022-02-13 Thread Lifepillar
On 2022-02-12, Romain Lafourcade wrote: > thanks to the hard work of a small but motivated team, a > first milestone is finally within reach As a mostly passive observer of the development of this project, I feel compelled to thank you for undertaking this time-consuming task with invincible pass

Re: Dictionary Completion of Capitalized Words

2022-03-05 Thread Lifepillar
On 2022-03-04, Gary Johnson wrote: > On 2022-03-04, Bram Moolenaar wrote: >> Gary Johnson wrote: >> >> > Typing part of a word, then using Ctrl-X Ctrl-K to complete the word >> > from entries in a dictionary works fine as long as the word (not >> > a proper noun) is all lower case. But when a wo

Re: New User -- regex question(s) ...

2022-03-13 Thread Lifepillar
On 2022-03-09, LOSS PREVENTION <980beadvi...@gmail.com> wrote: > I have read, both http://www.vimregex.com/ -and- various sections of > http://vimdoc.sourceforge.net/htmldoc/help.html. That said, I just can't > figure out what I'm doing incorrectly. Please follow the live examples > below: > > 1)

Avoid jumping cursor after undo

2022-03-14 Thread Lifepillar
I have defined this function: fun! Lint() let l:view = winsaveview() keepjumps normal gggqG call winrestview(l:view) endf When the function is executed, the cursor does not move, as expected. Unfortunately, pressing u after that makes the cursor jump to the top of the buffer. I had hoped th

Re: Avoid jumping cursor after undo

2022-03-16 Thread Lifepillar
On 2022-03-14, Lifepillar wrote: > I have defined this function: > > fun! Lint() > let l:view = winsaveview() > keepjumps normal gggqG > call winrestview(l:view) > endf > > When the function is executed, the cursor does not move, as expected. > Unfortunately, p

Re: Large file - Opening n head lines

2022-03-17 Thread Lifepillar
On 2022-03-17, Ni Va wrote: > Is it possible to open a Large File Vim but just only few beginning lines > of it, edit one of these 50 first lines and then save and quit ? I don't think that is possible with Vim without the help of some pre/post-processing tool, but... Vim can edit pretty large fi

Should Darkyellow, Lightmagenta, Lightred be defined in colors/lists/default.vim?

2022-03-20 Thread Lifepillar
highlight.c (and, formerly, syntax.c) mention the three colors in the subject. Curiously, they are not defined in colors/lists/default.vim. Is that an oversight or is it intentional? I ask because, AFAICS, all the other colors are defined in default.vim. Thanks, Life. -- -- You received this m

Re: Should Darkyellow, Lightmagenta, Lightred be defined in colors/lists/default.vim?

2022-03-20 Thread Lifepillar
On 2022-03-20, Lifepillar wrote: > highlight.c (and, formerly, syntax.c) mention the three colors in the > subject. Curiously, they are not defined in colors/lists/default.vim. Is > that an oversight or is it intentional? Aargh, I was looking at syntax.c in an older Vim source. I se

%f item in getqflist()

2022-04-25 Thread Lifepillar
I am looking into parsing a list of strings with an errorformat to create a quicklist or location list out of it. Currently, I am doing it as follows: let efm = "%f:%l:%m" let what = getqflist({"lines": ["foo:3:bar"], "efm": efm}) call setloclist(0, what.items) echo what.items[0]

Re: %f item in getqflist()

2022-04-25 Thread Lifepillar
On 2022-04-25, Lifepillar wrote: > I am looking into parsing a list of strings with an errorformat to > create a quicklist or location list out of it. Currently, I am doing it > as follows: > > let efm = "%f:%l:%m" > let what = getqflist({"lines":

Inserting on alternate lines?

2022-06-02 Thread Lifepillar
This morning I made a vertical selection with CTRL-V and typed (too) quickly to prepend a quote to the selected lines. I got something like this: "... ... "... ... "... ... For the life of me (pun intended), I cannot do it again. How is it possible to insert text on altern

Re: Inserting on alternate lines?

2022-06-02 Thread Lifepillar
On 2022-06-02, Tim Chase wrote: > On 2022-06-02 11:58, Lifepillar wrote: >> This morning I made a vertical selection with CTRL-V and typed (too) >> quickly to prepend a quote to the selected lines. I got somethi

Setting termcap entries: avoid literal Esc?

2022-08-08 Thread Lifepillar
In my vimrc I have entries such as these: set =^[f set =^[h where ^[ is a literal Esc. Is it possible to perform such assignments without using a literal Esc? For other entries I am able to use the & form (say, &t_BE = "\033[?2004h"). I am asking specifically about entries like the above,

Re: Setting termcap entries: avoid literal Esc?

2022-08-08 Thread Lifepillar
Thank you both! I hadn't thought about using execute. 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 a

Re: vim9 exported functions not recognized by ctags

2022-08-10 Thread Lifepillar
On 2022-08-10, N V 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 have the same problem. I think that this will be eventually solved upstream

Use Vim 9 script function for indentexpr?

2022-08-10 Thread Lifepillar
The following silly indent works as expected (of course): function! FooIndent() return indent(v:lnum - 1) + 2 endfunction setlocal indentexpr=FooIndent() However, a Vim 9 script function does not seem to be called: vim9script def BarIndent() echomsg "BarIndent c

Re: vim9 exported functions not recognized by ctags

2022-08-11 Thread Lifepillar
On 2022-08-10, Lifepillar wrote: > On 2022-08-10, N V 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 w

Re: vim9 exported functions not recognized by ctags

2022-08-11 Thread Lifepillar
Aah, the line for global vars got cut off the Ctags config: --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*(g:\w+)\b/\1/g,global

Re: Use Vim 9 script function for indentexpr?

2022-08-11 Thread Lifepillar
On 2022-08-10, Lifepillar wrote: > However, a Vim 9 script function does not seem to be called: > > vim9script > > def BarIndent() > echomsg "BarIndent called" > return indent(v:lnum - 1) + 4 > enddef > > setlocal indentexpr=B

Re: vim9 exported functions not recognized by ctags

2022-08-11 Thread Lifepillar
On 2022-08-11, N V 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-sp

Build Vim without +vim9script

2022-08-11 Thread Lifepillar
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,

Re: Build Vim without +vim9script

2022-08-11 Thread Lifepillar
On 2022-08-11, Bram Moolenaar wrote: > >> 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 a

[vim9script] Behavior of has_key()

2022-08-17 Thread Lifepillar
The help entry for has_key() says that the key must be a string. In legacy Vim script, however, this works fine: let dd = {42: '42', v:true: 'T', 3.14: '3.14'} echo dd->has_key(42) echo dd->has_key(v:true) echo dd->has_key(3.14) In Vim 9 script, the behavior is different: vi

Bugs in visual mode marks?

2022-09-27 Thread Lifepillar
Has something changed recently in the way Visual mode marks are handled? I have a couple of functions using '<, '> and the like and they have started misbehaving recently. Today, I checked the value of getpos("'>") after selecting some text, and got: [0, 15, 2147483647, 0] This using Vim 9.0.

Re: Bugs in visual mode marks?

2022-09-27 Thread Lifepillar
On 2022-09-27, Lifepillar wrote: > Today, I checked the value of getpos("'>") after selecting some text, > and got: > > [0, 15, 2147483647, 0] Now I have seen that the large number is expected. I will try to make a reproducible example of my issue. Life. --

Re: Bugs in visual mode marks?

2022-09-27 Thread Lifepillar
Source this script: vim9script def g:Select(): list const lnum1 = getpos("'<")[1] const lnum2 = getpos("'>")[1] return getline(lnum1, lnum2) enddef vnoremap x echo Select() Then select some line(s) and type \x. What I would expect (and what I think Vim used to

Re: Bugs in visual mode marks?

2022-09-27 Thread Lifepillar
On 2022-09-27, M wrote: > You're using cmd token that doesn't switch the modes. The effect is that as > long as you're in visual mode the < and > marks are not updated. This is > the way how it works and always worked. Aha, that's it! In fact, I have switched to use when I have migrated to Vim 9

Play sound on search wrap

2022-10-06 Thread Lifepillar
When performing a search, it's easy for me to miss the "search hit BOTTOM, continuing at TOP" message because my attention is focused on the matches. For this reason, I'd like a sound of my choice to be played when the search wraps (using +sound). Is this possible? Thanks, Life. -- -- You recei

Re: Play sound on search wrap

2022-10-07 Thread Lifepillar
On 2022-10-06, Arun wrote: > You could try a hack by calling a function that checks for v:warningmsg and > reset it, in a "statusline" invoked function. Something like: > > --- > fu! CheckWrap() > if v:warningmsg =~# "^search hit [BT]" > "Ring bell > exe "norm! \" > endif >

Re: Is there a way to open the ":terminal" in the bottom pane instead of the top pane ?

2022-10-10 Thread Lifepillar
On 2022-10-10, Eric Marceau wrote: > I would like to open the terminal in the bottom pane, rather than the > top pane. > > Is there an option that could be specified to allow me to control that? If you are ok with the bottom window always getting the focus on every split (not only for terminal wi

Re: vim9 autoload script modified : How to reload it On-The-Fly

2023-01-11 Thread Lifepillar
On 2023-01-11, N i c o l a s wrote: > Hi, > > Currently modifying an *autoload*/*vim9fooscript*.vim which can be started > by typing a nnoremap as this : > > >- *_vimrc* : > > import autoload './vimfiles/some/thing/*autoload*/*vim9fooscript* .vim' > as thatHelp > *nnoremap* inout thatHelp.E1

Re: vim9 autoload script modified : How to reload it On-The-Fly

2023-01-11 Thread Lifepillar
On 2023-01-11, N i c o l a s wrote: > > effectively, sourcing does not work sorry lifepillar: it echoes to me a > message E1091 Function HighCaller (below) is not compiled. > > And the calling tree is as this : > nnoremap *foo * Helper. *HighCaller* () -> > au

Re: vim9 autoload script modified : How to reload it On-The-Fly

2023-01-12 Thread Lifepillar
On 2023-01-11, N i c o l a s wrote: > Hum, thanks a lot Life, after one more check: > > *./vimfiles/plugged/foo-helper.vim/autoload/vim9fooscript.vim* > > vim9script > > *# some many defs func* > > export def *High_Caller*(): void >Sub_Called(4) > enddef > > def Sub_Called(code: number ): vo

[Vim 9 script] Is there a way to get the actual type of an object?

2023-01-15 Thread Lifepillar
Silly example: vim9script class Num this.n = 0 endclass class Even extends Num def new(this.n) if this.n % 2 == 1 throw 'Not even' endif enddef def IsPrime(): bool return this.n == 2 enddef endclass class O

Re: [Vim 9 script] Is there a way to get the actual type of an object?

2023-01-15 Thread Lifepillar
On 2023-01-15, Bram Moolenaar wrote: >> Is there a way to distinguish the class of the value returned by >> [a function]? > > Currently not. I have been wondering what would be the best way to > cover this. We already have type(), but this only returns the basic > type. For example for list and

Search undo history

2023-03-08 Thread Lifepillar
Is there a built-in way or a plugin to extend / to the undo history? Use case: working on some code, I deleted a function a few hours ago, and I wanted to reinstate it. Using :earlier/:later did the job, but required a bit of trial and error. Thanks, Life. -- -- You received this message from

Re: SQL quote sign syntax fail

2023-03-12 Thread Lifepillar
names (name) FROM stdin; > Thomas O'Malley > \. > > The quote is a legal character in that block and the color should not be > changed. > > After \. on a single line the color should go back to normal. AFAIK, the syntax is not standard SQL. PostgreSQL's dialect is suppor

[vim9script] Default value for object argument?

2023-03-12 Thread Lifepillar
How do you define a default value for a function argument whose type is a class? I have tried this: vim9script class X endclass def F(x: X = null_object) enddef F() But this results in: E1013: Argument 1: type mismatch, expected object but got object Maybe this is

[vim9script] Forward declarations for classes?

2023-03-26 Thread Lifepillar
Consider the following example: class Rgb this.r: float this.g: float this.b: float def ToHsv(): Hsv # ... enddef endclass class Hsv this.h: float this.s: float this.v: float def ToRgb(): Rgb # ... enddef

Re: [vim9script] Forward declarations for classes?

2023-03-26 Thread Lifepillar
On 2023-03-26, Bram Moolenaar wrote: > The second one should just work. Currently the class is only defined > when "endclass" is found. Doing it earlier is more implementation work, > but it should not require anything on the user side. > > For the first example I'm not sure what the best soluti

Re: The package you uploaded (vim-noweb.tgz) is empty

2023-06-02 Thread Lifepillar
On 2023-05-26, Edward McGuire wrote: > 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 am getting the same error, e.g.: vim-solarized8-1.5.0.tar.gz is empty, are you sure you specifie

Re: The package you uploaded (vim-noweb.tgz) is empty

2023-06-03 Thread Lifepillar
On 2023-06-02, Bram Moolenaar wrote: > You could try using another browser. I have tried with Safari, Brave, and LibreWolf (~Firefox) on macOS to no avail. I have taken care to disable ad blockers and, afaics, only cross-site cookies are blocked. Life. -- -- You received this message from th

[vim 9 script] String indexing behavior different from legacy Vim

2023-06-03 Thread Lifepillar
Legacy Vim script: let text = 'àbc' echo text[2] Result: 'b' Vim 9 script: const text = 'àbc' echo text[2] Result: 'c' Is the different behavior (counting chars vs bytes?) intentional? Thanks, Life. -- -- You received this message from the "vim_use" maillist. Do not top-

Re: [vim 9 script] String indexing behavior different from legacy Vim

2023-06-03 Thread Lifepillar
On 2023-06-03, Lifepillar wrote: > Legacy Vim script: > > let text = 'àbc' > echo text[2] > > Result: 'b' > > Vim 9 script: > > const text = 'àbc' > echo text[2] > > Result: 'c' > > Is the diff

Re: [vim 9 script] String indexing behavior different from legacy Vim

2023-06-03 Thread Lifepillar
On 2023-06-03, Lifepillar wrote: > On 2023-06-03, Lifepillar wrote: > Mmh, even strpart(), which is supposed to count bytes, gives the same > result: Forget this: strpart() is fine. I have trouble just with indexing. Life. -- -- You received this message from the "vim_use

Re: [vim 9 script] String indexing behavior different from legacy Vim

2023-06-03 Thread Lifepillar
On 2023-06-03, Bram Moolenaar wrote: > >> Legacy Vim script: >> >> let text = 'àbc' >> echo text[2] >> >> Result: 'b' >> >> Vim 9 script: >> >> const text = 'àbc' >> echo text[2] >> >> Result: 'c' >> >> Is the different behavior (counting chars vs bytes?) intentional? > > Yes, in V

Re: [vim 9 script] String indexing behavior different from legacy Vim

2023-06-03 Thread Lifepillar
On 2023-06-03, Lifepillar wrote: >> Yes, in Vim9 script the index is in characters. In legacy script it is >> in bytes. >> >> The help for this doesn't have it's own tag, I'll add one. >> You can find it above ":help vim9-gotchas". >

Re: vim9 Equivalence of __FILE__, __LINE__, and __FUNCTION__ usage in C++

2023-07-04 Thread Lifepillar
On 2023-07-04, Nicolas wrote: > Hi, > > Is there an equivalence in vim9 of __FILE__, __LINE__, and __FUNCTION__ > usage in C++ > The closest to __FILE__ is likely (`:help `). I use this snippet to get the path of the

<    1   2   3   >