and will try to incorporate them into my function!
Thanks!
On May 7, 2:37 am, "Christian Brabandt" <cbli...@256bit.org> wrote:
> On Fri, May 7, 2010 5:15 am, surge wrote:
> > " If it's an angle bracket, we'll assume that we already have a span
> > tag. If not, surround the word with the tag and
> > " the attribute "latin" and move back to the end of the tag.
> > if l:myB != '>'
> > exe 'normal ves<span class="latin">'
>
> You are always replacing the character on which the cursor is.
> Better would be probably something like this:
> exe "normal! ve\<ESC>"
> exe 'norm! a<span class="latin">'
>
> Depending on your usecase, this might not be what you want (e.g. when you are
> already at the last character of a word, e will move forward to the end of
> the
> next word.)
>
> Then I would at least get the column for the starting <span tag>:
> normal F<
> let start_col=col('.')
>
> > normal f>
> > endif
> > " And here is where I have the problem. I need to do a replacement of
> > the form:
> > :s/<span class="(.\{-})">/<span class="\1 " + marker + l:diff/ and
> > only for the tag to the left of the word.
>
> limit the match to the column, where the <span started
>
> exe ':s/\%'.start_col . 'v'.<span class="(.\{-})">/<span class="\1 " .
> marker . l:diff . "/"
>
> (untested)
>
> > P.S.: I can't figure out how to turn off Visual mode once I entered it
> > with: "exe 'normal v'".
>
> exe "normal! \<ESC>"
>
> Disclaimer: I have neither checked your RE nor have I tested my examples.
> so there might still be errors.
>
> regards,
> Christian
>
> --
> 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, visithttp://www.vim.org/maillist.php
--
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
No comments:
Post a Comment