Re: Take Two: Pasteboard sans HTML

2006-10-01 Thread A.J.Mechelynck

Calvin Waterbury wrote:

Note: I realized after I sent this it was in HTML, I thought it was test only - 
please accept my apologies for any difficulty - Calvin

Hello VIM,

[Disclaimer] - I realize this is a long post, but if it results in triggering 
interest, the resultant increase in productivity will be worth it, especially 
for anyone in research of any kind!

In the Windows program NoteTab Pro there are two features that I have not located on the VIM 
search called Pasteboard and Outline (this may not be what you think it is)   If 
you've used the NTP Pasteboard you know how handy it is and the lack of these two features is the only thing 
that stands in the way of me making the paradigm shift to VIM for good.  VIM is great!  For those that don't 
know or understand what I am talking about, here is an explanation...

--
- PASTEBOARD -
--
This is a feature that automatically captures clipboard content to a text file that has 
been designated as the Pasteboard.  Perhaps an example would clarify.  If I 
had this feature implimented in VIM I would do the following:
 - Open a text ed window
 - Set it to be the Pasteboard
 - Switch to whatever window I want to capture (webpage text like a recipe, 
another text file, etc.)
 --- [1]Select the first text item
 --- [2]Copy to clipboard 
 --- [3]Repeat [1] and [2] until done.

 - Go back to the Pasteboard window and I would see all of my captures neatly separated 
by whatever separator (a line of hyphens, equal signs, etc.) I had set in the Options.
 - Turn off the Pasteboard
 - Save the file.

The advantages are a lot less key or mouse clicks and I do not have to leave 
the window I am viewing.  I hope you can see how valuable this would be to 
doing research (FYI - I consider collecting ANY data as research)!  You're 
never distracted with ALT-TAB (or equivalent) to switch back-and-forth to your 
scratch pad, not to mention the amount of time saved! :o)

This feature has been a staple of my research efforts since I discovered it.  I can also testify that not being distracted with the mechanics has the effect of releasing creative thought and the resultant productivity.  I think I probably need help in locating it as I would be stunned if this feature has not already been created (or discovered)!  I'm sure you can tell, I am sold on this utility! :o)  


Does anyone know if this is available in VIM?


Vim is not limited by the clipboard. In fact, when cutting and pasting from 
one place to another within a Vim session, the clipboard is normally not used. 
Normally, vim only uses the clipboard when you want to copy data to or from a 
different program, or between different instances of Vim.


Also, between cuts that you want to remember, you may do cuts and pastes 
which are to be done and forgotten -- e.g., by hitting xp on the e of teh 
you change it to the. You wouldn't want that single e to be remembered on 
your pasteboard, would you?


Vim allows you to remember 26 independent important cuts and copies by 
deleting or yanking to registers named a to z. In addition to that, the 
latest yank is available as register 0 (zero), the nine latest deletes as 
registers 1 to 9, the latest search pattern as register /, etc., ... the 
system clipboard as register +


All those important cuts are remembered from one session to the next without 
your intervention. All you have to do is specify a register name when deleting 
or yanking, by prefixing the d or y or ... with x where x is the register 
name (a to z for overwriting, A to Z for appending). Similarly, to paste them, 
precede the p or P command by x where x is the register name (here, a and A 
are equivalent).


In the case of your cooking recipe, you would select (maybe linewise, using V 
followed by up-and down cursor moves) the first part of your recipe, then copy 
it to register r (for recipe) by means of ry (where y means yank, in Vim 
terminology). Then you would select the next part, hit Ry , the next, again 
Ry , etc. After you yank the last part, the whole recipe is in register r and 
you can open a new file (:e recipe.txt in the same window, or :new 
recipe.txt in a split window, in both cases without the quotes -- notice that 
Vim calls windows what most other programs call panes) and paste your 
whole recipe at one go using rP . There won't be any separators unless you 
yank them too (which means you can have different separators, or none at all, 
between different cuts), but if you selected your text linewise, there will be 
a line break between each part (i.e., text won't flow from one cut into the 
next on the same line). You may edit your recipe there if you wish, then save 
it using :w or :x (the latter closes the file window too, it is equivalent to 
:wq with one less keystroke).


In other words, in Vim you can have up to 26 parallel pasteboards without even 
asking for them. :-)


See :help change.txt.



Also, knowing the talent that exists out there in the 

RE: Take Two: Pasteboard sans HTML

2006-10-01 Thread Suresh Govindachar
 
  Calvin Waterbury asked on Sunday, October 01, 2006 3:04 PM for
  a pasteboard feature.

   This is a feature that automatically captures clipboard content
   to a text file that has been designated as the Pasteboard.
   Perhaps an example would clarify. If I had this feature
   implimented in VIM I would do the following:
  
- Open a text ed window
- Set it to be the Pasteboard
- Switch to whatever window I want to capture (webpage text
  like a recipe, another text file, etc.) --- [1]Select the
  first text item --- [2]Copy to clipboard --- [3]Repeat [1]
  and [2] until done.
- Go back to the Pasteboard window and I would see all of my
  captures neatly separated by whatever separator (a line of
  hyphens, equal signs, etc.) I had set in the Options.
- Turn off the Pasteboard
- Save the file.

  [Tony:  OP is asking about copying to a VIM buffer stuff fed to
  the MS Windows clipboard _not_ from other VIM buffers but
  from non-vim applications.]

  One way to implement this feature is by using VIM's support for 
  perl and the Win32::Clipboard module.

  --Suresh



RE: Take Two: Pasteboard sans HTML

2006-10-01 Thread Hari Krishna Dara

On Sun, 1 Oct 2006 at 6:53pm, Suresh Govindachar wrote:


   Calvin Waterbury asked on Sunday, October 01, 2006 3:04 PM for
   a pasteboard feature.

This is a feature that automatically captures clipboard content
to a text file that has been designated as the Pasteboard.
Perhaps an example would clarify. If I had this feature
implimented in VIM I would do the following:
   
 - Open a text ed window
 - Set it to be the Pasteboard
 - Switch to whatever window I want to capture (webpage text
   like a recipe, another text file, etc.) --- [1]Select the
   first text item --- [2]Copy to clipboard --- [3]Repeat [1]
   and [2] until done.
 - Go back to the Pasteboard window and I would see all of my
   captures neatly separated by whatever separator (a line of
   hyphens, equal signs, etc.) I had set in the Options.
 - Turn off the Pasteboard
 - Save the file.

   [Tony:  OP is asking about copying to a VIM buffer stuff fed to
   the MS Windows clipboard _not_ from other VIM buffers but
   from non-vim applications.]

   One way to implement this feature is by using VIM's support for
   perl and the Win32::Clipboard module.

   --Suresh

How about looping in a vim script for changes in clipboard register and
paste it into a buffer everytime a change is detected? The :sleep
command accepts millisecond granularity, so you can tune the wait period
such that you can detect the changes fast enough without seein 100% CPU.

Once you enter into the loop, you can't use the Vim session for anything
else, but then this may not be bad as you are not using Vim during that
time, and you can start other Vim sessions if you still need to use Vim.

-- 
HTH,
Hari

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com