LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-08-2008, 01:27 PM   #1
derzok
Member
 
Registered: Aug 2004
Location: Ohio
Distribution: Debian, Slackware
Posts: 58

Rep: Reputation: 15
yanking/pasting text across vim sessions


So I do a lot of coding in vim and I recently discovered that I could yank text in one session, quit, open a new session, and paste the yanked text. Now I quickly noticed that I could only do this with 50 lines of code at a time, I asked #vim on freenode and they said there's an option in .vimrc that allows you to set the size of the buffer. Unfortunately, nobody knew what the option was called. I was also unable to find it in vim's documentation. Can anyone help me out?
 
Old 08-08-2008, 01:44 PM   #2
grepmasterd
Member
 
Registered: Aug 2003
Location: Seattle
Distribution: ubuntu, lately
Posts: 182
Blog Entries: 1

Rep: Reputation: 35
default vim behavior does not impose this limit, afaict. find all the vimrc files on your system and inspect them for what might be setting this limit.
 
Old 08-08-2008, 05:00 PM   #3
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
I wrote this yank/put code years before vim was invented, and I've used it ever since:

map ( :'a,.w!~/.vimscratch^M
map ) :r ~/.vimscratch^M

Add this to your .vimrc file. Use it by marking the first line you want to yank with 'a (mark a), and go to the last line of the range and type ( (open parenthesis). This puts lines into a ~/.vimscratch file, where you can use ) (close parenthesis) in any other vim session, even on different machines if you have home mounted via NFS.
 
  


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
Open Office 2.3 Clip Board error when pasting Text (Suse 10.3) 1kyle SUSE / openSUSE 2 03-22-2008 08:59 AM
LXer: Yanking The Window Shade LXer Syndicated Linux News 0 01-21-2008 05:10 AM
copy pasting from X app to vim Furlinastis Linux - General 3 12-05-2005 09:05 PM
pasting swedish text from openoffice write to kile martine Linux - Software 1 11-25-2004 04:40 AM
pasting the selected text with right click works strange raft Linux - Hardware 0 12-06-2003 01:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:47 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