-
Notifications
You must be signed in to change notification settings - Fork 13
jag: a simple terminal editor with syntax highlighting
jag is a terminal editor that provides color syntax highlighting for programs in C++, Python and Tamgu.
Note: jag has been implemented as a C++ class: jag_editor, which you can use in your own programs.
You can easily download your version from: /~https://github.com/naver/tamgu/releases/tag/tamgu.jag
Note that the archive jag.zip comprises the four versions for Mac OS, centos, fedora and ubuntu, each in its own folder.
However, each archive of Tamgu for Linux and Mac OS also comes with a pre-compiled version of jag.
The Jag editor is based on the four following files (see src):
jag.cxx
jagmain.cxx
jagrgx.cxx
conversion.cxx
and the following include files:
binmap.h
conversion.h
inc.txt
jag.h
jagrgx.h
jagvecte.h
tamguboost.h
x_node.h
x_tokenize.h
There is a specific target in the Makefile: make jag to compile a version for your platform. You need to launch: "python install.py" beforehand.
Commands
- Ctrl-k: delete from cursor up to the end of the line
- Ctrl-d: delete a full line
- Ctrl-p: insert k-buffer (from Ctrl-d or Ctrl-k)
- Ctrl-u: undo last modifications
- Ctrl-r: redo last modifications
- Ctrl-f: find a string (on the same line: Ctrl-r for replacement)
- Ctrl-n: find next
- Ctrl-g: move to a specific line, '$' is the end of the code
- Ctrl-l: toggle between top and bottom of the screen
- Ctrl-t: reindent the code
- Ctrl-h: local help
- Ctrl-w: write file to disk
- Ctrl-c: exit the editor
- Ctrl-x: Combined Commands
- C: count a pattern
- f: find with a RGX
- H: convert HTML entities to Unicode characters
- D: delete a bloc of lines
- c: copy a bloc of lines
- x: cut a bloc of lines
- v: paste a bloc of lines
- w: write and quit
- l: load a file
- h: full help
- q: quit
Regular expressions for 'find'
- %d stands for any digit
- %x stands for a hexadecimal digit (abcdef0123456789ABCDEF)
- %p stands for any punctuation
- %c stands for any lower case letter
- %C stands for any upper case letter
- %a stands for any letter
- ? stands for any character
- %? stand for the character “?” itself
- %% stand for the character “%” itself
- %s stand for any space character include the non-breaking space
- %r stand for a carriage return
- %n stand for a non-breaking space
- ~ negation
- \x escape character
- \ddd character code across 3 digits exactly
- \xFFFF character code across 4 hexas exactly
- {...} disjunction of characters
- [...] sequence of characters
- {a-z} between a and z included
- ^ the expression should start at the beginning of the string
- $ the expression should match up to the end of the string
Examples:
- dog%c matches dogs or dogg
- m%d matches m0, m1,…,m9
- {%dab} matches 1, a, 2, b
- {%dab}+ matches 1111a, a22a90ab