├── .gitignore ├── snippets ├── _php_placeholder ├── order ├── test ├── namedplaceholder ├── skipme ├── multilinetest └── backref ├── examples ├── _javascript_log ├── _gitcommit_commit ├── _javascript_function ├── _javascript_import ├── _javascript_module └── _javascript_test ├── ftdetect └── minisnip.vim ├── .travis.yml ├── syntax └── minisnip.vim ├── LICENSE ├── plugin └── minisnip.vim ├── README.md ├── test └── minisnip.vader ├── doc └── minisnip.txt └── autoload └── minisnip.vim /.gitignore: -------------------------------------------------------------------------------- 1 | /doc/tags 2 | -------------------------------------------------------------------------------- /snippets/_php_placeholder: -------------------------------------------------------------------------------- 1 | I am in php! 2 | -------------------------------------------------------------------------------- /snippets/order: -------------------------------------------------------------------------------- 1 | {{-second-}} {{+first+}} 2 | -------------------------------------------------------------------------------- /snippets/test: -------------------------------------------------------------------------------- 1 | This is a test snippet 2 | -------------------------------------------------------------------------------- /examples/_javascript_log: -------------------------------------------------------------------------------- 1 | console.log({{++}}) 2 | -------------------------------------------------------------------------------- /examples/_gitcommit_commit: -------------------------------------------------------------------------------- 1 | {{++}} (close #{{++}}) 2 | -------------------------------------------------------------------------------- /examples/_javascript_function: -------------------------------------------------------------------------------- 1 | ({{++}}) => {{++}} 2 | -------------------------------------------------------------------------------- /snippets/namedplaceholder: -------------------------------------------------------------------------------- 1 | {{+This is a test+}} 2 | -------------------------------------------------------------------------------- /examples/_javascript_import: -------------------------------------------------------------------------------- 1 | import {{++}} from {{++}} 2 | -------------------------------------------------------------------------------- /snippets/skipme: -------------------------------------------------------------------------------- 1 | {{+first+}} {{+~\~1+}} {{+`~\~2+}} 2 | -------------------------------------------------------------------------------- /snippets/multilinetest: -------------------------------------------------------------------------------- 1 | This is a multiline 2 | test snippet! 3 | -------------------------------------------------------------------------------- /snippets/backref: -------------------------------------------------------------------------------- 1 | {{++}} is {{+~\~1+}} if backref markers are working correctly 2 | 3 | -------------------------------------------------------------------------------- /examples/_javascript_module: -------------------------------------------------------------------------------- 1 | const {{+~expand('%:t:r')+}} = {{++}} 2 | 3 | export default {{+~\~2+}} 4 | -------------------------------------------------------------------------------- /examples/_javascript_test: -------------------------------------------------------------------------------- 1 | import {{++}} from './{{+~expand('%:t:r:r')+}}' 2 | 3 | test('{{++}}', () => { 4 | expect({{++}}).{{+toBe+}}({{++}}) 5 | }) 6 | -------------------------------------------------------------------------------- /ftdetect/minisnip.vim: -------------------------------------------------------------------------------- 1 | " Assume that everything in a "minisnip" directory is a snippet. 2 | autocmd BufRead,BufNewFile */minisnip/* setlocal filetype=minisnip 3 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: vim 2 | 3 | before_script: | 4 | git clone --depth 1 https://github.com/junegunn/vader.vim.git 5 | 6 | git clone --depth 1 https://github.com/vim/vim 7 | cd vim 8 | ./configure --with-features=huge 9 | sudo make install 10 | cd - 11 | 12 | script: | 13 | vim -Nu <(cat << VIMRC 14 | filetype off 15 | set rtp+=vader.vim 16 | set rtp+=. 17 | filetype plugin indent on 18 | syntax enable 19 | VIMRC) -c 'Vader! test/*' > /dev/null 20 | -------------------------------------------------------------------------------- /syntax/minisnip.vim: -------------------------------------------------------------------------------- 1 | " Vim syntax file 2 | " Language: minisnip 3 | " Created by: Robert Hicks 4 | " Last Change: 2017-08-20 5 | " 6 | " To enable syntax highlighting you just need to set the filetype 7 | " to 'minisnip'. 8 | " 9 | " Adding something like the following in your vimrc will do it 10 | " automatically for you: 11 | " 12 | " autocmd BufRead,BufNewFile /path/to/minisnips/* set filetype=minisnip 13 | " 14 | " You can add it as a grouping as well: 15 | " 16 | " augroup MiniSnip 17 | " autocmd! 18 | " autocmd BufRead,BufNewFile /path/to/minisnips/* set filetype=minisnip 19 | " augroup END 20 | " 21 | 22 | if exists("b:current_syntax") 23 | finish 24 | endif 25 | 26 | " Get the minisnip defined delimiters 27 | exe "syntax match minisnipKeyword /" . g:minisnip_startdelim . "/" 28 | exe "syntax match minisnipKeyword /" . g:minisnip_enddelim . "/" 29 | 30 | highlight default link minisnipKeyword Keyword 31 | 32 | let b:current_syntax = "minisnip" 33 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Keyboard Fire 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /plugin/minisnip.vim: -------------------------------------------------------------------------------- 1 | if exists('g:loaded_minisnip') 2 | finish 3 | endif 4 | 5 | let g:loaded_minisnip = 1 6 | 7 | " set default global variable values if unspecified by user 8 | let g:minisnip_dir = get(g:, 'minisnip_dir', '~/.vim/minisnip') 9 | let g:minisnip_trigger = get(g:, 'minisnip_trigger', '') 10 | let g:minisnip_startdelim = get(g:, 'minisnip_startdelim', '{{+') 11 | let g:minisnip_enddelim = get(g:, 'minisnip_enddelim', '+}}') 12 | let g:minisnip_finalstartdelim = get(g:, 'minisnip_finalstartdelim', '{{-') 13 | let g:minisnip_finalenddelim = get(g:, 'minisnip_finalenddelim', '-}}') 14 | let g:minisnip_evalmarker = get(g:, 'minisnip_evalmarker', '~') 15 | let g:minisnip_donotskipmarker = get(g:, 'minisnip_donotskipmarker', '`') 16 | let g:minisnip_backrefmarker = get(g:, 'minisnip_backrefmarker', '\\~') 17 | 18 | " this is the pattern used to find placeholders 19 | let g:minisnip_delimpat = '\V' . g:minisnip_startdelim . '\.\{-}' . g:minisnip_enddelim 20 | 21 | " this is the pattern used to find placeholders 22 | let g:minisnip_finaldelimpat = '\V' . g:minisnip_finalstartdelim . 23 | \ '\.\{-}' . 24 | \ g:minisnip_finalenddelim 25 | 26 | " plug mappings 27 | " the eval/escape charade is to convert ex. into a literal tab, first 28 | " making it \ and then eval'ing that surrounded by double quotes 29 | inoremap