https://github.com/habamax/vim-minisnip
snipMate.vim based snippets plugin for vim
https://github.com/habamax/vim-minisnip
snippets vim
Last synced: about 1 year ago
JSON representation
snipMate.vim based snippets plugin for vim
- Host: GitHub
- URL: https://github.com/habamax/vim-minisnip
- Owner: habamax
- Created: 2021-08-23T08:14:01.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-02-24T15:10:08.000Z (over 4 years ago)
- Last Synced: 2025-05-05T02:36:08.872Z (about 1 year ago)
- Topics: snippets, vim
- Language: Vim script
- Homepage:
- Size: 40 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
Awesome Lists containing this project
README
********************************************************************************
vim-minisnip: snipmate.vim based snippets plugin
********************************************************************************
Snippets plugin based on `snipmate.vim`_.
.. _snipmate.vim: https://github.com/msanders/snipmate.vim
Installation
============
Use plugin manager of your choice or
.. code:: sh
git clone --depth=1 https://github.com/habamax/vim-minisnip.git ~/.vim/pack/plug/start/vim-minisnip
Default mappings
================
To use default mappings:
.. code:: vim
let g:minisnip_default_maps = 1
This would map :kbd:`Tab`, :kbd:`Shift` + :kbd:`Tab` and :kbd:`Ctrl` + :kbd:`r`
:kbd:`Tab` in insert and select modes.
To map your own keys use ```` mappings:
.. code:: vim
let g:minisnip_default_maps = 0
imap (minisnipTrigger)
smap (minisnipTrigger)
imap (minisnipBackwards)
smap (minisnipBackwards)
imap (minisnipShowAvailable)
Default snippets
================
There are no default snippets, create your own:
.. code:: sh
mkdir -p ~/.vim/snippets
Example snippets
----------------
Note that `snippet` files use ````\s for indenting, examples down below are
rendered with spaces.
Global
~~~~~~
.. code:: sh
vim ~/.vim/snippets/_.snippet
.. code:: snippet
snippet dd
`strftime("%Y-%m-%d")`
snippet ddt
`strftime("%Y-%m-%d %H:%M")`
snippet me
Your Name
Filetype
~~~~~~~~
.. code:: sh
vim ~/.vim/snippets/tex.snippet
.. code:: snippet
snippet em
\emph{${1}}
snippet s
\strong{${1}}
snippet i
\textit{${1}}
snippet b
\textbf{${1}}
snippet u
\underline{${1}}
snippet t
\texttt{${1}}
snippet begin
\begin{${1:env}}
${2}
\end{$1}
snippet enum
\begin{enumerate}
\item ${1}
\end{enumerate}
snippet item
\begin{itemize}
\item ${1}
\end{itemize}
External Snippets
=================
If you would like to use community-maintained snippets, install `vim-snippets`_.
It has a collection of snippets ``vim-minisnip`` should be able to work with as a fork of ``snipMate.vim``.
.. _vim-snippets: https://github.com/honza/vim-snippets