| |||
| Copying to a new file Hi all, The other day I was browsing through the Vimtutor which runs as a command. It opens as a tutorial. I would like to know how can I copy, paste the entire contents to a new file. If I yank the contents, they can only be copied to the same file. Maybe I am doing something wrong but does VIM really have a facility/command to copy to another file? I tried the usual cp command but that copies the command and its code for the Vimtutor. Also, how do I read the lessons numbered as |usr_1.txt| ? Thank you in advance. Arty |
| |||
| Re: Copying to a new file Feverishly pounding upon a keyboard Artnut typed: <snip> > Also, how do I read the lessons numbered as |usr_1.txt| ? :help usr_01.txt -- sk8r-365 But the children of the kingdom shall be cast out into outer darkness: there shall be weeping and gnashing of teeth. -- Matthew 8:12 |
| |||
| Re: Copying to a new file Feverishly pounding upon a keyboard Artnut typed: > Hi all, > > The other day I was browsing through the Vimtutor which runs as a command. > It opens as a tutorial. I would like to know how can I copy, paste the > entire contents to a new file. If I yank the contents, they can only be > copied to the same file. <snip> I don't bother with that. I use gnome-terminal's menu, but maybe this will help if you open a second buffer: http://www.cs.fsu.edu/general/vimanual.html#copypaste -- sk8r-365 Philip, and Bartholomew; Thomas, and Matthew the publican; James the son of Alphaeus, and Lebbaeus, whose surname was Thaddaeus; -- Matthew 10:3 |
| |||
| Re: Copying to a new file Artnut <art******.com> wrote: >The other day I was browsing through the Vimtutor which runs as a command. >It opens as a tutorial. I would like to know how can I copy, paste the >entire contents to a new file. If you want the entire contents, you can just write the whole buffer to a new file: :w foo.txt -Beej |
| |||
| Re: Copying to a new file On Fri, 20 Jun 2008 18:43:11 +0530, Artnut wrote: > Hi all, > > The other day I was browsing through the Vimtutor which runs as a > command. It opens as a tutorial. I would like to know how can I copy, > paste the entire contents to a new file. If I yank the contents, they > can only be copied to the same file. Maybe I am doing something wrong > but does VIM really have a facility/command to copy to another file? I > tried the usual cp command but that copies the command and its code for > the Vimtutor. > > Also, how do I read the lessons numbered as |usr_1.txt| ? > > > Thank you in advance. > > Arty Arty; cp origional-file.txt newfile.txt To assemble avi slices from newsgroups: cat firstfile.avi.0* > movie.avi Or, You can copy the contents of a file also by: cat originalfile.txt > newfile.txt helps? coffee |
| |||
| Re: Copying to a new file "coffee" <coffee@the-bunker.com> wrote in message news:9oWdnUbt15wM98DVnZ2dnUVZ_szinZ2d@giganews.com ... > On Fri, 20 Jun 2008 18:43:11 +0530, Artnut wrote: > >> Hi all, >> >> The other day I was browsing through the Vimtutor which runs as a >> command. It opens as a tutorial. I would like to know how can I copy, >> paste the entire contents to a new file. If I yank the contents, they >> can only be copied to the same file. Maybe I am doing something wrong >> but does VIM really have a facility/command to copy to another file? I >> tried the usual cp command but that copies the command and its code for >> the Vimtutor. >> >> Also, how do I read the lessons numbered as |usr_1.txt| ? >> >> >> Thank you in advance. >> >> Arty > > Arty; > > > cp origional-file.txt newfile.txt > > To assemble avi slices from newsgroups: > > cat firstfile.avi.0* > movie.avi > > Or, You can copy the contents of a file also by: > > cat originalfile.txt > newfile.txt > > helps? > > > coffee Hey Coffee and others, thanks indeed for the replies. Ideally cat abc.txt > xyz.txt would help but vimtutor is a command which opens as tutorial in Vi or Vim. If I yank those 970 lines and I open a blank new file, I cannot p (paste) because it is not programmed that way. It means I can only paste the yanked 970 lines in the same tutorial giving me additional 970 lines! I don't understand why this limitation for a command related file. I can copy from a normal vi file and paste into another new vi file but cannot do so with a command output file. Thank you, Arty |
| |||
| Re: Copying to a new file Artnut wrote: > Hey Coffee and others, thanks indeed for the replies. Ideally cat abc.txt > > xyz.txt would help but vimtutor is a command which opens as tutorial in Vi > or Vim. If I yank those 970 lines and I open a blank new file, I cannot p > (paste) because it is not programmed that way. It means I can only paste the > yanked 970 lines in the same tutorial giving me additional 970 lines! I > don't understand why this limitation for a command related file. I can copy > from a normal vi file and paste into another new vi file but cannot do so > with a command output file. Mark the text you want to copy in vi with your mouse (hold your left mouse button pressed and move the pointer to the end of the text visible), switch focus to the program which you want to save the text with and press your middle button. Repeat this until you copied all the rows and then save the newly created file. -- //Aho |
| |||
| Re: Copying to a new file Feverishly pounding upon a keyboard coffee typed: To build upon coffee's info: > cp origional-file.txt newfile.txt > > To assemble avi slices from newsgroups: > > cat firstfile.avi.0* > movie.avi or cat firstfile.avi.??? > movie.avi > Or, You can copy the contents of a file also by: > > cat originalfile.txt > newfile.txt The single '>' overwrites anything in newfile.txt. Which is OK if it's empty, but using '>>' would be needed to add (append) text. -- sk8r-365 And the same John had his raiment of camel's hair, and a leathern girdle about his loins; and his meat was locusts and wild honey. -- Matthew 3:4 |
| |||
| Re: Copying to a new file On 2008-06-20 15:13, Artnut wrote: > Hi all, > > The other day I was browsing through the Vimtutor which runs as a command. > It opens as a tutorial. I would like to know how can I copy, paste the > entire contents to a new file. If I yank the contents, they can only be > copied to the same file. Maybe I am doing something wrong but does VIM > really have a facility/command to copy to another file? > I tried the usual cp command but that copies the command and its code for > the Vimtutor. > > Also, how do I read the lessons numbered as |usr_1.txt| ? > > > Thank you in advance. > > Arty > > You must remember that you can filter any range of your text to any unix command, so you can also use the command cat to save a contents to a file. Go to the last line you will cut to a file, mark it as a (ma) Go to the first line and do !'a (you will get a ! on the bottom line now type: cat >filename<cr> If you will have the contents back use undo (u) /bb |
![]() |
| Bookmarks |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| File copying sometimes does not work | Fishyweb | Windows Vista | 2 | 05-28-2008 04:50 AM |
| copying a file | The Red Baron | Microsoft Office | 1 | 04-21-2008 02:00 AM |
| WMDC Changes File Date When copying file to Laptop | Bob | Windows Vista | 4 | 03-28-2007 02:15 PM |
| File Copying from OS9.1 to OSX | Bebop3351 | Apple Macintosh Hardware | 5 | 02-06-2007 03:43 PM |
| file copying problem | jcrystal | Windows XP | 3 | 01-21-2007 03:00 PM |