GitXplorerGitXplorer
h

vim-craft-snippets

public
3 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
7ea7c0fb63d6c4d3d4e8d0735c73db72d045418b

Fixed Typo

hhql287 committed 8 years ago
Unverified
48b5ff6cb9c7eab2b2f2832a6d8942dee0a835c2

Add section snippets

hhql287 committed 8 years ago
Unverified
9b583761bb6a7a1cd0c9bb00b650051dd627f55e

Update demo

hhql287 committed 8 years ago
Unverified
7430c8a93bd3d1d31c0564ce8c25c7744e713ca2

Update Doc

hhql287 committed 8 years ago
Unverified
b18094791dfd3a6b13879fb7ea0a91bd7f82f6fa

Update Snippets

hhql287 committed 8 years ago
Unverified
bc305470981294c1bfd1002ad901ea4b072b68f8

Update Pagination snippet & add Entry Posted date

hhql287 committed 8 years ago

README

The README file for this repository.

Craft CMS Snippets for Vim.

This repository contains most of frequently used code snippets during Craft CMS development. It is compatible with Utilsnips and neosnippet (with minimal configuration).

Demo

Installation

This repo is compatible with most Vim Plugins Manager. Since I use Vim Plug, my configuration looks like this:

Utilsnips

...
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } " Completion framework for neovim
Plug 'SirVer/ultisnips'                                       " Snippet Engine
Plug 'honza/vim-snippets'                                     " Default Snippets Source
Plug 'hungle88/vim-craft-snippets'                            " Craft CMS snippets
...

Neosnippet

...
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } " Completion framework for neovim
Plug 'Shougo/neosnippet'                                      " Snippets Engine
Plug 'Shougo/neosnippet-snippets'                             " Default Snippets Source
Plug 'hungle88/vim-craft-snippets'                            " Craft CMS snippet
...

Configurations

Since Craft templates use twig which has its own snippets that come with neosnippet-snippets and vim-snippets by default, we need to tell vim to look for craft.snippets when editing *.twig templates by adding these lines to your vimrc

Utilsnips

...

" Load CraftCMS Snippets
autocmd FileType twig UltiSnipsAddFiletypes craft
...

Neosnippet

...
" Load CraftCMS Snippets
let g:neosnippet#scope_aliases = {}
let g:neosnippet#scope_aliases['twig'] = 'twig,html,js,css,craft'
...

Roadmap

Don't really have one but I'll be adding new snippets as I will be continue working with Craft. Any PR is welcome!

License

MIT