打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
3 Useful Gedit Plugins For Programmers | MyLinuxBook

Gedit, the official text editor for GNOME desktop environment, is pretty light and simple to use. However, it has much more to offer with the use of various available plug-ins. In this article, we will learn about a few gedit plug-ins that can be really helpful to programmers.

File Browser

Being an active programmer, the most useful gedit plug-in to me has been the File browser. While coding or debugging, we definitely don’t want to manage the opened tabs or even re-open a file again and again.

As this plug-in comes with the default installation of gedit, one can bring it up by key ‘F9’ or through the menu option:

View -> Side Panel

This is how it looks like:

As you can see, the left panel lists all the opened files and highlights the file which is being currently worked on. This plug-in becomes extremely useful while working with a huge set of files.

Besides, if you open the other tab in this Side Panel (check the bottom of the panel to switch tab), it is the panel where one can browse the files and directories in file system.

One can browse the sources in the file system or even search a file to open a new file to edit.

Snippets – Auto-Insertion

This is not a default plug-in. The Linux command line tab-completion feature (for file and directory names) has helped many in reducing typing efforts. The same way, gedit comes with this feature for frequently used code snippets and keywords. The plug-in as a part of gedit-plugins package. So, install the package first :

$ sudo apt-get install gedit-plugins

This installs all the plug-ins, though to enable one, set it from the gedit preferences. Therefore, in the gedit, go to the following menu option:

Edit -> preferences

Go to tab “Plugins” tab, scroll to ‘Snippets’, check it to enable auto-insertion and then click on ‘close’.

Since gedit knows we are writing a C/C++ file through its extension, it will set the syntax highlighting to C/C++. Notice the bottom-most row of the gedit. One can even change it from there itself. Any ways, to add a new class now, just type “class” and press ‘Tab’, here is what I get

It has auto-inserted the complete class structure. Though class name and other data members are left to be customized. It definitely saves a lot of time.

We can also set what all snippets we want to auto-insert while coding. Therefore go to

Tools > Manage Snippets...

For example, to add a new ‘Global’ snippet, press the ‘+’ sign in the Snippet Manager located at bottom-left of the Side Panel in the window. In the Edit panel, add the text shown in snapshot below :

To auto-insert it using a short-cut, just click in the input box in front of the ‘Shortcut key’, and press your desired short-cut key. I pressed ‘Shift + Ctrl + C’, and it automatically populates the input box with it. Press close, and you are done. Now, to auto-insert the global code snippet, just press keys ‘Shift + Ctrl +C’.

I have always enjoyed this plug-in as it saves on a lot of typing be in frequently used keywords or code snippets.

Code Comment

Code Comment is an external plug-in. It allows us to comment or uncomment a block of code conveniently. This plug-in also comes as a part of gedit-plugins package, if not yet installed :

$ sudo apt-get install gedit-plugins

To enable it, goto

Edit > preferencesTab: Plugins

Scroll to ‘Code Comment’, tick the check-box, as shown in the snapshot, and then press ‘close’.

Now, for commenting a block of code, select it and press ‘Ctrl + M’. To uncomment a selected block of code, use the key combination ‘Ctrl + Shift + M’.

As one can see, there are multiple plug-ins gedit offers, we just need to explore them and select them as per our gedit usage. Certain plug-ins are even specific to the coding language. It all depends, what we need and that is why these are plug-ins but not default features.

Interested in more? Read our article on Imitation – A Gedit Plugin To Edit A Document Simultaneously At Multiple Places.

Which gedit plug-ins you use frequently? Share your experiences with us.

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
5 Must-Have Gedit Plugins for Programmers ? Yaser Sulaiman’s Blog
Gedit 快捷键KeyboardShortcuts大全
Zen Coding and QuickText for Notepad++
Article: A simple plug-in architecture patter...
Automated code reviews with Checkstyle, Part 2 | JavaWorld
JWT Extensions
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服