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

Re: Access vim command from the lua end WAS: How do the default key commands work

Expand Messages
  • Marco
    ... Thank you very much. Marco -- You received this message from the vim_use maillist. Do not top-post! Type your reply below the text you are replying to.
    Message 1 of 3 , Jan 31, 2011
    • 0 Attachment
      On 2011-01-31 Ben Schmidt <mail_ben_schmidt@...> wrote:

      > > So I rephrase my question. How to access basic vim commands (here: %) from
      > > inside lua? How to access an arbitrary vim function from inside lua?
      >
      > Use the :normal command (probably with ! to avoid using user mappings).
      > E.g.
      >
      > :lua vim.command"normal! %"
      >
      > Then to get the cursor position, you can use the getpos() function. E.g.
      >
      > :lua mypos = vim.eval"getpos('.')"
      >

      Thank you very much.

      Marco


      --
      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
    Your message has been successfully submitted and would be delivered to recipients shortly.