Show HN: A simple app to make Ctrl+V paste unformatted text by default (Windows)

  • DevComrade now monitors Windows Clipboard for text with rich formatting and replaces it with plain text by default (using Win32 Clipboard Monitoring API). This enables pasting plain text by default for all Windows applications using their native UI and keyboard bindings. It can be controlled by the Win+F10 menu or via the .config file.
  • You can now press Control+Enter to hide the Internal Notepad (invoked with Alt+Ins) and paste its content into the currently active application.

DevComrade is a free and open-source Windows copy/paste/run productivity improvement tool for developers.

Copy-pasting from the online docs, StackOverflow or numerous blogs can be a tedious and sometimes even a dangerous task. Does the following sound familiar: you paste some text from a web page into a Terminal command line, and it gets executed immediately, before you even have a chance to edit it? Only because there was a CR/LF character at the end of the clipboard text.

Or, have you ever been annoyed with some broken formatting, indentation, inconsistent tabs/spaces when you paste a piece of code into Visual Studio Code editor, a blog post or an email message? A typical workaround for that is to use the good old Notepad.exe as a buffer.

Now I have two dedicated hotkeys for that, Win+Ins (paste as single line) and Win+Shift+Ins (paste as multiple lines), which uniformly work across all apps and browsers. It also removes the trailing empty lines and the last line’s CR/LF ending, so nothing gets automatically executed.

One other source of disappointment for me has always been how custom keyboard hotkeys work with Windows Shell shortcuts. It is a common struggle to find a convenient hotkey combination that still can be assigned to start a custom app. E.g., it is impossible to use Win+Shift|Alt|Ctrl+Key combos for that. And when it can be assigned, it may take up to 10 seconds for the program to actually start when the hotkey is pressed.

DevComrade has been made to solve this problem, too. It allows assigning a customizable action to (almost) any hotkey combination, and comes with an extensive set of predefined actions for pasting text and launching apps.

Additional actions can be added as C# scriptlets in the .config file. E.g., generating a GUID:

<hotkey name="InsertGuid" menuItem="Insert &amp;Guid" isScript="true">
    <!-- this is an example of a C# scriptlet handler -->
    <![CDATA[
        await Host.FeedTextAsync(Guid.NewGuid().ToString("B").ToUpper(), Token);
    ]]>
</hotkey>

When it comes to pasting text, DevComrade is different from many similar utilities (e.g., from the still-excellent Puretext) in how it uses Win32 simulated input API to elaborately feed the text into the currently active window, character by character as though it was typed by a person. For example, it works well with Google’s Secure Shell App Chrome extension.

DevComrade is a free and open-source software licensed under Apache License 2.0. It’s built with .NET Core 3.1 SDK and uses Windows Forms for its very simple, context-menu-style UI.

It is still very much a work in progress. Some CI logic for publishing a Chocolatey package (including a code-signed executable) will be implemented soon and this page will be updated. Meanwhile, to build and run from the source:

  • Download and install .NET Core 3.1 SDK, if you haven’t got it already. That’s the only needed prerequisite tool. Visual Studio or Visual Studio Code aren’t required to build this app.

  • Download and unzip the source, or use git to clone the repo to a folder of your choice, e.g.:

    mkdir DevComradeRepo && cd DevComradeRepo
    git clone https://github.com/postprintum/devcomrade .
    
    
  • Build and run:

    .Packagemake-and-run.bat
    
    
  • Or do that manually:

    dotnet publish -r win10-x64 -c Release --self-contained false -p:PublishTrimmed=false .DevComrade
    
    start .DevComradebinReleasenetcoreapp3.1win10-x64publishDevComrade.exe
    
    

Once run, DevComrade shows up as DevComrade Icon icon in the system tray. Some of the features to try out:

  • Press Win+F10 to see the list of the available shortcuts and actions.
  • Copy some code into the Clipboard and try Alt+Ins, to see it pasted into the instant internal Notepad pop-up window. Press Esc to simply hide it when finished, or Win+ to open it again.
  • Press Shift+Win+E to open Windows Terminal then Win+Ins to paste the Clipboard’s content as a single line of text. It won’t get executed until your press Enter.
  • Copy any URL into clipboard (e.g., from a console window output, spaces and broken lines are OK), then press Shift+Win+O to open it in your default web browser.

This tool has been working well for my own personal needs, but outside that its future depends on your feedback. Feel free to open an issue or send me a DM on Twitter.


DevComrade Alt+Ins Notepad

Leave a Reply