Home

Awesome

<img src='https://raw.githubusercontent.com/AndyObtiva/glimmer-cs-gladiator/master/images/glimmer-cs-gladiator-logo.svg' height=85 /> Gladiator 0.11.2 - Ugliest Text Editor Ever!

<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png" height=40 /> Glimmer Custom Shell

Gem Version

rapid prototyping of desktop app GUI with Gladiator

Gladiator (short for Glimmer Editor) is a Glimmer DSL for SWT beta project under on-going development that explores how to build a text editor in Ruby using Glimmer DSL for SWT (JRuby Desktop Development GUI Library). It is not intended to be a full-fledged editor by any means, yet mostly a fun educational exercise in using Glimmer. Gladiator is also a personal tool for shaping an editor exactly the way I like, with all the keyboard shortcuts I prefer. I leave building truly professional text editors to software tooling experts who would hopefully use Glimmer one day. Otherwise, I have been happily using Gladiator to develop all my projects since May of 2020.

Learn more about how I built Gladiator in the Montreal.rb Talk "How I Built My Code Editor in Ruby".

If you are interested in building a truly great code editor in Ruby, perhaps with plugin support, you are welcome to use the code of this project as a starting point.

Mac

Gladiator

Windows

Gladiator

<img src='https://raw.githubusercontent.com/AndyObtiva/glimmer-cs-gladiator/master/images/glimmer-cs-gladiator-logo.svg' height=40 /> You may now download a packaged version of Gladiator, including new support for Mac ARM64

Features

Gladiator currently supports the following text editing features (including keyboard shortcuts with Mac CMD=CTRL/CTRL=ALT on Windows/Linux)

Gladiator Demo

Text Editor

File Explorer Tree

File Lookup List Filter

Navigation Area

Menus

Watch External Changes

Automatic Data Management

Multiple Language Syntax Highlighting

Here is an exhaustive list of all the file formats supported by Gladiator (if you would like support for more file formats, feel free to suggest in a GitHub Issue or submit a Pull Request):

  1. C ('c', 'h')
  2. C++ ('cpp', 'cc', 'C', 'cxx', 'c++', 'hpp', 'hh', 'H', 'hxx', 'h++')
  3. C# ('cs')
  4. Crystal ('cr')
  5. CSS ('css')
  6. Conf ('conf')
  7. CoffeeScript ('coffee')
  8. Elixir ('ex', 'exs')
  9. Embedded Elixir ('eex', 'leex', 'heex')
  10. ERB ('erb')
  11. Gherkin Feature ('feature')
  12. Gradle ('gradle')
  13. Haml ('haml')
  14. HTML ('html')
  15. INI ('ini')
  16. Java ('java')
  17. JavaScript ('js', 'cjs', 'mjs', 'es6', 'es')
  18. JSON ('json')
  19. JSP ('jsp')
  20. JSX ('jsx')
  21. Kotlin ('kt', 'ktm', 'kts')
  22. Lisp ('lisp', 'cl', 'el', 'asd')
  23. Make ('Makefile', 'makefile', 'GNUmakefile')
  24. Markdown ('md', 'markdown')
  25. Diff Patch ('patch')
  26. Perl ('pl')
  27. Plist ('plist')
  28. Puppet ('pp')
  29. Properties ('properties')
  30. PostScript ('ps')
  31. PowerShell ('ps1')
  32. Python ('py')
  33. Ruby ('rb', 'rbw', 'rake', 'gemspec')
  34. Rust ('rs')
  35. SASS ('sass')
  36. Scheme ('scm', 'sps', 'sls', 'sld')
  37. SCSS ('scss')
  38. Shell ('sh')
  39. SQL ('sql')
  40. Tcl ('tcl')
  41. TypeScript ('ts')
  42. TSX ('tsx')
  43. Yaml ('yaml', 'yml')
  44. XML ('xml')

Platforms

Pre-requisites

Download

<img src='https://raw.githubusercontent.com/AndyObtiva/glimmer-cs-gladiator/master/images/glimmer-cs-gladiator-logo.svg' height=40 /> Download Gladiator 0.11.2 Mac DMG Installer (ARM64 Ventura 13.4.1 & Older) (this version starts in about 2.5 seconds)

<img src='https://raw.githubusercontent.com/AndyObtiva/glimmer-cs-gladiator/master/images/glimmer-cs-gladiator-logo.svg' height=40 /> Download Gladiator 0.11.1 Mac DMG Installer (x64 Ventura 13.4.1 & Older)

<img src='https://raw.githubusercontent.com/AndyObtiva/glimmer-cs-gladiator/master/images/glimmer-cs-gladiator-logo.svg' height=40 /> Download Gladiator 0.10.0 Mac DMG Installer (x64 Catalina & Older)

<img src='https://raw.githubusercontent.com/AndyObtiva/glimmer-cs-gladiator/master/images/glimmer-cs-gladiator-logo.svg' height=40 /> Download Gladiator 0.10.0 Windows MSI Installer (x64 Windows 10)

