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.