Skip to content

Latest commit

 

History

History
67 lines (51 loc) · 2.47 KB

README.md

File metadata and controls

67 lines (51 loc) · 2.47 KB

Vim Unity Snippets

A collection of snippets for Unity development.

Snippet Engines suporting vim-unity-snippets

Snippets are supported by the following engines:

Note: I only use UltiSnips so I did not test these snippets on the other engines. If someone does, please tell me your experience. So I can update this readme for other readers.

Installation

UltiSnips & Vim-Plug

Add the following lines to your .vimrc:

Plug 'Mathijs-Bakker/vim-unity-snippets'

(Don't forget to do :PlugInstall)

And add "UnitySnippets" to UltiSnipsSnippetDirectories.

let g:UltiSnipsSnippetDirectories=["UnitySnippets"]

Example .vimrc:

call plug#begin('~/.vim/plugged')
  Plug 'SirVer/ultisnips'
  Plug 'honza/vim-snippets'
  Plug 'Mathijs-Bakker/vim-unity-snippets'
call plug#end()

let g:UltiSnipsSnippetDirectories=["UltiSnips", "UnitySnippets"]

When you experience any issues read :h ultisnips.

Extenject / Zenject snippets activation:

Add "ZenjectSnippets" to UltiSnippetDirectories.

let g:UltiSnipsSnippetDirectories=["UltiSnips", "UnitySnippets", "ZenjectSnippets"]

Snippets

UnitySnippets

Tab trigger Description/output
assetmenu CreateAssetMenu attribute
cor Coroutine (method)
cotimer Coroutine timer (method)
dl Debug.Log();
sf [SerializedField]
sfield [SerializedField] private $type $name
utest Playmode test (method)
sprop Unity property with serialized backing field

ZenjectSnippets

Tab trigger Description/output
zctor MonoBehaviour constructor
ztest Zenject unit test fixture file template (TDD)