在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语法高亮的更多相关文章

  1. wxpython 支持python语法高亮的自定义文本框控件的代码

    在研发闲暇时间,把开发过程中比较重要的一些代码做个珍藏,下面的代码内容是关于wxpython 支持python语法高亮的自定义文本框控件的代码,应该是对大家也有用. import keywordimp ...

  2. VS2015 企业版不支持 JavaScript 语法高亮、智能提醒

    2015年7月,微软终于放出了 Visual Studio 2015 正式版,博主安装了 Visual Studio 2015 企业版之后,居然不支持 JavaScript 的语法高亮.智能提醒功能, ...

  3. 如何让 Editplus 支持 SQL 语法高亮

    editplus 用来编辑或查看一些常用程序源码都很方便,而且软件小巧,但是他原生不能支持对 SQL 文件的高亮显示,有点遗憾,但好在我们可以自定义这种高亮显示,那么要如何设置呢 1. 首先点击下载文 ...

  4. editplus的配置文件来支持sql语法高亮【转】

      editplus默认是没有sql语法高亮的,原因是它的内部没有sql.stx的这样一个语法文件 我们自己在 EditPlus 的安装目录下面新建一个文件名为sql.stx,然后打开editplus ...

  5. 让ubuntu下的eclipse支持GBK编码

    把Windows下工程导入Linux下Eclipse中,由于以前的工程代码,都是GBK编码,而Ubuntu默认不支持GBK编码,所以,我们要让Ubuntu支持GBK,方法如下: 1.修改/var/li ...

  6. myeclipse2014中如何安装freeMarker插件(支持ftl语法高亮)

    MyEcplise2014安装Freemarker插件(支持.ftl文件) 1.下载插件:http://sourceforge.net/projects/freemarker-ide/?source= ...

  7. ubuntu下安装gedit插件

    因为gedit-plugins : 依赖: gir1.2-zeitgeist-2.0 所以首先 sudo apt-get install gir1.2-zeitgeist-2.0 如果报错可以先 su ...

  8. notepad++ 设置支持golang语法高亮

    see https://stackoverflow.com/questions/27747457/golang-plugin-on-notepad

  9. 如何设置nesC在vim中语法高亮

    默认的vim没有支持nesC语法高亮,给阅读源码带来不便.不过可以通过装NesC Syntax Highlighting插件来解决这个问题,具体操作如下:   步骤一:下载插件 在http://www ...

随机推荐

  1. tomcat修改上下文path

    server.xml <Host name="localhost" appBase="webapps" unpackWARs="true&quo ...

  2. pandas 常用清洗数据(二)

    1. df.head() Here we import pandas using the alias 'pd', then we read in our data. df.head - shows u ...

  3. VR/AR 科技了解

    Dream学院学习资料: VR/AR科技学习需要先学习NDK技术 AR/VR->图像学->图像处理(OpenCV->Intel公司在1999年发布3.2).图像绘制渲染(OpenGL ...

  4. Java闰年的计算,Calendar的用法

    Java闰年的计算,Calendar的用法 代码如下: package com.aaa.zuoye; import java.text.ParseException; import java.util ...

  5. Building and using plug-ins for Android

    [Building and using plug-ins for Android] 1.AAR plug-ins and Android Libraries Android Archive (AAR) ...

  6. BOM 对象--location、navigator、screen、history

    1.location 对象 location提供了与当前窗口中加载的文档有关的信息,还有一些导航功能.需要注意的是,window.location 和 document.location 引用的是同一 ...

  7. day32 并发编程

    并发编程 并发编程的理论 python中实现多进程 进程测试 import os import time while True: time.sleep(0.5) print("hahaha& ...

  8. DataGridView中DataGridViewComboBoxColumn的一些相关应用(一)让其值改变时触发事件-转

    转自  https://maodaili.de/mao.php?u=a%2FMrbEvUE8PnCuc7FrhJi0Rqd3kmOBHPZUbcJ1c2hbJUK0RYWpAf4lhIOddItP%2 ...

  9. centos如何查看磁盘剩余空间

    linux系统的Df命令是以磁盘分区为单位查看文件系统,可以加上参数查看磁盘剩余空间信息,命令格式: df -hl 显示格式为: 文件系统 容量 已用 可用 已用% 挂载点 /dev/hda5 487 ...

  10. Java Web开发和Python Web开发之间的区别

    今天的文章讨论了Java Web开发和Python Web开发之间的区别.我不鼓励我们在这里从Java Web迁移到Python Web开发.我只是想谈谈我的感受.它不一定适合所有情况,仅供我们参考. ...