Syntax highlighting for external editors - juri8/openhab GitHub Wiki

OpenHAB has a great development environment with the "openHAB Designer". But in some cases you want to use another editor to make changes to the configuration files of openHAB. To make this more effectiv there are some files to enable syntax highlighting for openHAB-files in these editors.

mcedit

mcedit is an editor which comes with mc (Midnight Commander).

Installing the syntax-files

    file ..\*\\.(items)$ openHAB\sItems 
    include openhab-items.syntax  
     
    file ..\*\\.(sitemap)$ openHAB\sSitemap 
    include openhab-sitemap.syntax
     
    file ..\*\\.(persist)$ openHAB\sPersistence
    include openhab-persist.syntax
     
    file ..\*\\.(rules)$ openHAB\sRules
    include openhab-rules.syntax 
  • edit the Debian-line from file (rules|rocks)$ Debian\srules to file (rocks)$ Debian\srules because it interferes with openHABs rules-files.

Screenshots

Items Rules Sitemap

Notepad++

Notepad++ Version 6.2 or above is required to support UDL2 (User Defined Language v2).

Comments

color brightgreen "//." color brightgreen start="/*" end="*/" color brightgreen start="/**" end="*/"# Comments color brightgreen "//." color brightgreen start="/*" end="*/" color brightgreen start="/**" end="*/"# Comments color brightgreen "//." color brightgreen start="/*" end="*/" color brightgreen start="/**" end="*/"# Comments color brightgreen "//." color brightgreen start="/*" end="*/" color brightgreen start="/**" end="*/"# Comments color brightgreen "//." color brightgreen start="/*" end="*/" color brightgreen start="/**" end="*/"# Comments color brightgreen "//." color brightgreen start="/*" end="*/" color brightgreen start="/**" end="*/"# Comments color brightgreen "//." color brightgreen start="/*" end="*/" color brightgreen start="/**" end="*/"# Comments color brightgreen "//." color brightgreen start="/*" end="*/" color brightgreen start="/**" end="*/"# Comments color brightgreen "//." color brightgreen start="/*" end="*/" color brightgreen start="/**" end="*/"# Comments color brightgreen "//." color brightgreen start="/*" end="*/" color brightgreen start="/**" end="*/"# Comments color brightgreen "//.*" color brightgreen start="/*" end="*/" color brightgreen start="/**" end="*/" http://notepad-plus-plus.org/news/notepad-6.2-release-udl2.html

How to import UDL2-files?

Import

Screenshots

Items Rules Sitemap

vi

Installing the syntax-files

Automatic installation

Paste the following code into a commandline

mkdir -p ~/.vim/{ftdetect,syntax} && \
curl -L -o ~/.vim/syntax/openhab.vim https://github.com/cyberkov/openhab-vim/raw/master/syntax/openhab.vim && \
curl -L -o ~/.vim/ftdetect/openhab.vim https://github.com/cyberkov/openhab-vim/raw/master/ftdetect/openhab.vim

Manual installation

nano

Nano is a common editor in linux systems

Installing the syntax-files

  • Download the syntax file openhab.nanorc from https://github.com/airix1/openhabnano
  • place them in your nanorc directory ie: ~/.nano or /usr/share/nano. Then simply include the openhab.nanorc file in your ~/.nanorc or /etc/nanorc file ie:
## Openhab
include /usr/share/nano/openhab.nanorc
⚠️ **GitHub.com Fallback** ⚠️