All Projects → Jorengarenar → miniSnip

Jorengarenar / miniSnip

Licence: MIT license
Lightweight snippet plugin for Vim

Programming Languages

Vim Script
2826 projects

Projects that are alternatives of or similar to miniSnip

Ncm R
R autocompletion for Neovim and vim 8 📝 📊 ⚡️
Stars: ✭ 102 (+126.67%)
Mutual labels:  snippets, vim-plugin
SimpleSnippets.vim
Simple snippet support for your Vim and Neovim
Stars: ✭ 86 (+91.11%)
Mutual labels:  snippets, vim-plugin
Vim Vsnip
Snippet plugin for vim/nvim that supports LSP/VSCode's snippet format.
Stars: ✭ 224 (+397.78%)
Mutual labels:  snippets, vim-plugin
LeaderF-snippet
Intuitive Way to Use Snippet
Stars: ✭ 38 (-15.56%)
Mutual labels:  snippets, vim-plugin
vim-snipp-snapp-snut-and-the-legend-continues
💇 (Experimental) Vim snippet plugin
Stars: ✭ 24 (-46.67%)
Mutual labels:  snippets, vim-plugin
htmlrecipes
A collection of quick copy HTML snippets for a variety of common scenarios.
Stars: ✭ 113 (+151.11%)
Mutual labels:  snippets
snippets
The Doom Emacs snippets library
Stars: ✭ 248 (+451.11%)
Mutual labels:  snippets
middleman-snippets
⚡ Library of commonly used snippets for Middleman websites
Stars: ✭ 27 (-40%)
Mutual labels:  snippets
vscode-extension
Link your code and commits to a video recording and explain your code with video.
Stars: ✭ 67 (+48.89%)
Mutual labels:  snippets
PICO-8.vim
A vim plugin package for PICO-8 programming.
Stars: ✭ 42 (-6.67%)
Mutual labels:  vim-plugin
vim-solidity
Syntax highlighting for Solidity in Vim
Stars: ✭ 44 (-2.22%)
Mutual labels:  vim-plugin
nvim-contabs
contextual tabs for vim/neovim
Stars: ✭ 20 (-55.56%)
Mutual labels:  vim-plugin
codecolorer
WordPress plugin which allows you to insert code snippets into the post with nice syntax highlighting.
Stars: ✭ 56 (+24.44%)
Mutual labels:  snippets
jupyter boilerplate
Adds a customizable menu item to Jupyter (IPython) notebooks to insert boilerplate snippets of code
Stars: ✭ 69 (+53.33%)
Mutual labels:  snippets
twig.vim
Twig syntax highlighting, indentation, neocomplete and UltiSnips snippets in Vim
Stars: ✭ 30 (-33.33%)
Mutual labels:  snippets
vscode-gcode-syntax
G Code Language Extension for Visual Studio Code. Turn VSCode into a fully capable G-Code editor, including language support & more.
Stars: ✭ 59 (+31.11%)
Mutual labels:  snippets
pipet
Personal snippet manager, store bits of text.
Stars: ✭ 21 (-53.33%)
Mutual labels:  snippets
Sublime-GameMaker-Studio-Language-Bundle
A sublime bundle for GameMaker Language (GML)
Stars: ✭ 32 (-28.89%)
Mutual labels:  snippets
searchReplace.vim
Search & Replace, simply & efficiently [neovim only]
Stars: ✭ 26 (-42.22%)
Mutual labels:  vim-plugin
linden-scripting-language
Linden Scripting Language (LSL / Second Life) files for your editor.
Stars: ✭ 53 (+17.78%)
Mutual labels:  snippets
        ┏━━━┓
        ┃┏━┓┃
┏┓┏┳┳━┓┏┫┗━━┳━┓┏┳━━┓
┃┗┛┣┫┏┓╋╋━━┓┃┏┓╋┫┏┓┃
┃┃┃┃┃┃┃┃┃┗━┛┃┃┃┃┃┗┛┃
┗┻┻┻┻┛┗┻┻━━━┻┛┗┻┫┏━┛
                ┃┃
                ┗┛

miniSnip is lightweight and minimal snippet plugin written in Vim Script.

Installation

Use your favourite plugin manager to install miniSnip:

minPlug:

MinPlug Jorengarenar/miniSnip

vim-plug:

Plug 'Jorengarenar/miniSnip'

Vim's packages

cd ~/.vim/pack/plugins/start
git clone git://github.com/Jorengarenar/miniSnip.git

NeoBundle

NeoBundle 'Jorengarenar/miniSnip'

Usage

To get started with miniSnip, in your runtime (on UNIX usually: ~/.vim) create a directory called miniSnip/all. Then placing a file called foo.snip inside it will create the foo snippet, which you can access by typing foo<C-j> in insert mode.

Filetype-aware snippets are also available. For example, a file called main in ~/.vim/miniSnip/java/main.snip will create a main snippet only when filetype=java, allowing you to add a main for C, main for C++ and so on.

See the documentation to learn the snippet syntax and options.

Features

  • default values of placeholders (e.g. <{example}>)
  • references to previous tags (e.g. <{~2}> refers to second placeholder)
  • evaluation of Vim functions (e.g. <{!expand('%')}>)
  • ins-completion function
  • <{+}> will be targeted last (equivalent of $0 in UltiSnips)
  • filetype-aware snippets
  • changing delimiters, snippet file filetype etc. (:h miniSnip-configuration)
  • local snippets (:h g:miniSnip_local)
  • named placeholders (:h g:miniSnip_named)
  • global and local to buffer configuration (:h g:miniSnip-configuration)

Examples

  • c/incl.snip
? Include header file
#include "<{!substitute(expand('%:t'), '\.c', '\.h', '')}>"
  • html/html.snip
? HTML basic structure
$ `{{` `}}`
<!DOCTYPE html>
<html lang="{{en}}">
<head>
  <meta charset="UTF-8">
  <title>{{Joren}}</title>
  <meta name="author" content="{{~1}}">
  <meta name="description" content="{{}}">
  <meta name="keywords" content="{{example}}">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="{{style.css}}">
</head>
<body>
  {{}}
</body>
</html>
  • sql/join_no_match.snip
SELECT <{table1}>.<{ID_1}>
FROM <{~1}>
LEFT JOIN <{table2}> ON <{~1}>.<{~2}> = <{~3}>.<{ID_2}>
WHERE <{~3}>.<{~4}> IS NULL
  • sh/wrapper_exec.snip
for dir in $(echo "$PATH" | tr ":" "\n" | grep -Fxv "$(dirname $0)"); do
    [ -x "$dir/$(basename $0)" ] && exec "$dir/$(basename $0)" $@
done

For more information, see the documentation.


Based on vim-minisnip

Main differences:

  • reference tags aren't relative, but absolute, i.e. <{~1}> will refer to first placeholder insted to the previous, <{~2}> will refer to the second instead of the penultimate
  • references aren't in quotes
  • references to bigger numbers than 9
  • descriptions (:h g:miniSnip_descmark)
  • option to change delimiters for specific snippet (:h g:miniSnip_delimChg)
  • extending filetypes (:h g:miniSnip_extends)
  • cursor at the end of snippets without placeholders, not the beginning
  • directories instead of prefixes for snippets file management
  • respect expandtab
  • one final placeholder (:h g:miniSnip_finalTag) instead of final delimiters
  • local snippets
  • named placeholders
  • configurable character class used to get snippet name
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].