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

Paste without smartindent

Expand Messages
  • Marvin Humphrey
    Greets, One of the things I really liked about gvim 6.3 for the Mac as opposed to the terminal version was that cmd-v paste ignored current settings for
    Message 1 of 3 , Dec 28, 2006
    • 0 Attachment
      Greets,

      One of the things I really liked about gvim 6.3 for the Mac as
      opposed to the terminal version was that cmd-v paste ignored current
      settings for smartindent. I've recently upgraded to version 7 and
      I'm bummed to see that this "feature" :) has been fixed.

      Any way to get that old, pleasant, buggy behavior back? Having to
      toggle :set nosmartindent :set smartindent every time I want to paste
      a block is painful.

      Or maybe there's another way to achieve the same ends?

      Marvin Humphrey
      Rectangular Research
      http://www.rectangular.com/
    • Marvin Humphrey
      Greets, I m replying to my own mail because I received a private reply which led me to the solution. ... Looks like this is the magic incantation: noremap
      Message 2 of 3 , Dec 28, 2006
      • 0 Attachment
        Greets,

        I'm replying to my own mail because I received a private reply which
        led me to the solution.

        On Dec 28, 2006, at 9:50 AM, Marvin Humphrey wrote:

        > Or maybe there's another way to achieve the same ends?

        Looks like this is the magic incantation:

        noremap <D-v> <esc>:set paste<CR>"+gP:set nopaste<CR>
        inoremap <D-v> <esc>:set paste<CR>"+gP:set nopaste<CR>i

        Doesn't work in Terminal, but works in gvim.

        Marvin Humphrey
        Rectangular Research
        http://www.rectangular.com/
      • rleeden
        Another alternative maybe is to use the pastetoggle command - http://vimdoc.sourceforge.net/htmldoc/options.html# pastetoggle VIM Documentation . I have the
        Message 3 of 3 , Jan 2, 2007
        • 0 Attachment
          Another alternative maybe is to use the pastetoggle command -
          http://vimdoc.sourceforge.net/htmldoc/options.html#'pastetoggle' VIM
          Documentation .

          I have the following in my .vimrc which in my case allows F11 to toggle
          'paste mode' on and off:

          set pastetoggle=<F11>



          Marvin Humphrey wrote:
          >
          > Greets,
          >
          > I'm replying to my own mail because I received a private reply which
          > led me to the solution.
          >
          > On Dec 28, 2006, at 9:50 AM, Marvin Humphrey wrote:
          >
          >> Or maybe there's another way to achieve the same ends?
          >
          > Looks like this is the magic incantation:
          >
          > noremap <D-v> <esc>:set paste<CR>"+gP:set nopaste<CR>
          > inoremap <D-v> <esc>:set paste<CR>"+gP:set nopaste<CR>i
          >
          > Doesn't work in Terminal, but works in gvim.
          >
          > Marvin Humphrey
          > Rectangular Research
          > http://www.rectangular.com/
          >
          >
          >
          >

          --
          View this message in context: http://www.nabble.com/Paste-without-smartindent-tf2891398.html#a8122506
          Sent from the Vim - Mac mailing list archive at Nabble.com.
        Your message has been successfully submitted and would be delivered to recipients shortly.