Skip to main content
3 votes

Recommended way of scripting: Ex commands or vimscript functions?

As with any topic of sufficient complexity, the answer depends a lot on the context. Unfortunately, "when scripting" is a highly ambiguous statement which led to a lengthy discussion on meta....
Friedrich's user avatar
  • 2,572
1 vote
Accepted

vimscript function suggest in command-line mode?

I believe it is the wildmenu. Simply add the following lines to you vimrc file: set wildmenu set wildmode=full After typing :call if you hit Tab you see in the line before the command line the list ...
Vivian De Smedt's user avatar
1 vote
Accepted

How to insert multiple lines from function?

The setline function accepts a list as documented in :help setline(): {lnum} is used like with |getline()|. When {lnum} is just below the last line the {text} will be added ...
D. Ben Knoble's user avatar
  • 26.7k
1 vote

How to insert multiple lines from function?

To add a line below with world I would add to your code: call append(orig_line, "world") If you want to modify the line I believe you have to repeat the action you did for the previous line ...
Vivian De Smedt's user avatar
1 vote
Accepted

Copying the previous block of code

I would do something like: nnoremap <C-s> {y}<C-o><C-o>P { move before the start of the previous paragraph y} yank (copy) the paragraph <C-o><C-o> comeback to the cursor ...
Vivian De Smedt's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible