vim9script iab if abbr#NotCtx('if') ? 'if' : 'if thenoendk_ela=abbr#Eatchar()' iab while abbr#NotCtx('while') ? 'while' : 'while dooendk_ela=abbr#Eatchar()' iab for abbr#NotCtx('for' ) ? 'for' : 'for a, b in pairs() dooendk_ella=abbr#Eatchar()' iab forr for i = a, #a dooendk_ella=abbr#Eatchar() iab function function )=abbr#Eatchar() # popup menu if exists('g:loaded_scope') import autoload 'scope/fuzzy.vim' def Things() var things = [] for nr in range(1, line('$')) var line = getline(nr) if line =~ '\v(^|\s)function' || line =~ '\v^\k+\s+\=' things->add({text: $"{line} ({nr})", linenr: nr}) endif endfor things->filter((_, v) => v.text !~ '\v^\s*--') fuzzy.FilterMenu.new("Lua Things", things, (res, key) => { exe $":{res.linenr}" normal! zz }, (winid) => { win_execute(winid, $"syn match FilterMenuLineNr '(\\d\\+)$'") hi def link FilterMenuLineNr Comment }) enddef nnoremap / Things() endif