Sourcing (just-some-lines) from a .vim file

The name is pretty much self-evident; there is a way to simply create a couple of highlighted lines from a .vim file instead of copying it to a new buffer, saving it, etc.

I do not want (after writing to the file) to overwrite it on the command line, but just select it and send it. Unfortunately, the "source" does not work in the range.

Bright ideas are welcome :)

+3
source share
1 answer

You can use a custom command in conjunction with g//

command! -range=% RSource <line1>,<line2>g/./exe getline('.')

Then select the code, press :and enter RSource(so that the command line should look like :'<,'>RSource).

+2
source

Source: https://habr.com/ru/post/1793615/


All Articles