Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Vi Question

  • 11-11-2003 6:50pm
    #1
    Closed Accounts Posts: 15


    Straight forward enough I hope. Is there a command I can use to select all the text from a vi document and then copy and paste it to another file?


Comments

  • Registered Users, Registered Users 2 Posts: 3,744 ✭✭✭deRanged


    you can open the other file and read the first one into it.
    goto the place you want the text inserted, and in command mode (hit escape) type :r <filename> and press enter.


  • Closed Accounts Posts: 157 ✭✭BenH


    Alternatively cat /path/to/filename >> /path/to/appendedfile will add the contents of the first file to the end of the second.


  • Registered Users, Registered Users 2 Posts: 2,755 ✭✭✭niallb


    The command is :%y in command mode.
    This copies the entire buffer to the default register.

    You can then open the other file using :e! newfilename
    go to the location you need, and paste using p

    Think that's what you described.

    NiallB


  • Closed Accounts Posts: 15 GregLake


    On the button, thanks niall!


Advertisement