Visual Assist supports private and shared VA Snippets. Private VA Snippets are created during installation of Visual Assist, and are stored locally. Shared VA Snippets are created from a copy of private VA Snippets, and are stored in a shared location.
Shared snippets with shortcuts have precedence over private snippets with identical shortcuts. If there exists a shared VA Snippet with the shortcut "if", it will appear in listboxes before private snippets with the same "if".
If private VA snippets for refactoring and suggestions-for-type exist, they have precedence over shared versions. Currently, the only way to give precedence to shared refactoring and suggestions-for-type is to configure sharing, and then delete private versions of the snippets; only in this case does VA not automatically recreate private versions. (Feature request to always give precedence to shared VA snippets is case 1008.)
If shared VA Snippets do not exist for a given programming language, Visual Assist uses private VA Snippets only. Hence, there is no need to create shared VA Snippets for all programming languages.
To use a shared set of VA Snippets, create the following string value in the registry and set it to the directory where the shared VA Snippets reside. The directory can be local, on a mapped network drive, or on a network share.
HKCU \ Software \ Whole Tomato \ Visual Assist X \ <IDE spec> \ SharedSnippetsDir
Create Shared VA Snippets
A simple way to create a set of shared snippets is to:
Backup your current VA Snippets, for the programming languages of interest. You can find your VA Snippets in .tpl files in:
Use the VA Snippet editor within Visual Assist to create/edit what will become the shared VA Snippets. Be sure to delete VA Snippets you do not want to share, as they will have precedence over private versions.
Copy the modified VA Snippets to the directory you set in the registry.
- Restore your private VA Snippets.
Set permissions of files containing shared VA Snippets to read-only so users are unable to edit them. When read-only, users are able to copy shared VA Snippets and make private versions, but precedence of VA Snippets with shortcuts still favors the shared versions.
In the unlikely event the directory in which shared VA Snippets is writeable, create empty, read-only tpl files for unused programming languages so users do not inadvertently create shared versions.