Skip to main content

Questions tagged [vim9script]

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

5 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5 votes
0 answers
237 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 ...
Enlico's user avatar
  • 2,194
1 vote
1 answer
51 views

Vim9 lambda function destructuring a list in arguments?

I tried to destructure a list in a lambda function, like this: var matched = reduce( mapnew(lines, (_, x) => [strpart(x, 0, 1), strpart(x, 2, 1)]), (acc, [a, b]) => acc && a == &...
Anopt's user avatar
  • 11
0 votes
2 answers
85 views

How to re-open the same window with the same buffer therein?

Consider the following snippet: vim9script # Set stuff in the newly created window var my_win_nr = winnr('$') var my_win_id = win_getid(my_win_nr) win_execute(my_win_id, 'wincmd L') win_execute(...
Barzi2001's user avatar
  • 550
0 votes
0 answers
70 views

Plugin function scope issue

I have recently discovered this guide that was very eye opener under many aspects. So I decided to do things "by the book" by moving my plugins in ~/.vim/pack/bundle/start/myplugin/plugin/...
Barzi2001's user avatar
  • 550
0 votes
2 answers
88 views

How can I define a buffer-local variable in a FileType autocommand using vim9script?

I am trying to define a buffer variable based on the FileType as it follows: vim9script def g:MyComment(comment_symbol: string) # Do something enddef augroup commenting_blocks_of_code ...
Barzi2001's user avatar
  • 550