Author Topic: Multiple Named Clipboards Needed  (Read 6406 times)

jqphantom

  • Junior Community Member
  • Posts: 3
  • Hero Points: 0
Multiple Named Clipboards Needed
« on: June 29, 2009, 06:27:17 PM »
I want to program keys like this: Ctrl-Alt-1 copies a word (variable name) to named clipboard c1, Ctrl-Alt-2 to named clipboard c2, and so forth up to c9. Then, Alt-1 would paste the contents of clipboard c1 into the document, Alt-2 would paste clipboard c2, etc., up to Alt-9.

The aim is a facility where I can separately copy a bunch of variables, say, from var or int declarations, over to statements that use the variable names. When I need the first variable, I just hit Alt-1, and so on. I have found this technique to bump up my productivity a bunch with SAS code (using ED for Windows), but it would work with other languages, as well. It is much faster than using the single default clipboard for one variable at a time; I can pepper my code with one of the chosen set of variables very quickly, at will.

Can someone tell me exactly how I could do this? I am sure it can be done with macros, I just don't know the details.

(Update: I first posted this question in 2007, but I was unable to utilize the answer. Does anyone have a relatively simple solution to this need?)

Thanks!

Michael M./jqphantom

chrisant

  • Senior Community Member
  • Posts: 1410
  • Hero Points: 131
Re: Multiple Named Clipboards Needed
« Reply #1 on: June 29, 2009, 07:39:32 PM »
I don't know how to bind keys to named clipboards.

Instead, I just copy a bunch of things, and then when I want to paste I just use the Ctrl+Shift+V key to pop up the list of recent clipboards, and select which one I want to paste.  It becomes the default clipboard (for subsequent plain Ctrl+V presses) until I use Ctrl+Shift+V to later choose a different clipboard to paste.

Once I found Ctrl+Shift+V, I don't think I will ever use named clipboards again.  For me, Ctrl+Shift+V is much simpler and faster, and makes it easy to find/use stuff I copied recently.  The recent clipboards are even saved across sessions.

Maybe it will work for your purposes, as well, I don't know.
HTH.

MindprisM

  • Senior Community Member
  • Posts: 127
  • Hero Points: 8
Re: Multiple Named Clipboards Needed
« Reply #2 on: September 07, 2009, 10:00:23 AM »
Something like this:
Code: [Select]
defeventtab default_keys;
def  'C-A-0'= copy_clip_lastkey;
def  'C-A-1'= copy_clip_lastkey;
def  'C-A-2'= copy_clip_lastkey;
def  'C-A-3'= copy_clip_lastkey;
def  'C-A-4'= copy_clip_lastkey;
def  'C-A-5'= copy_clip_lastkey;
def  'C-A-6'= copy_clip_lastkey;
def  'C-A-7'= copy_clip_lastkey;
def  'C-A-8'= copy_clip_lastkey;
def  'C-A-9'= copy_clip_lastkey;

def  'A-0'= paste_clip_lastkey;
def  'A-1'= paste_clip_lastkey;
def  'A-2'= paste_clip_lastkey;
def  'A-3'= paste_clip_lastkey;
def  'A-4'= paste_clip_lastkey;
def  'A-5'= paste_clip_lastkey;
def  'A-6'= paste_clip_lastkey;
def  'A-7'= paste_clip_lastkey;
def  'A-8'= paste_clip_lastkey;
def  'A-9'= paste_clip_lastkey;



_command int copy_clip_lastkey() name_info(','VSARG2_MARK|VSARG2_READ_ONLY|VSARG2_TEXT_BOX|VSARG2_REQUIRES_EDITORCTL)
{
  id := event_to_bookmark_name(event2name(last_event()));
  return copy_to_clipboard('clip-'id);
}

_command int paste_clip_lastkey() name_info(','VSARG2_MARK|VSARG2_READ_ONLY|VSARG2_TEXT_BOX|VSARG2_REQUIRES_EDITORCTL)
{
  id := event_to_bookmark_name(event2name(last_event()));
  return  paste('clip-'id);
}

srouleau

  • Community Member
  • Posts: 68
  • Hero Points: 4
Re: Multiple Named Clipboards Needed
« Reply #3 on: September 07, 2009, 06:15:48 PM »
Once I found Ctrl+Shift+V, I don't think I will ever use named clipboards again.  For me, Ctrl+Shift+V is much simpler and faster, and makes it easy to find/use stuff I copied recently.  The recent clipboards are even saved across sessions.

Duh.  Now I just gotta remember to press Ctrl-Shift-V, and to train my fingers to do it.

I think I'm using SE like I'm using MSFT Word: barely scratching the surface.... :)

lambertia

  • Senior Community Member
  • Posts: 382
  • Hero Points: 14
  • I have nothing sufficiently witty to say.
Re: Multiple Named Clipboards Needed
« Reply #4 on: September 07, 2009, 11:48:07 PM »
There is a feature request into SE to improve upon the clipboard windows to allow us to use grep like searches ala the fast open dialog box to choose the entry to past.

i.e., press Ctrl-Sift-V and type fred to reduce the clipboard list to those entries only containing fred. Hopefully this will make the next release.

See http://community.slickedit.com/index.php?topic=4897.0