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

Re: Inserting at cursor from command mode

Expand Messages
  • 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 1 of 5 , Mar 1, 2004
    • 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 2 of 5 , Mar 1, 2004
      • 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 3 of 5 , Mar 1, 2004
        • 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.