Sublime Forum

Is there a plugin to save clipboard history on exit?

#1

Is there a plugin to save clipboard history on exit? I tried searching the Internet; but, wasn’t sure what to look for.

Any help would be greatly appreciated.

1 Like

#2

That’s a great idea, There is apackage called “ClipboardManager” give it a try, and if does not do what you are suggesting, just post again, I have half of the done for this, because of the package SideBarFolders

1 Like

#3

Thanks for sharing own good ideas.

0 Likes

#4

Do you need this functionality only inside ST? Depending on the platform you’re working on, you might be interested in using a system-wide clipboard manager that works with all programs, not only ST. I’ve been using one for the last couple of years and it’s become indispensable to my daily use.

0 Likes

#5

if you are on OSX, i suggest to get LaunchBar which has a wonderful clipboard history manager!

0 Likes

#6

There are actually tons of general clipboard managers for Windows (probably for Macs too); however, they’re really not what I’m looking for. All I wanted was for SublimeText to remember clipboard history of the files it reopens. So, Z and Y still work if the files were reopened by SublimeText.

I’m guessing the people who already know how to make Sublime Text addons, this could be relatively easy to do.

0 Likes

#7

Remembering each file’s history and remembering the clipboard are two different things. Which of the two do you think you’re after?

Based on the above description, is this any good for you? I haven’t tried it, but it kind of seems similar to what you’ve described:

sublime.wbond.net/packages/ChangeList

As it mentions at the bottom:

1 Like

#8

The plugin below must work, but it doesn’t :frowning:
Look like plugin_unloaded() is not called when ST3 exit (the create file code commented doesn’t actually create the file).
IMHO, it’s a bug, but I won’t hold my breath waiting a fix, I somewhat lost my faith in the future of ST3.

I post the code if someone want to look at it.

[code]import sublime, sublime_plugin
import pickle
import binascii
import Default.paste_from_history as past_from_history

def save_paste_from_history():
data = pickle.dumps(past_from_history.g_clipboard_history)
sublime.active_window().settings().set(‘clipboard_history’, binascii.hexlify(data).decode())

def load_paste_from_history():
data = sublime.active_window().settings().get(‘clipboard_history’)
if data is not None:
past_from_history.g_clipboard_history = pickle.loads(binascii.unhexlify(data))

def plugin_loaded():
load_paste_from_history()

def plugin_unloaded():
# with open(‘c:\unloaded.txt’, ‘w’) as f:
# f.write(‘UNLOADED’)
save_paste_from_history()[/code]

0 Likes

#9

Yeah, sorry I didn’t mean clipboard history, I meant history of each file changes; so, for people who have “Hot File” and/or “Remember open files” settings enabled in ST2/3, when the user reopens the files, the Z and Y changes history would still work.

I’m not sure what that Changelist package does. I installed it, but when I restarted ST3, none of my changes were remembered when using Z and Y hotkeys. It seemed to have hotkeys of it’s own; but they didn’t seem to do much either.

Anyone know if there’s something that actually does this?

[quote=“Kicweed”]Remembering each file’s history and remembering the clipboard are two different things. Which of the two do you think you’re after?

Based on the above description, is this any good for you? I haven’t tried it, but it kind of seems similar to what you’ve described:

sublime.wbond.net/packages/ChangeList

As it mentions at the bottom:

[/quote]

1 Like