Neovim for Beginners — Snippets

Faster coding using snippets.

5 min readMar 12, 2022


Neovim for Beginners — Snippets

In the previous article, we configured several code snippets plugins to help us write test cases. In this article, we are going to leverage code snippets to help us code faster.

We are going to

  • Configure and re-use existing code snippets available in the VS Code marketplace.
  • Write our code snippets in multiple ways.

This article is part of the Neovim for Beginners series.

The Neovim configuration files can be found in this repository.

Use Existing Code Snippets

We configured rafamadriz/friendly-snippets and honza/vim-snippets in the previous article to help us write test cases, using the LuaSnip snippet engine.

Before diving into writing our code snippets, let’s see how we can re-use the code snippets available from the VS Code marketplace.

The VS Code snippets files are written in JSON, support C-style comments, and can define an unlimited number of snippets. The snippets support most TextMate syntax for dynamic behavior, intelligently format whitespace based on the insertion context, and allow easy multiline editing.

We are going to re-use the VS Code ES7+ React/Redux/React-Native snippets extension which currently has more than 4.6 million installs. The steps should be the same for snippet extensions for other languages.

Snippets JSON

From the snippets plugin GitHub repository, we download the generated JSON file and save the file under the snippets/typescript folder.


Download the package.json file and save the file again under the snippets/typescript folder.

If we look into the package.json file, we can see the path points to the lib/snippets folder.




Software engineer, Data Science and ML practitioner.