Skip to main content

New answers tagged

0 votes

How make this function work as intended/more simple?

I failed to get the desired output via visual selection calling function directly without mapping beginning with :<C-u> to cancel visual selection. From :h :call When a range is given ...
Matt's user avatar
  • 21.3k
0 votes

How make this function work as intended/more simple?

You could use a range function: function DashTable() range for line in range(a:firstline, a:lastline) execute 'silent! ' . line . 's/\t/ /ge' " Replace two or more spaces with tabs ...
Vivian De Smedt's user avatar
3 votes

How to load a function from a Vim9 script and call it?

vim9script functions are script local by default unless you prepend func name with the g: -- def g:Hi(). Instead of global, you can mark functions as exported and access them from another vim9script ...
Maxim Kim's user avatar
  • 13.8k
3 votes
Accepted

How to load a function from a Vim9 script and call it?

You just prefix the function name with g: -- for example: vim9script def g:Hi() echo "Hello" enddef Then your :call Hi() will work. Note that the g: is not necessary for calling within ...
Heptite's user avatar
  • 1,165

Top 50 recent answers are included