Set the gedit editor in Ubuntu 14.04 as a multilingual editing and integrated development environment.

Source: Internet
Author: User

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.




Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.