Gedit is a common editing program that supports plug-ins and custom language settings.
The following describes how to customize the gedit editor in Ubuntu 14.04:
1. Install the plug-in
Sudo apt-Get install gedit-plugins
2. Set the plug-in gedit
Omitted
3. Set the language configuration file
Enter the language configuration folder
CD/Usr/share/gtksourceview-3.0/language-specs
View the language configuration file (*. Lang)
Ls
4. Add a language and set the extension of the corresponding source program according to the configuration file.
View the configuration files of similar languages in the current directory, for example, copying and modifying the Javascript language configuration file.
Sudo CP Javascript. Lang jjs. Lang
In this way, the jjs (jdk8 nashorn JavaScript language engine settings) configuration file is added to the system.
Sudo gedit jjs. Lang
Example of modifying its content:
<? XML version = "1.0" encoding = "UTF-8"?> <Language id = "jjs" _ name = "<strong> <span style =" color: # ff0000; "> <strong> <span style =" color: # ff0000; "> jdk8nashorn_script </span> </strong>" version = "2.0" _ SECTION = "scripts"> <metadata> <property name =" mimetypes "> application/JavaScript; application/X-JavaScript; text/JavaScript; text/X-js </property> <property name = "globs"> <strong> <span style = "color: # ff0000;"> <span style = "C Olor: # ff0000; "> <strong> *. jjs </strong> </span> </strong>; </property> <property name = "line-comment-start"> // </property> <property name = "block-comment-start">/* </property> <property name = "block-comment-end"> */</property> </metadata> <! -- <Strong> <span style = "color: #000099;"> <strong> <span style = "color: # 6633ff;"> to enhance readability, thousands of characters are omitted here </span> </strong> --> </language>
In this way, when you edit a file with the extension. jjs in gedit, gedit automatically recognizes the source code type of the file.
Others, such as MATLAB, Ave ave, and freemat, all use the. m extension. to distinguish different file types, you can modify files such as MATLAB. Lang;
For example, you can modify the extension in Ave ave. Lang to. Om, copy MATLAB. Lang to freemat. Lang, and modify the extension to. FM.
5. Set management tools based on the file format
Open gedit and choose tools> manage external tools ";
Click + to add a command.
The configuration of my frequently used tools is provided.
By managing external tools, you can communicate with other programs in a friendly manner. For example, you can customize the command "maid". The shortcut key is Ctrl + M. The content is as follows:
#! /Bin/sh
/Usr/bin/Matlab-nojvm-nodisplay-r $ gedit_current_document_name
MATLAB can be customized as a command interpreter to provide development speed.
Summary:
Through the above steps, gedit is customized to support ide developed in various languages. In particular, it provides favorable tools for Scientific Research and Development in Linux.