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

Re: Retrieve Blocked Text in Visual Mode with Python?

Expand Messages
  • Yakov Lerner
    ... let you access vim variable from python code Yakov -- iler_ml@fastmail.fm -- http://www.fastmail.fm - Choose from over 50 domains or use your own
    Message 1 of 4 , Feb 26, 2006
    • 0 Attachment
      "Dennis Craven" <dcraven@...> wrote:
      > On Sat, 2006-25-02 at 23:53 +0200, Yakov Lerner wrote:
      > > On Sat, 25 Feb 2006 16:37:58 -0500, "Dennis Craven" <dcraven@...>
      > > said:
      > > > Hello,
      > > >
      > > > Is there a way using the Python module/interface to get the currently
      > > > highlighted text? I didn't see a way using the information given in the
      > > > vim-python documentation. If not, can it be acquired with vim script and
      > > > passed to a Python function?
      > > >
      > > > Even if it's just the lines that are highlighted, that would be fine too
      > > > (ie. linewise-visual only?). I can easily get the entire buffer, and I
      > > > see reference to a "range", but I'm not sure how to use that range in
      > > > the example above to get say, the range of lines that are currently
      > > > highlighted.
      > >
      > > :vmap <f2> :MyCommand<cr>
      > > :command -range MyCommand :call MyFunction(<line1>,<line2>)
      > > function MyFunction(line1,line2)
      > > echo "ok, visual range is ".line1."..".:line2"
      > > endfu
      >
      > I guess my question is more one of using these variables within Python
      > now that they are populated in the Vim script.

      :he python-eval

      let you access vim variable from python code

      Yakov

      --

      iler_ml@...

      --
      http://www.fastmail.fm - Choose from over 50 domains or use your own
    Your message has been successfully submitted and would be delivered to recipients shortly.