Skip to content

gtksourceview language specifications for Ruby/Web devoloper's gedit

Notifications You must be signed in to change notification settings

janlelis/rubybuntu-language-specs

Repository files navigation

Ruby/Rails/Web related gedit/gtksourceview language definitions.

Part of RubyBuntuGedit

Features

Contains various language specs needed by Ruby/Rails/Web developers and also tries to maintain them.

  • The Ruby language specification has been improved a lot. It uses 1.9.2 as reference implementation, recognizes many Ruby-specific language constructs (that can be highlighted differently) and implements many language details. To see all these changes, you need a style that supports (“uses”) the new specification, for example, these styles. See below for a changelog summary.

  • ERB is not only usable with HTML, but also with JavaScript, YAML and XML…

  • Gemfile.lock highlighting

Setup

You should also use up-to-date mime types.

as root

sudo cp *.lang /usr/share/gtksourceview-2.0/language-specs
# you can also delete the rhtml.lang (now done via html-erb)
sudo rm -f /usr/share/gtksourceview-2.0/language-specs/rhtml.lang
# and the ruby_on_rails.lang (except you want to have rails highlighting with an extra language..)
sudo rm -f /usr/share/gtksourceview-2.0/language-specs/ruby_on_rails.lang

as non-root

mkdir -p ~/.local/share/gtksourceview-2.0/language-specs
cp *.lang ~/.local/share/gtksourceview-2.0/language-specs
# you can also delete the rhtml.lang (now done via html-erb)
rm -f ~/.local/share/gtksourceview-2.0/language-specs/rhtml.lang
# and the ruby_on_rails.lang (except you want to have rails highlighting with an extra language..)
rm -f ~/.local/share/gtksourceview-2.0/language-specs/ruby_on_rails.lang

CHANGES

ruby.lang

  • Uses 1.9 as reference implementation

  • No Rails keywords, no extra language for Rails

  • Refactored/updated keyword and builtin detection, highlight important constants and methods

  • Improved function definition highlighting

  • More logical style mappings (which also means: current styles are not fully ruby:compatible)

  • Fix string interpolations

  • Better support for advanced literals (e.g. ‘%x[]`, `%r<>`, …)

  • Support Arrays & Hashes (inclusive 1.9 symbol syntax)

  • Different heredoc matching

  • Better symbol detection

  • Small language details, like recognizing ‘__END__`

  • Better unicode support

  • See ‘git log` for full details

  • Based on github.com/gmate/gmate/blob/master/lang-specs/ruby_on_rails.lang

ruby.lang - Advanced TODOs [not (easily) possible with gtksourceview]

  • Improve heredocs (e.g. nested ones)

  • Different colorizations for “end”s (e.g. def/begin, class/module, while/until, if/case, block), needs to detect modifier statements correctly :/

  • Detect (multi-line) yard doc tag values

  • Add escapable char for generic string delimiters

  • Advanced regex highlighting + multi-line regexes

  • ruby.lang-extras/known-bugs.rb

Languages to add/import/update

  • SASS / SCSS / CSS

  • COFFEE

  • HAML

  • SLIM

  • YAML

  • CUCUMBER

Meanwhile, you can, for example, use the ones found in gmate

MAYBE

  • RDOC markup support (and cross-referencing in ruby)

J-_-L

About

gtksourceview language specifications for Ruby/Web devoloper's gedit

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages