DEV Community

Cover image for How to manage your code snippets, the easy way
Adrian Matei
Adrian Matei

Posted on • Updated on

How to manage your code snippets, the easy way

Remember how I manage my dev bookmarks to save time and nerves? Well, many times I find myself bookmarking links just for some pieces of code that I find in the link. I would then add the code snippets the bookmark's description and the rest is not that relevant. Or there are times when I know I have this piece of code some "old" project and I need to really dig for some time to get it...

Well, to make my life easier in these cases I implemented a feature to save code snippets on Codever. In one entry you can save

  • one or more related code snippets
  • add a title
  • tags to it
  • (optionally) a source URL for your inspiration
  • and comments about the snippets.

It's similar to Github's gists, but I think is user friendlier and easier to browse through my snippets.

Save code snippets

Browser Extension

You can use the Codever browser extensions, which is open source to help you easily save code snippets from webpages. The extension is available for:

Just select the code snippet and then right click or click on the extension:
Save code snippet chrome extension in action

Bookmarklet

If for some reason you can't use browser extension or don't want to permit popup windows (in the case of Firefox they are disabled by default) you can use our +Codever bookmarklet to achieve the same result:

Save snippet via bookmarklet

IntelliJ Plugin

If you use IntelliJ products I have developed a plugin to make it ease from IDE:

Save to Codever from IntelliJ Plugin showcase

The plugin is available to download and install in
JetBrain Plugins Repository and the source code is available on Github

For everything else

You can save code snippets from some place else via the + > Snippet option in the menu bar:

Save snippet from menu bar


Search code snippets on Codever

To search for code snippets just select My Snippets option in the search bar:

Search my snippets

You can use a web search on AlfredApp or similar, with a custom query for a quick access - https://www.codever.land/search?q={query}&sd=my-snippets

Next steps

I have a couple of ideas in mind how will I extend this functionality. Among others:

  • create Visual Studio Code extension similar to the IntelliJ Plugin present before to save code snippets directly from VS Code

What do you think? Is it something you might use? I hope you can give it a try and leave your feedback in the comments bellow. Thanks

Top comments (0)