Here is some text here is line two of text
I visually select from is to is in Vim: (brackets represent visual selection [ ] )
Here [is some text here is] line two of text
Using Python, I can get a series of selection sets:
function! GetRange() python << EOF import vim buf = vim.current.buffer # the buffer start = buf.mark('<') # start selection tuple: (1,5) end = buf.mark('>') # end selection tuple: (2,7) EOF endfunction
I use this file:: :so % , visually select the text, run :<,'>call GetRange() and
now that i have (1,5) and (2,7) . In Python, how can I compile a string that is as follows:
is some text\nhere is
It would be nice:
- Get this string for future manipulations
- then replace this selected range with an updated / managed line
source share