Code Monkey home page Code Monkey logo

vim-minisnip's Introduction

Note:

This repo has been forked twice (joereynolds and fcpg), see the Fork Notes below.

           _       _           _
 _ __ ___ (_)_ __ (_)___ _ __ (_)_ __
| '_ ` _ \| | '_ \| / __| '_ \| | '_ \
| | | | | | | | | | \__ \ | | | | |_) |
|_| |_| |_|_|_| |_|_|___/_| |_|_| .__/
                                |_|

Minisnip allows you to quickly insert "templates" into files. Among all the other snippet plugins out there, the primary goal of minisnip is to be as minimal and lightweight as possible.

There is a deoplete source available here

Installation

Use your favourite plugin manager to install minisnip:

Plug 'KeyboardFire/vim-minisnip'
cd ~/.vim/bundle
git clone git://github.com/KeyboardFire/vim-minisnip.git
NeoBundle 'KeyboardFire/vim-minisnip'

Usage

To get started with minisnip, create a directory called ~/.vim/minisnip. Then placing a file called foo inside of it will create the foo snippet, which you can access by typing foo<Tab> in insert mode.

Filetype-aware snippets are also available. For example, a file called _java_main will create a main snippet only when filetype=java, allowing you to add ex. a _c_main snippet and so on.

Here is a demo of the basic features of minisnip:

demo GIF 1

Here is another example that shows how arbitrary code can be executed from within a snippet, allowing dynamic snippets based on the file name or other conditions:

demo GIF 2

View the docs to learn the snippet syntax and options.

View the examples to see syntax examples.

Minisnip is licensed under MIT.

Fork notes:

  • Added some options (eg. g:minisnip_triggerornop, g:minisnip_nomaps)
  • Added some basic support for expansion from function context
  • Made a few minor fixes (search() opts, mark preserving, useless <script> etc.)
  • Refactored some code and reformatted

I already got a heavily customized <Tab> key, and I wanted to integrate minisnip into that framework. This essentially meant being able to expand from a function call, and avoiding inserting keys if minisnip does not trigger.

This (joereynolds) fork has the following (backwards compatible) fixes/improvements:

  • Indent snippets when inserted
  • Allow special characters as snippet names
  • Autoload the plugin
  • Installation instructions in README
  • Avoid multiple loads of the plugin

It does not break compatibility with the original vim-minisnip, only improves it.

vim-minisnip's People

Contributors

arp242 avatar chaucerbao avatar fcpg avatar gowther-zoho avatar joereynolds avatar lemonboy avatar robinthrift avatar tckmn avatar trevordmiller avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.