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

RE: Pls help with writing this plugin

Expand Messages
  • John Beckett
    ... The following is NOT what you asked for, but it is similar: http://vim.wikia.com/wiki/Highlight_multiple_words The tip matches all occurrences of a
    Message 1 of 3 , Aug 2, 2009
    • 0 Attachment
      googler wrote:
      > I'm trying to write a vim script (plugin) that will do the following.
      > When I visually select a part of the text and press the key
      > F2, it will highlight this text.

      The following is NOT what you asked for, but it is similar:
      http://vim.wikia.com/wiki/Highlight_multiple_words

      The tip matches all occurrences of a pattern, whereas you want
      to match the text between two positions.

      > But in this case, my line and column numbers are stored in
      > variables. So how do I use these in the match command? Is
      > there a way?

      See ":help :execute" and you might find some clues in some of
      the tips, but I don't think any highlight between two positions.

      > A related question is, is it possible to create marks not by
      > going to a certain position and doing a ma (for example), but
      > just by specifying the line and column numbers?

      It's useful to try ":help function-list" and search for likely
      terms. It looks like setpos() might help.

      John


      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_use" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • googler
      ... Thank you. This is what I needed. The execute command seems to be pretty common as I found it in many other scripts too. It will be helpful in the future.
      Message 2 of 3 , Aug 2, 2009
      • 0 Attachment
        > > But in this case, my line and column numbers are stored in
        > > variables. So how do I use these in the match command? Is
        > > there a way?
        >
        > See ":help :execute" and you might find some clues in some  of
        > the tips, but I don't think any highlight between two positions.
        >
        Thank you. This is what I needed. The execute command seems to be
        pretty common as I found it in many other scripts too. It will be
        helpful in the future.
        --~--~---------~--~----~------------~-------~--~----~
        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.