Search

Enabling snippets for languages in gedit

Snippets in gedit are some thing that will allow you to make the typing of repeated texts easier when we are diong programmig. To enable snippets in gedit frst we need to turn on the plugins.





Choose the tab titled plugins. Now browse down the list of plugins listed and look for the plugin named snippets. Enable snippers by checking the box next to it and closet h plugins menu.



Now click on





It will open window as shown below.



In the left column we can see a number of languages. Let us take html as an example. Click on the + mark beside HTML. It will open a list of all the commands of HTML. Click on which ever command you want to create shortcut for. For example we use the command
a number of times in HTML. To create a shortcut for break click on br.



On the right we will able to see the actual command that is below this window there will be options

Tab Trigger: What ever word is entered in against this option will act as a shortcut for the command.For example for break let us say we use the character "b" as the tab trigger word. While typing a html document using gedit we will need to only enter b and then press "tab" and the command will automatically get completed.

Shortcut Key : This is the combination of keys that when pressed will insert the command into the document. For example for "br" if you use the combination "cntrl + shift + space" , it means that in any html document that we create using gedit if we enter the above mentioned combination of keys the
command will automatically get inserted.

We can also create our own customized shortcuts using the options using the "+" key below left. On clcking on the "+" a new snippet option get added under which ever language we have selected. Give the name for the snippet and on the right insert the text you want to create shortcut for and on the options below add the shortcut we need to create for the text.


Follow by Email