Questions tagged [vim9script]

A new, compiled, and experimental version of the scripting language embedded into Vim.

Filter by
Sorted by
Tagged with
1 vote
1 answer
126 views

How to unlet a variable in Vim 9 script?

In Vim9 script :let cannot be used. An existing variable is assigned to without any command. The same for global, window, tab, buffer and Vim variables, because they are not really declared. Those ...
user avatar
  • 181
0 votes
1 answer
26 views

'Undefined variable' error: why?

vim9script set laststatus=2 set statusline= var separator = ' ' set statusline+=%{expand('%:p')} set statusline+=%{separator} set statusline+=%l:%v Error: Undefined variable: separator Why is ...
user avatar
4 votes
1 answer
95 views

How to learn vimscript along with vim9script?

I've finally made the decision to learn vimscript. I don't hate reading manual and really like the built-in help files, so I am starting with usr_41.txt and plan to read eval.txt afterwards. Now as I ...
user avatar
  • 51
2 votes
0 answers
68 views

Issue when moving Vim9script plugin's functions to autoload

I've read :help write-plugin to understand a bit more about how to write a plugin in Vim9script, but there aspects of that that puzzle me. Here's a very simplified, working version of the example ...
user avatar
  • 1,670
1 vote
1 answer
48 views

How can I write an out_cb handler in vim9script?

In §9 of :h channel is mentioned the legacy vimscript out_cb handler. let job = job_start(command, {"out_cb": "MyHandler"}) The function will be called with the channel and a ...
user avatar
2 votes
1 answer
353 views

How can I define vim9 functions and vim9 lambdas in a vim9 script?

In :help vim9 I read The Vim9 script syntax and semantics are used in: a function defined with the :def command a script file where the first command is vim9script an autocommand defined in the ...
user avatar
  • 1,670
0 votes
0 answers
25 views

String comparison using 'ignorecase' option in vim9 script

I am trying to port my legacy script to vim9. I found this in vim9 help: The 'ignorecase' option is not used for comparators that use strings. I am looking for a good workaround to use 'ignorecase' ...
user avatar
  • 246
7 votes
2 answers
1k views

Why is Vim9 mentioned at all in the doc of Vim 8?

Looking for lambda in the doc, I've found out (to my surprise) that they do exist in vimscript, and they use the syntax {args -> expr1}. But I've also discovered that there's Vim9, the doc of which ...
user avatar
  • 1,670
2 votes
1 answer
241 views

How do I work with vim9 and unicode?

I've found myself in a bit of an interesting situation. I'm writing a plugin in which I need to do a tiny bit of line parsing. Given a file: æøå It's easy to verify that col('.') returns 1, 3, and 5 ...
user avatar