A Vim plugin for syntax highlighting and editing of rsnip snippet files.
- Syntax highlighting for rsnip files
- Filetype detection
- Folding by snippet sections
- Basic snippets for creating new rsnip entries
- Commands for working with rsnip files
Using Vim-Plug
Plug 'username/vim-rsnip'Using Packer
use 'username/vim-rsnip'Using Vundle
Plugin 'username/vim-rsnip'Clone this repository into your Vim's packages directory:
mkdir -p ~/.vim/pack/plugins/start
git clone https://github.com/username/vim-rsnip.git ~/.vim/pack/plugins/start/vim-rsnipFor Neovim:
mkdir -p ~/.config/nvim/pack/plugins/start
git clone https://github.com/username/vim-rsnip.git ~/.config/nvim/pack/plugins/start/vim-rsnipThe syntax highlighting will be automatically applied to files with a .rsnip extension.
:RsnipNewSection- Insert a new section template:RsnipNewSnippet- Insert a new snippet template
In rsnip files, the following mappings are available:
<leader>rs- Create a new section<leader>rn- Create a new snippet
You can customize the plugin by setting variables in your vimrc:
" Custom section markers (default: * name {{{ * and * }}} name *)
let g:rsnip_section_start = '* name {{{ *'
let g:rsnip_section_end = '* }}} name *'
" Custom snippet markers (default: --- name and ---)
let g:rsnip_snippet_start = '--- name'
let g:rsnip_snippet_end = '---'MIT