IITDU Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Gedit: use snippet, code faster

3 posters

Go down

Gedit: use snippet, code faster Empty Gedit: use snippet, code faster

Post by BIT0102-Mohaimin Sun Sep 26, 2010 12:18 am

If you are looking for a C/C++ editor, I will suggest gedit, the gnome official text editor. And here, I am going to tell about one of the most powerful IDE feature of gedit, Snippets.

Note: Before reading this, you are requested to consult this.

Snippet allows you to insert frequently used codes using shortcuts. For example, you possibly always write something like this in your C program:
Code:

#include

int main(void){

  return 0;
}

If you have activated Snippet, you can insert the whole code block by typing "main" and pressing tab.
Here is how to make it work.

First activate the Snippet plugin. Many snippets are defined by default. You can modify them if you wish. Also, you can add your own snippets.

Go to Tools > Manage Snippets...
A new window will be opened, Like this.

Gedit: use snippet, code faster Snippe10

As you can see, I have marked some places with 1, 2...
Here, snippet for do-while loop in C is selected.
5 shows the text to be inserted.
4 shows what to type to insert the text. (Means, type do and press tab to insert 5)
To define a new snippet click on 1, then insert the required fields.

You can save your snippets by clicking 3.
Also, you can import snippet. Click 2.

I have defined some snippets for java, C, C++, and html. Feel free to use them.
I update my snippets very frequently, I will try to update the file also. Check the future posts for updates. But, I recommend to define your snippet yourself so that you can easily remember. However, you need not remember all the snippets, because if you type first few letters and press cntr+space, you will be shown all matching snippets.

So, activate Snippets, press tab, code faster...


Last edited by BIT0102-Mohaimin on Sun Sep 26, 2010 1:55 am; edited 3 times in total
BIT0102-Mohaimin
BIT0102-Mohaimin
Programmer
Programmer

Course(s) :
  • BIT

Blood Group : B+
Posts : 415
Points : 715

Back to top Go down

Gedit: use snippet, code faster Empty Re: Gedit: use snippet, code faster

Post by BIT0122-Amit Sun Sep 26, 2010 1:34 am

Bravo... simply.. Bravo Smile

I am really impressed by this quality post Very Happy
BIT0122-Amit
BIT0122-Amit
Founder
Founder

Course(s) :
  • BIT

Blood Group : O+
Posts : 4187
Points : 6605

https://iitdu.forumotion.com

Back to top Go down

Gedit: use snippet, code faster Empty Re: Gedit: use snippet, code faster

Post by BIT0104-ANIK Sun Sep 26, 2010 2:02 am

classic post...
BIT0104-ANIK
BIT0104-ANIK
Administrator
Administrator

Course(s) :
  • BIT

Blood Group : O+
Posts : 423
Points : 699

http://anikstech.blogspot.com

Back to top Go down

Gedit: use snippet, code faster Empty Re: Gedit: use snippet, code faster

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum