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

Two questions about moving in vim

Expand Messages
  • Milan Juza
    Hi, I am sorry to disturb this discussion with such a simple question, but I am a beginner in vim and was not able to solve this problem: I would like to have
    Message 1 of 2 , Sep 1, 2001
      Hi,

      I am sorry to disturb this discussion with such a simple question, but I
      am a beginner in vim and was not able to solve this problem:

      I would like to have an Abbreviation in insert mode which produces
      something like this (cursdor position after the iab is finished is marked with @)

      <ol>
      <li>@
      </ol>

      Therefore I have written to html.vim file:
      iab Yol <ol><CR><li><CR></ol><ESC>ka
      However it produces this:

      <ol>
      <li> @
      </ol>

      It always inserts the space after <li>. Does anybody know what I is wrong?

      And my second question: I have downloaded html.vim file, which is
      available at vim.org and found out, that when I try to use many iabs e.g.
      Ybr which is defined like: iab Ybr <br>. But I get this:
      (@ - cursor position)

      <br>
      @

      Can you explain me that behaviour?

      Thanx a lot.

      Milan Juza
      juza@...
    • Max Ischenko
      ... IIRC, the space is got inserted because it s triggered the abbreviation. You d use imap command instead or use to expand abbreviation. -- You have to
      Message 2 of 2 , Sep 1, 2001
        Milan Juza wrote:

        > <ol>
        > <li> @
        > </ol>
        >
        > It always inserts the space after <li>. Does anybody know what I is wrong?
        >

        IIRC, the space is got inserted because it's triggered the abbreviation.
        You'd use imap command instead or use <C-]> to expand abbreviation.

        --
        You have to think in a language to write programs in it,
        and it's hard to want something you can't describe.
        -- Paul Graham.
      Your message has been successfully submitted and would be delivered to recipients shortly.