How to indent multiple lines interpolated?
The idea is to write multiple lines, interpolate them in
some way and write them in two places, with different
indentation. I thought I could use vim.eval(
get the starting column number of the duplicated text
but it doesn't really work as I expected.
A simple snippet the show the problem is the following:
snippet test
original:
${1:txt}
one indent: `!p
ind = int(vim.
for x in t[1].splitlines():
snip.rv += '\n' + (ind * " ") + x
`
two indents: `!p
ind = int(vim.
for x in t[1].splitlines():
snip.rv += '\n' + (ind * " ") + x
`
endsnippet
What I want to do is to have text like this:
original:
first_line
second_line
third_line
one_indent:
\t first_line
\t second_line
\t third_line
two indents:
\t \t first_line
\t \t second_line
\t \t third line
is there a way to achieve this?
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- UltiSnips Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- SirVer
- Solved:
- Last query:
- Last reply: