# Custom code snippets are not inserted automatically (with Name+Tab)

**URL:** https://forum.alternetsoft.com/t/custom-code-snippets-are-not-inserted-automatically-with-name-tab/276
**Category:** AlterNET Studio Support
**Tags:** editor
**Created:** [December 26, 2021, 7:11am UTC](https://forum.alternetsoft.com/t/custom-code-snippets-are-not-inserted-automatically-with-name-tab/276 "2021-12-26T07:11:07Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![PMORSHED](https://forum.alternetsoft.com/letter_avatar_proxy/v4/letter/p/606060/32.png) [@PMORSHED](https://forum.alternetsoft.com/u/PMORSHED)
#### Post date: [December 26, 2021, 7:11am UTC](https://forum.alternetsoft.com/t/custom-code-snippets-are-not-inserted-automatically-with-name-tab/276/1 "2021-12-26T07:11:07Z")

</div>

Hello,  
I want to add a custom code snippet to my SyntaxEditor (which uses the roslyn parser). I used the method-1 that andrew mentioned [here](https://forum.alternetsoft.com/t/adding-controlling-code-snippets/77/2) (I put it in my Form1\_Load event). That method works and my custom code snippet is displayed in the list (by calling Ctrl + K + X manually) but is **not** automatically displayed with typing its name and pressing Tab key. how can I make it insert automatically with name+tab (like other default c# code snippets) ?

Thanks

---

<div class="post-metadata">

### Author: ![dmitry.medvedev](https://forum.alternetsoft.com/user_avatar/forum.alternetsoft.com/dmitry.medvedev/32/27_2.png) [@dmitry.medvedev](https://forum.alternetsoft.com/u/dmitry.medvedev)
#### Post date: [December 29, 2021, 2:52am UTC](https://forum.alternetsoft.com/t/custom-code-snippets-are-not-inserted-automatically-with-name-tab/276/2 "2021-12-29T02:52:11Z")

</div>

Hi Peyman,

If I understand correctly you’d like code snippet code to be inserted when you type its shortcut and then press tab  
(like if you type for - it will insert snippet code for “for” snippet).

You would need to set snippet.Header.Shortcut when adding custom snippet.

Let me know if this is what you’re looking for.

Regards,  
Dmitry

---

<div class="post-metadata">

### Author: ![PMORSHED](https://forum.alternetsoft.com/letter_avatar_proxy/v4/letter/p/606060/32.png) [@PMORSHED](https://forum.alternetsoft.com/u/PMORSHED)
#### Post date: [December 29, 2021, 6:32am UTC](https://forum.alternetsoft.com/t/custom-code-snippets-are-not-inserted-automatically-with-name-tab/276/3 "2021-12-29T06:32:15Z")

</div>

Hi Dmitry,  
Yes! that’s exactly what I was looking for.  
Thanks a lot & happy new year

---

<div class="post-metadata">

### Author: ![dmitry.medvedev](https://forum.alternetsoft.com/user_avatar/forum.alternetsoft.com/dmitry.medvedev/32/27_2.png) [@dmitry.medvedev](https://forum.alternetsoft.com/u/dmitry.medvedev)
#### Post date: [December 29, 2021, 10:25am UTC](https://forum.alternetsoft.com/t/custom-code-snippets-are-not-inserted-automatically-with-name-tab/276/4 "2021-12-29T10:25:41Z")

</div>

Hi Peyman,

Great, thank you for confirming. Happy New Year!

Regards,  
Dmitry
