Ubuntu下实现gedit支持nesC语法高亮
在TinyOS下主要采用nesC语言(C语言的一个变种)编程,ubuntu系统默认打开文本的工具是gedit,为实现gedit支持nesC语法高亮,将最下面的代码保存为nesC.lang文件,然后将nesC.lang复制到指定目录,执行一下命令:
sudo cp ~/nesc.lang /usr/share/gtksourceview-3.0/language-specs/
重启gedit,选择View->Hightlight Mode->Sources->NesC,就OK了。
<?xml version="1.0" encoding="UTF-8"?> <!-- nesC (network embedded system C) GtkSourceview language definition
based on GtkSourceview C language definition. Authors: Ariel Núñez, Marco Barisione, Emanuele Aina, Trilok Inakota
Copyright (C) 2005-2007 Marco Barisione <barisione@gmail.com>
Copyright (C) 2005-2007 Emanuele Aina
Copyright (C) 2007 Ariel Núñez (Adapted to NesC the cpp.lang written by Marco and Emanuele)
Copyright (C) 2010,Trilok Inakota, <itrilok@gmail.com> This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details. You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. --> <language id="nesc" _name="NesC" version="2.0" _section="Sources">
<metadata>
<property name="mimetypes">text/x-nc</property>
<property name="globs">*.nc;*C.nc;*M.nc;*P.nc</property>
<property name="Wiring">-></property>
<property name="line-comment-start">//</property>
<property name="block-comment-start">/*</property>
<property name="block-comment-end">*/</property>
</metadata> <styles>
<style id="keyword" _name="Keyword" map-to="c:keyword"/>
<style id="wire" _name="Wiring" map-to="c:preprocessor"/>
<style id="type" _name="Data Type" map-to="c:type"/>
<style id="common-defines" _name="Common Defines" map-to="c:common-defines"/>
</styles> <definitions>
<!-- NesC-specific stuff (i.e. stuff which is not C) -->
<context id="nesc-proper">
<include>
<context id="keywords" style-ref="keyword" class="keyword">
<keyword>false</keyword>
<keyword>new</keyword>
<keyword>this</keyword>
<keyword>true</keyword>
<keyword>using</keyword> <keyword>task</keyword>
<keyword>post</keyword>
<keyword>namespace</keyword>
<keyword>event</keyword>
<keyword>command</keyword> <keyword>module</keyword>
<keyword>implementation</keyword>
<keyword>configuration</keyword>
<keyword>typename</keyword>
<keyword>template</keyword>
<keyword>virtual</keyword>
</context> <context id="types" style-ref="type">
<keyword>interface</keyword>
<keyword>generic</keyword>
<keyword>uint8_t</keyword>
<keyword>uint16_t</keyword>
<keyword>uint32_t</keyword>
<keyword>int8_t</keyword>
<keyword>int16_t</keyword>
<keyword>int32_t</keyword>
<keyword>bool</keyword>
<keyword>explicit</keyword>
<keyword>export</keyword>
<keyword>inline</keyword>
<keyword>error_t</keyword>
<keyword>result_t</keyword>
<keyword>packet_t</keyword>
<keyword>message_t</keyword>
<keyword>struct</keyword>
<keyword>enum</keyword>
</context> <context id="common-defines" style-ref="common-defines">
<keyword>provides</keyword>
<keyword>components</keyword>
<keyword>as</keyword>
<keyword>uses</keyword>
<keyword>atomic</keyword>
</context> <context id="wire" style-ref="wire">
<start>-></start>
<end></end>
<include>
<context ref="c:preprocessor"/>
</include>
</context>
</include>
</context> <!-- actual language definition: NesC -specific stuff plus everything from C -->
<context id="nesc">
<include>
<context ref="nesc-proper"/>
<context ref="c:c"/>
</include>
</context>
</definitions>
</language>
Ubuntu下实现gedit支持nesC语法高亮的更多相关文章
- wxpython 支持python语法高亮的自定义文本框控件的代码
在研发闲暇时间,把开发过程中比较重要的一些代码做个珍藏,下面的代码内容是关于wxpython 支持python语法高亮的自定义文本框控件的代码,应该是对大家也有用. import keywordimp ...
- VS2015 企业版不支持 JavaScript 语法高亮、智能提醒
2015年7月,微软终于放出了 Visual Studio 2015 正式版,博主安装了 Visual Studio 2015 企业版之后,居然不支持 JavaScript 的语法高亮.智能提醒功能, ...
- 如何让 Editplus 支持 SQL 语法高亮
editplus 用来编辑或查看一些常用程序源码都很方便,而且软件小巧,但是他原生不能支持对 SQL 文件的高亮显示,有点遗憾,但好在我们可以自定义这种高亮显示,那么要如何设置呢 1. 首先点击下载文 ...
- editplus的配置文件来支持sql语法高亮【转】
editplus默认是没有sql语法高亮的,原因是它的内部没有sql.stx的这样一个语法文件 我们自己在 EditPlus 的安装目录下面新建一个文件名为sql.stx,然后打开editplus ...
- 让ubuntu下的eclipse支持GBK编码
把Windows下工程导入Linux下Eclipse中,由于以前的工程代码,都是GBK编码,而Ubuntu默认不支持GBK编码,所以,我们要让Ubuntu支持GBK,方法如下: 1.修改/var/li ...
- myeclipse2014中如何安装freeMarker插件(支持ftl语法高亮)
MyEcplise2014安装Freemarker插件(支持.ftl文件) 1.下载插件:http://sourceforge.net/projects/freemarker-ide/?source= ...
- ubuntu下安装gedit插件
因为gedit-plugins : 依赖: gir1.2-zeitgeist-2.0 所以首先 sudo apt-get install gir1.2-zeitgeist-2.0 如果报错可以先 su ...
- notepad++ 设置支持golang语法高亮
see https://stackoverflow.com/questions/27747457/golang-plugin-on-notepad
- 如何设置nesC在vim中语法高亮
默认的vim没有支持nesC语法高亮,给阅读源码带来不便.不过可以通过装NesC Syntax Highlighting插件来解决这个问题,具体操作如下: 步骤一:下载插件 在http://www ...
随机推荐
- go语言指针判等
https://blog.csdn.net/qq_26981997/article/details/52608081
- flume 使用手册
以下jie皆来自官网: 1:首先版本是flume 1.8 查看版本: bin/flume-ng version 2:配置与启动 https://flume.apache.org/FlumeUserG ...
- 03_java基础(二)之jdk的安装与环境变量配置
1.语言与机器语言 语言 : 通常说的语言其实就是人与人之间沟通的一种方式计算机编程语言: 可以看成是人与计算机之间交流的一种方式 C,C++,C#,PHP,Java等 2.Java语言的历史 是SU ...
- MySQL 事务 隔离级别
前两天面试,问到了四种隔离级别,当时觉得大多数数据库都为read committed,结果没想到mysql是个例外.在此做一下隔离级别和各种数据库锁的使用. 首先说一下ACID四大特性: 四大特性 ...
- Velocity Obstacle
[Velocity Obstacle] Two circular objects A,B, at time t(0), with velocity V(A),V(B). A represent the ...
- 自定义sql server 聚合涵数
using System; using System.Data; using System.Data.SqlClient; using System.Data.SqlTypes; using Micr ...
- python websocket网页实时显示远程服务器日志信息
功能:用websocket技术,在运维工具的浏览器上实时显示远程服务器上的日志信息 一般我们在运维工具部署环境的时候,需要实时展现部署过程中的信息,或者在浏览器中实时显示程序日志给开发人员看.你还在用 ...
- Mysql 5.7 弱密码限制,及创建用户无密码用户
一.介绍 1.haproxy Mysql 需要一个无密码登录的mysql用户. 2.Mysql 5.7 版本默认安装了 validate_password 插件,作用:要求密码的复杂度. 3.创建用户 ...
- Allowing GPU memory growth
By default, TensorFlow maps nearly all of the GPU memory of all GPUs (subject to CUDA_VISIBLE_DEVICE ...
- layer数据表格换行
在使用layer数据表格的时候,默认是不可以换行的.这样显示 改动后 数据格式为 aa<br>bb就会显示为换行 比如我们的字符串是 a<br>b 这样的字符串浏览器 ...