Sunday, June 14, 2015

change a string when another string is changed in a template

Hi,
I am trying to use a template which will change a string of the template when another string is changed (this two string will always be same). For example, in the template:

Program [:EVAL:]expand('%:t:r')[:END:]
Implicit None
${2:<++Start Typing++>}
End Program [:EVAL:]expand('%:t:r')[:END:]

The first and last line inside [EVAL][END] will take the file name.
But, then, if I change the output of [:EVAL:]expand('%:t:r')[:END:] in the first line, I would like to change the last line automatically.

I know I can do this using a plugin (Ultisnips), but for some reason, I want to do this using templates, if possible.

Any help?

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment