3
votes
How to add a third argument to a popup_menu() callback function?
I would use lambda function to dispatch:
vim9script
var my_fruit = ['banana', 'apple', 'orange']
var my_animals = ['dog', 'cat', 'snake']
def MyPopupCallback(type: string, id: number, idx: number)
...
2
votes
Accepted
How to add a third argument to a popup_menu() callback function?
You were on the right track, you basically need to use function() to create a partial. I modified your example code to come up with this:
vim9script
var my_fruit: list<string> = ['banana', '...
2
votes
Accepted
Multiple nesting in syntax highlighting
This one looks absolutely straightforward to me.
syn region level1 start=/header/ end=/trailer/ contains=level2,error1
syn match error1 /anything except trailer, empty space or {/ contained
syn region ...
1
vote
Multiple nesting in syntax highlighting
If I broke the EBNF down a bit further such that:
By focusing on the lowest, deepest grouping (block_2), we get
" Inside nest 2 "
hi link trailer2 Number
syn match trailer2 "trailer2&...
1
vote
syntax highlighting needs rejoining back to common regexes
I'll attempt a short answer here. Based on my experience, it seems you are trying to use classical parsing in a way that is not possible Vim's syntax engine. I would instead "embrace" the ...
1
vote
Do not delay mapped keys with common prefix
Here's a different approach taken from my config. In my approach, we use the SafeState autocommand rather than waiting for a timeout.
This works by immediately performing the mapped action, manually ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
vimscript × 1592vimrc × 262
key-bindings × 135
neovim × 125
functions × 115
regular-expression × 58
autocmd × 54
syntax-highlighting × 52
buffers × 41
command-line × 40
vim-windows × 39
search × 38
gvim × 37
variables × 36
visual-mode × 33
external-command × 26
plugin-system × 26
register × 26
terminal × 24
statusline × 24
autocompletion × 22
lua × 22
cursor-movement × 21
vimscript-python × 20
highlight × 19