Loading ...
Sorry, an error occurred while loading the content.

Re: Snippet Placeholders. How to edit somewhere and make it change somewhere else

Expand Messages
  • thomas
    ... I think the easiest solution would be to define a map that queries the user for the replacement text (using input()) and then replaces all the occurrences.
    Message 1 of 2 , Dec 2, 2007
    • 0 Attachment
      > Is there some other way to know that I might have just
      > edited a placeholder? Or any other way to do this?

      I think the easiest solution would be to define a map that queries
      the
      user for the replacement text (using input()) and then replaces all
      the
      occurrences.

      Other possible solutions would include to use CursorMoved[I] or
      InsertLeave events to check on line changes if the template was
      edited.
      These solutions come with a certain overhead though.

      A similar solution would be to cover the markers with a special
      syntax
      and use CursorMoved[I] to perform some checks when entering such a
      syntax and then when ... moving to another line maybe. There of course
      is
      also a overhead involved but I felt it's acceptable. I use this
      technique with some plugins that use hookcursormoved[2] to perform
      the
      checks -- which has the advantage that certain checks are done only
      once.

      Regards,
      Thomas.


      [1] http://www.vim.org/scripts/script.php?script_id=2037

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    Your message has been successfully submitted and would be delivered to recipients shortly.