12

I'm searching for code snippets manager for Windows which fulfills these criteria

Required features

  • searching through snippets, displaying list of search results
  • tree organization of snippets (at least with one sublevel - i.e. not just a plain list)

Important features

  • mature design with keyboard on mind – having enough keyboard acceleratos and shortcuts, not requiring mouse for searching, editing, pressing common buttons etc.
  • possible access to snippets from outside the tool (i.e. snippets are stored in files or some standard database so I can 'own' the snippets even if application is unavailable or fails)
  • free (best if open source), but I'm also open to commercial ones under some €30 (no subscription)

Other features (syntax highlighting, online account, ...) are welcome but they don't matter too much to me. I will downvote applications not working at least partially well with keyboard.

3 Answers 3

1

Visual Studio Code

Visual Studio Code is a free, open source, fast, lightweight editor perfect for your basic needs, but also extensible enough that you could mostly replace Visual Studio with it if you wanted to.

Tree Organization

A directory structure of your choosing should provide the tree organization you are looking for.

Search

I use Ctrl+Shift+F to open the search panel constantly, you can search with plain text or regular expressions, exclude files or directories, search and replace, and as you requested, list all results (in real time as you type, it feels very satisfying).

Mature Design

VS Code is super popular for a reason, and if you don't like the default key-bindings, you can change them (there are extensions for sublime, atom, vim keymaps too).

Access from outside the application

If you store your snippets in files, organized in folders, you can open them in any text editor.

Free and Open Source

VS Code is free and open source, while also having the backing of Microsoft.

Other Features

Language Support: Visual Studio Code has support for many languages, so you'll be able to run code snippets using keyboard shortcuts, GUI, or command line.

Git Integration: I would recommend checking the whole code snippets directory into source control, the git integration in Visual Studio Code is good. This will allow you to keep track of changes and use your code snippets across devices.

Keyboard Shortcuts: Here is a handy keyboard shortcut reference, but even if you just remember how to open the command palette (ctrl+shift+p) you can search for whatever command/shortcut you're trying to run.


I'm not affiliated with Microsoft or Visual Studio Code at all, I just really like the editor.

1

Give MassCode a shot. Has code completion, formatting, syntax highlighting, tags.

0

Git Repository In WSL

The Windows Subsystem for Linux is very handy for managing all types of source code. It allows you to easily version control, distribute, and backup your snippets with git. Plus it places a lot of helpful tools at your finger tips (eg: grep, find, sed, vim).

Setup:

  • Install a subsystem (or use a bash emulator)
  • Make a snippet folder
    • Use git if online account/backups are useful

Features:

  • Organize snippets in whatever folder structure you choose
  • Search with Bash commands (eg: grep 'var x = 7;' . -R)
  • Very keyboard friendly (eg: aliases)
  • Use any editor you want (eg: vim, emacs, nano)
  • Accessible outside WSL (eg: use C drive /mnt/c/Users/miroxlav/snippets)
  • Easily send to clipboard (eg: cat snippet.java | clip.exe)
  • Run snippets (eg: python snippet.py)
  • Free
3
  • 1
    Thanks for the answer. Interesting idea, will think about the git concept. But from your answer, it does not appear to be sufficiently interactive and convenient for standard UI users. I am rather a developer (Visual Studio, SSMS, Eclipse, Notepad++) than a sysOps worker, so grep, find, sed, vim is not something I would prefer to use daily. My normal programming almost never involves a need of entering the command line.
    – miroxlav
    Jul 17, 2019 at 9:35
  • For a UI-friendly solution, you could use a git UI (eg: SourceTree, Git Kraken) with your favorite editor (eg: Notepad++, Sublime) with its file navigation system. Jul 17, 2019 at 14:40
  • 1
    Yes, git is not an issue. It basically nicely covers a versioning part, maybe a sync and a backup. But the rest (quick search, smart insertion, good keyboard support) may not be so practical when performed from command line (grep, find, sed, vim) instead of tool inside an IDE.
    – miroxlav
    Jul 17, 2019 at 14:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.