Installation

  1. Install the Windows MSI.
    • This isn't required for the VSIX package, but is recommended.
  2. (Optionally) Install the VSIX extension package for Visual Studio integration.

Configuration

QuickPasteIt will try to read a configuration from your user profile folder in this order:
  • qpi.ini
  • .qpirc
An example configuration:

[DEFAULTS]
author = Me
pastebin = ubuntu

For a list of all available pastebins, type qpi help on the command line.

Usage

From CMD

You can paste any text file from command prompt. Simply call the command-line version of QuickPasteIt (qpi):

C:\> qpi MyCodeFile.cs

The command-line version also supports selecting a different pastebin:

C:\> qpi MyCodeFile.cs ubuntu

For a list of all available pastebins, type qpi help:

C:\> qpi help

     Usage: qpi.exe FILE [PASTEBIN]

 Pastebins: sprunge
            vpaste
            pastebin.com
            ubuntu

From Windows Explorer

Right-click on any text file and select the QuickPasteIt (Pastebin) option:

shellmenu.png

From Visual Studio

  • Right-click on a file in the Solution Explorer to pastebin an entire file.
  • Right-click a selection in the editor to pastebin a code snippet.

Development

Please see the development requirements for information regarding the required development environment.

Adding Pastebins

New pastebin sites can be added by implementing the QuickPasteItLib.IPasteBin interface, which is fairly self-explanatory:

public interface IPasteBin
{
    /// <summary>
    /// Submits the given text to the pastebin.
    /// </summary>
    /// <param name="paste">The text to be pasted.</param>
    /// <param name="lang">The language for syntax highlighting.</param>
    /// <param name="author">The author to appear on the paste (some pastebins require this).</param>
    /// <returns>The URL of the paste on success, an empty string on failure.</returns>
    string SubmitPaste(string paste, PasteLang lang = PasteLang.Plain, string author = "Anonymous");
}
New pastebins must also be added to the pasteBinMap in QuickPasteItLib\QpiConfig.cs:

/// <summary>
/// Maps pastebin name strings to their Types
/// </summary>
public static readonly Dictionary<string, Type> pasteBinMap = new Dictionary<string, Type>
{
    {"sprunge"        ,  typeof (  SprungePasteBin        )},
    {"vpaste"         ,  typeof (  VpastePasteBin         )},
    {"pastebin.com"   ,  typeof (  PastebinDotComPasteBin )},
    {"ubuntu"         ,  typeof (  UbuntuPasteBin         )},
};

Last edited Sep 29, 2012 at 12:38 AM by XeXenon, version 26

Comments

No comments yet.