LinuxQuestions.org
Register a domain and help support LQ
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, 09:43 AM   #1
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 3,485

Rep: Reputation: 51
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, 10:01 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

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

Original Poster
Rep: Reputation: 51
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 10:19 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 12:10 PM
hiding the lines in the vim. ICO Linux - Newbie 1 06-28-2009 06:37 AM
Vim: How to hide commentary lines brianmcgee Programming 1 04-14-2008 10:15 AM
comment multiple lines in vim Furlinastis Slackware 9 12-11-2007 02:01 PM
VIM finding and commenting lines shamgar03 Linux - Software 3 06-06-2006 05:49 PM


All times are GMT -5. The time now is 10:56 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration