Home > Clipboard Tools, Plug-in Development, Shared Source > CodeRush Clipboard History

CodeRush Clipboard History

December 21st, 2010

Clipboard History is a visual multi-clipboard viewer and manager, which makes copying and pasting of data a little easier. It allows you to extend the facility of Windows system’s clipboard, beyond its default capability and the disadvantage that you can only copy once before pasting. The next time you copy or cut another snippet, you overwrite the existing clipboard contents. CodeRush helps to keep the clipboard history that you can use to paste any selected fragment again. You can have up to 64 independent fragments and work with each of them separately, persisting these fragments across Visual Studio sessions for future use. If you copy a code fragment, Clipboard History will maintain its syntax highlighting as well:

CodeRush Clipboard History preview

To access the Clipboard History – press Ctrl+Shift+Insert or choose it from the Edit menu:

CodeRush Clipboard History in Edit menu

On the other hand, Visual Studio has a built-in feature called Clipboard Ring. The Clipboard Ring keeps track of the last 20 items you have either cut or copied so you can reuse them over and over again. Repeatedly pressing Ctrl+Shift+V will cycle through the entries in the Clipboard Ring. Each time you press Сtrl+Shift+V, the IDE editor replaces the last entry you pasted from the Clipboard Ring so that you end up with only the last one you selected.

So, what’s the difference between two? Let’s compare:

  • Usability

For example, if you wanted to paste the 10th item in the clipboard ring, you need to press CtrlShiftV 10 times. If you don’t know what the position of the item in the ring, you have to press the shortcut numerous times, until you find the item you need. Using the Clipboard History, all you need is to click once on the item you need.

  • Visual presentation

On the other hand, there is another option for the Clipboard Ring so you don’t have to cycle through the clipboard ring every time. You can use the Toolbox for this purpose, where you can drag the text you want to use in the future. Visual Studio will create an entry in Toolbox, which can be pasted by dragging it from Toolbox or by double clicking the toolbox entry. This functionality is almost the same as the Clipboard History, but take a look at the visual presentation of the copied text:

CodeRush Clipboard History and Clipboard Ring comparison

Overall, it’s up to you to choose what feature to use. But bear in mind, that there is another significant advantage of the Clipboard History – it has code conversion capability for multi-language projects. For example, if you copy CSharp code and try to paste it into Visual Basic source file, you can choose whether the code should be converted into the target source file language (Visual Basic in this case):

CodeRush Clipboard History code conversion

On the Clipboard History options page in the Options Dialog, there are a few simple options available:

  • Option whether to persist clipboard history across Visual Studio sessions
  • Color of the clipboard history items selector
  • Number of clipboard items to maintain (1 – 64) by choosing the rows and columns size

CodeRush Clipboard History options page

The Clipboard History feature is an open source; you can find it in the CodeRush Shared Source solution. Additionally, there is series of blog posts from chief architect of IDE Tools Mark Miller, which describes the step-by-step process of how this CodeRush feature is built. Here they are:

  1. Clipboard History Plug-in for Visual Studio with the DXCore
  2. Listening to Clipboard Change Events and Creating the ClipboardHistory Class
  3. Integrating CodeView controls with the Clipboard History Plug-in
  4. Adding a Cursor and Keyboard Support to the Clipboard History Plug-in
  5. Fixing the Start Position and Dynamically Updating the Clipboard History Form
  6. Adding Custom Menu Items to Visual Studio, and Mouse Support for the Clipboard History Plug-in
  7. Persisting Clipboard History Across Sessions with our DXCore Visual Studio Plug-in
  8. Creating an Options Page for the Clipboard History, our DXCore/Visual Studio Plug-in
  9. Adding Default Settings and a Custom Title to the DXCore Options page of our Clipboard History plug-in for Visual Studio
  10. Maximizing the Active CodeView in our Clipboard History Plug-in for Visual Studio
  11. Improving Discoverability with our Clipboard History DXCore Plug-in for Visual Studio
  12. Language Translation on Paste with the Clipboard History Plug-in
Products: CodeRush Pro
Versions: 10.1 and up
VS IDEs: any
Updated: Dec/22/2010
ID: C043

Similar Posts:

  1. No comments yet. Be the first and leave a comment!