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

Re: Inserting at cursor from command mode

Expand Messages
  • Michael Naumann
    ... I guess you need ... HTH, Michael
    Message 1 of 5 , Mar 1 6:11 AM
    • 0 Attachment
      On Monday 01 March 2004 12:56, Yakov Lerner wrote:
      > Let's say I want to insert <cr> at the cursor, from the script.
      > I tried these, and it does not work:
      > norm i<cr> " does not work
      > insert " does not work -- inserts but not at cursor
      >
      > .
      > I found this but it's ugly:
      > map ;;; i<cr><esc>
      > norm ;;;
      > Is it possible to insert <cr> at cursor from script without
      > introducing temporary mapping ?
      >
      > Yakov

      I guess you need
      :map ;;; :exe "norm i\<cr>"

      HTH, Michael
    • gumnos (Tim Chase)
      ... Another possibility (sorry if this one s been mentioned and I didn t see it fly by) would be to do ... where all characters are entered literally -tim
      Message 2 of 5 , Mar 1 6:30 AM
      • 0 Attachment
        > I guess you need
        > :map ;;; :exe "norm i\<cr>"

        Another possibility (sorry if this one's been mentioned and I didn't see
        it fly by) would be to do

        :nnoremap ;;; :s/\%#/\r<cr>

        where all characters are entered literally

        -tim
      • Mikolaj Machowski
        ... Try normal! i ^ m. -- - Squeak? - SQUEAK.
        Message 3 of 5 , Mar 1 7:09 AM
        • 0 Attachment
          Dnia Monday 01 of March 2004 12:56, Yakov Lerner napisaƂ:
          > Let's say I want to insert <cr> at the cursor, from the script.
          > I tried these, and it does not work:
          > norm i<cr> " does not work
          > insert " does not work -- inserts but not at cursor

          Try
          normal! i<cr>
          ^

          m.
          --
          - Squeak?
          - SQUEAK.
        • Charles E. Campbell, Jr.
          ... exe norm! r If you just want a new line (not wanting to break a line): put = Regards, Chip Campbell
          Message 4 of 5 , Mar 1 10:23 AM
          • 0 Attachment
            Yakov Lerner wrote:

            > Let's say I want to insert <cr> at the cursor, from the script.
            > I tried these, and it does not work:
            > norm i<cr> " does not work
            > insert " does not work -- inserts but not at cursor
            >
            > .
            > I found this but it's ugly:
            > map ;;; i<cr><esc>
            > norm ;;;
            > Is it possible to insert <cr> at cursor from script without
            > introducing temporary mapping ?


            exe "norm! r\<cr>"

            If you just want a new line (not wanting to break a line):

            put =''

            Regards,
            Chip Campbell
          Your message has been successfully submitted and would be delivered to recipients shortly.