Questions tagged [vim9script]
A new, compiled, and experimental version of the scripting language embedded into Vim.
44 questions
1 vote
1 answer
27 views
How to break a dict entry in vim9script into multiple lines?
I have the following block of code in my .vimrc: vim9script ... autocmd FileType tex { set spell set conceallevel=2 nnoremap <leader>o <esc>:VimtexTocOpen<cr> g:...
1 vote
2 answers
123 views
In a vim9script, is there a valid use of script variables with exists() function?
Looking at vim's help (i.e. :he exists()) it should be possible to use script variables. e.g. vim9script def Bar() echom "Bar called" enddef var script_variable: string if exists('...
2 votes
2 answers
109 views
Odd export behaviour when sourcing file multiple times
I created a file named test.vim containing code below. vim9script var a = 1 echo a export var b = 2 echo b I copy that file to these place: ~/Documents/test.vim ~/.vim/test.vim ~/.vim/pack/test.vim ...
1 vote
1 answer
102 views
How to specify the 'command' argument of win_execute() function in vim9script?
I am looking for the proper way to specify 'command' argument of the win_execute() function in vim9script. For example, the following script works fine as a legacy script: function CheckIndent(lnum) ...
1 vote
0 answers
97 views
Vim slow upwards scrolling in file with vim9script
If I open the file popup.vim in vim and go to the bottom with G, then scrolling upwards with k is extremely laggy. The problem only occurs if I hold down k, pressing it repeatedly it works fine. ...
0 votes
0 answers
56 views
Popup window on CmdLineEnter and CmdLineLeave
I'm trying to write some autocommands that 'syncs' the command line with a popup window so I can see the currently entered command without moving my eyes to the corner of the screen. It looks I should ...
1 vote
1 answer
89 views
How to use register contents with bang?
I am having trouble in using registers with bang. I am trying to make the following snippet to work: vim9script def WslYank() var text = shellescape(getreg('"')) exe $'!echo "{text}&...
2 votes
2 answers
418 views
How to load a function from a Vim9 script and call it?
If I save this simple script in a file: vim9script def Hi() echo "Hello" enddef And I try to load and run it: :so % :call Hi() I get: E117: Unknown function: Hi Can anyone explain? I ...