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

Vimscript to paste into a file

Expand Messages
  • davvs
    Hi I want to find out if there s any way to run a one line shell command to do the same as the following: vim pastefile.txt (press keyboard buttons GO *pwq!) I
    Message 1 of 4 , Apr 1 2:25 AM
    View Source
    • 0 Attachment
      Hi I want to find out if there's any way to run a one line shell command to
      do the same as the following:

      vim pastefile.txt
      (press keyboard buttons GO"*pwq!)

      I want someting like this:
      prompt> vim pastefile.txt -inputchars 'GO"*pwdq!"
      prompt>

      --
      View this message in context: http://old.nabble.com/Vimscript-to-paste-into-a-file-tp28106196p28106196.html
      Sent from the Vim - General mailing list archive at Nabble.com.

      --
      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

      To unsubscribe, reply using "remove me" as the subject.
    • Jürgen Krämer
      Hi, ... I guess you meant 0 (Zero) instead of O (upper case oh) and that there is a colon missing before wq! . ... You can achieve this with vim -c
      Message 2 of 4 , Apr 1 4:10 AM
      View Source
      • 0 Attachment
        Hi,

        davvs wrote:
        >
        > Hi I want to find out if there's any way to run a one line shell command to
        > do the same as the following:
        >
        > vim pastefile.txt
        > (press keyboard buttons GO"*pwq!)

        I guess you meant '0' (Zero) instead of 'O' (upper case oh) and that there
        is a colon missing before 'wq!'.

        >
        > I want someting like this:
        > prompt> vim pastefile.txt -inputchars 'GO"*pwdq!"
        > prompt>

        You can achieve this with

        vim -c 'normal G0"*p' -c 'wq!' pastefile.txt

        Regards,
        Jürgen

        --
        Sometimes I think the surest sign that intelligent life exists elsewhere
        in the universe is that none of it has tried to contact us. (Calvin)

        --
        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

        To unsubscribe, reply using "remove me" as the subject.
      • Marc Weber
        Hi davvs, Also have a look at xclip. You should be able to do what you want by xclip $OPTONS your-file or such. Scripting Vim is a nice solution so you can
        Message 3 of 4 , Apr 2 4:22 PM
        View Source
        • 0 Attachment
          Hi davvs,

          Also have a look at xclip.

          You should be able to do what you want by

          xclip $OPTONS >> your-file

          or such. Scripting Vim is a nice solution so you can stick to that
          equally well.

          Marc Weber

          --
          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

          To unsubscribe, reply using "remove me" as the subject.
        • davvs
          Thanks, both of you - That really does the trick. Acctually, I rather prefer to use a vim script since I need to use it in both windows and linux. -- View this
          Message 4 of 4 , Apr 6 11:56 AM
          View Source
          • 0 Attachment
            Thanks, both of you - That really does the trick.

            Acctually, I rather prefer to use a vim script since I need to use it in
            both windows and linux.

            --
            View this message in context: http://old.nabble.com/Vimscript-to-paste-into-a-file-tp28106196p28156008.html
            Sent from the Vim - General mailing list archive at Nabble.com.

            --
            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

            To unsubscribe, reply using "remove me" as the subject.
          Your message has been successfully submitted and would be delivered to recipients shortly.