The packaged version starts with a dialog asking you what project to open. Gladiator does not fully show up until you have selected a project directory.

Otherwise, if you prefer a command line version, then follow the Setup Instructions below.

Setup Instructions

Note: if you encounter any issues, check if they are documented in TODO.md, issues, or pull requests as they might be on my radar to fix. Otherwise, please report as an issue or better yet fix and submit a pull request. Also, try going back to a previous version of the gem until you find one that works. Keep in mind this is open-source software provided as is, so there are no guarantees of functionality. If you would like such guarantees, you are welcome to hire me full-time.

Install Gladiator gem by running (jgem, jruby -S gem, or gem directly if you have RVM):

jgem install glimmer-cs-gladiator -v0.11.2

Or add to a JRuby project Bundler Gemfile under the :developement group:

group :development do
  gem 'glimmer-cs-gladiator', '> 0'
end

Run (jruby -S bundle or bundle directly if you have RVM):

jruby -S bundle

Afterwards, if you are using RVM and want to ensure system wide availablility of the gladiator command across Ruby versions, run this command in an environment that has JRuby (not needed without RVM):

gladiator-setup
source ~/.gladiator_source

You should be able to run gladiator from anywhere now.

You can pass a project path as a first argument to open a particular project.

Alternatively, open in app mode (gives you a dialog to open any project) by passing APP_MODE=true argument/env-var.

Usage

You may run the gladiator command to bring up the text editor in the project directory you would like to edit:

gladiator

On Linux, you may need to run with extra memory via this command instead:

gladiator -J-Xmx1200M

On Windows, you may need to run with extra memory via this command instead:

gladiator -J-Xmx3000M

If you are in a different directory from the project you would like to edit, then pass its path as an argument:

gladiator relative-or-absolute-path/to/project

Note: If you cloned this project and bundle installed, you may invoke via bin/gladiator instead.

Glimmer Custom Shell Reuse

To reuse Gladiator as a Glimmer Custom Shell inside another Glimmer application, add the following to the application's Gemfile:

gem 'glimmer-cs-gladiator', '~> 0.11.2'

Run:

jruby -S bundle

And, then instantiate the Gladiator custom shell in your Glimmer DSL for SWT application via the gladiator keyword assuming you already have include Glimmer in your class, module, or main object.

Env Var Options

Gladiator supports these environment variable options.

LOCAL_DIR

(String / default: '.')

Gladiator opens with the current directory as the root by default. If you would like to open another directory, set LOCAL_DIR environment variable.

Example:

LOCAL_DIR="/Users/User/code" gladiator

Opens Gladiator with "/Users/User/code" as the root directory.

APP_MODE

(true or false / default: false from terminal/command-line and true from packaged Gladiator)

Specifies whether to run in app mode, thus providing a dialog to open any project path instead of starting with a specific project from the get-go.

Example:

APP_MODE=true gladiator

Configuration

Gladiator automatically saves configuration data in a .gladiator file at the directory it is run from. It may be edited to add extra ignore paths.

It currently remembers:

Gotchas

Signaling Error

Gladiator repetitively displays a signaling error that is harmless in practice:

The signal HUP is in use by the JVM and will not work correctly on this platform
The signal INT is in use by the JVM and will not work correctly on this platform
The signal TERM is in use by the JVM and will not work correctly on this platform

App Is Not Responding

If you run the gladiator command from the root directory or some parent directory to many projects, it assumes that is the project directory and attempts to pre-load all files (just part of Gladiator's architectural design and assumptions for optimizing use per project), taking a very long time and not responding for quite a while.

To avoid this problem, always make sure you are running the gladiator command from a single project's directory.

Also, if you encounter this issue with projects that contain a lot of extra files that you do not need to edit, you could later open the generated .gladiator file at the root of the project directory and add unnecessary subdirectories to the ignore_paths array.

Freezing in large projects

Gladiator right now assumes smaller projects with a few files only as it always opens all file contents in memory for better searching. So, when a file is updated externally (e.g. change git branch), it reloads its entire tree, including all the file contents too, which causes a temporary freeze. This may get fixed in the future, but it is not annoying enough in smaller projects to be fixed right away. The change might include diffing the tree to avoid refreshing file contents for unchanged files, and perhaps multi-threaded loading of file contents to avoid freezing the GUI.

TODO

TODO.md

Change Log

CHANGELOG.md

Contributing to glimmer-cs-gladiator

Copyright

MIT

Copyright (c) 2020-2022 Andy Maleh. See LICENSE.txt for further details.

--

<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png" height=40 /> Built with Glimmer DSL for SWT (JRuby Desktop Development GUI Framework)

Gladiator icon made by <a href="https://www.flaticon.com/authors/freepik" title="Freepik">Freepik</a> from <a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a>