LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-21-2011, 08:43 AM   #1
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Rep: Reputation: 76
Vim: writing nonconsecutive groups of lines to another file.


kernel 2.6.21.5, slackware 12.0
vim 7.1

Hi:
To export a group of consecutive lines to another file, I usually do ':w <file_name>'. But suppose the lines are not consecutive like I want to write lines 4-6, 31-45 to another file. Will the :w command do? Or I need another command?
 
Old 08-21-2011, 09:01 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
How about 'yank' & 'put' http://vimdoc.sourceforge.net/htmldoc/usr_04.html#04.6
 
Old 08-21-2011, 09:07 PM   #3
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
Please tell me. When you yank, you lose the previous contents of the buffer?


EDIT: I've just tried and it does not keep it, it seems.
EDIT 2: I'll see if I have a clipboard. In the link I saw **y and **p.

Last edited by stf92; 08-21-2011 at 09:19 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] delete lines in vim xeon123 Linux - Newbie 3 03-05-2011 11:10 AM
hiding the lines in the vim. ICO Linux - Newbie 1 06-28-2009 05:37 AM
Vim: How to hide commentary lines brianmcgee Programming 1 04-14-2008 09:15 AM
comment multiple lines in vim Furlinastis Slackware 9 12-11-2007 01:01 PM
VIM finding and commenting lines shamgar03 Linux - Software 3 06-06-2006 04:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration