micro/runtime/syntax
Zachary Yedidia e11d9deb6e
Merge pull request #1165 from ev-dev/master
Basic syntax highlighting for the GraphQL language based on the official specification
2018-08-25 17:39:13 -04:00
..
ada.yaml #964 add ada syntax 2017-12-27 14:27:42 +00:00
apacheconf.yaml
arduino.yaml
asciidoc.yaml
asm.yaml
ats.yaml Update ats syntax (#1141) 2018-07-16 15:37:57 -04:00
awk.yaml
c++.yaml
c.yaml Fix some keywords being mistakenly highlighted in C syntax 2018-08-07 14:44:53 +02:00
caddyfile.yaml
clojure.yaml Support .cljs and .cljc as clojure files 2017-11-14 13:58:28 -05:00
cmake.yaml
coffeescript.yaml
colortest.yaml
conf.yaml
conky.yaml
cpp.yaml
crontab.yaml
crystal.yaml
csharp.yaml
css.yaml
cython.yaml
d.yaml
dart.yaml
dockerfile.yaml Use type.keyword instead of keyword 2017-09-13 18:00:47 -04:00
dot.yaml
elixir.yaml Elixir configuration (#1118) 2018-05-26 10:08:35 -04:00
erb.yaml
fish.yaml
fortran.yaml
fsharp.yaml F# Configuration 2018-05-29 20:02:58 +05:30
gdscript.yaml Improve the GDScript syntax file 2018-08-07 15:16:23 +02:00
gentoo-ebuild.yaml
gentoo-etc-portage.yaml
git-commit.yaml Remove weird ignore on git-commit 2018-01-05 03:41:50 -05:00
git-config.yaml Use type.keyword instead of keyword 2017-09-13 18:00:47 -04:00
git-rebase-todo.yaml Remove weird ignore on git-commit 2018-01-05 03:41:50 -05:00
glsl.yaml
go.yaml Move incomplete colorschemes and improve cd 2017-11-23 15:57:17 -05:00
golo.yaml
graphql.yaml Basic syntax highlighting for Graphql based on the official specification 2018-08-24 03:25:40 -07:00
groff.yaml
haml.yaml
haskell.yaml
html.yaml
html4.yaml
html5.yaml
ini.yaml Fix ini comment highlighting 2018-05-12 21:29:02 -04:00
inputrc.yaml
java.yaml
javascript.yaml Fix shebang js highlighting and js division 2018-01-17 17:19:03 -05:00
json.yaml
julia.yaml Update julia.yaml 2018-05-25 12:04:12 -04:00
keymap.yaml
kickstart.yaml
kotlin.yaml
ledger.yaml Improve yaml string highlighting 2017-08-14 11:28:10 -04:00
lfe.yaml
LICENSE
lilypond.yaml
lisp.yaml
lua.yaml Lua syntax improvements; fixes #1155, fixes #1136 2018-08-18 07:00:51 -04:00
mail.yaml
makefile.yaml Fix Makefile = highlighting 2018-01-17 23:44:53 -05:00
man.yaml
markdown.yaml
micro.yaml Fix micro file syntax 2017-12-30 12:13:52 -05:00
mpdconf.yaml
nanorc.yaml
nginx.yaml
nim.yaml
objc.yaml
ocaml.yaml Improve ocaml syntax highlighting 2018-01-30 22:34:44 -05:00
octave.yaml Added initial support for Octave/Matlab syntax highlighting 2017-10-02 14:08:22 +04:00
pascal.yaml
patch.yaml
peg.yaml
perl.yaml Perl syntax highlighting fix (#818) 2017-09-24 11:59:57 -04:00
perl6.yaml
php.yaml Fix php syntax file 2018-06-04 15:13:58 -04:00
pkg-config.yaml
po.yaml
pony.yaml
pov.yaml
PowerShell.yaml Create PowerShell.yaml 2018-03-21 03:58:04 +01:00
privoxy-action.yaml
privoxy-config.yaml
privoxy-filter.yaml
puppet.yaml
python2.yaml
python3.yaml
r.yaml
README.md Update readme 2017-09-29 13:46:51 -04:00
reST.yaml
rpmspec.yaml
ruby.yaml
rust.yaml
scala.yaml a couple more keywords to scala syntax 2017-10-04 10:17:50 +01:00
sed.yaml
sh.yaml Fix shell comments; fixes #1114 2018-08-20 16:22:07 -04:00
sls.yaml
solidity.yaml Use type.keyword instead of keyword 2017-09-13 18:00:47 -04:00
sql.yaml
swift.yaml
syntax_checker.go make syntax_checker work with error messages 2017-08-06 08:25:19 +01:00
syntax_converter.go Fix windows errors 2018-01-04 21:46:44 -05:00
systemd.yaml
tcl.yaml
tex.yaml Update tex syntax file 2018-01-29 18:02:43 -05:00
toml.yaml
twig.yaml
typescript.yaml
vala.yaml
vhdl.yaml
vi.yaml
xml.yaml
xresources.yaml
yaml.yaml Improve yaml string highlighting 2017-08-14 11:28:10 -04:00
yum.yaml
zsh.yaml

Syntax Files

Here are micro's syntax files.

Each yaml file specifies how to detect the filetype based on file extension or headers (first line of the file). Then there are patterns and regions linked to highlight groups which tell micro how to highlight that filetype.

Making your own syntax files is very simple. I recommend you check the file after you are finished with the syntax_checker.go program (located in this directory). Just place your yaml syntax file in the current directory and run go run syntax_checker.go and it will check every file. If there are no errors it will print No issues!.

You can read more about how to write syntax files (and colorschemes) in the colors documentation.

Legacy '.micro' filetype

Micro used to use the .micro filetype for syntax files which is no longer supported. If you have .micro syntax files that you would like to convert to the new filetype, you can use the syntax_converter.go program (also located in this directory):

$ go run syntax_converter.go c.micro > c.yaml

Most the the syntax files here have been converted using that tool.

Note that the tool isn't perfect and though it is unlikely, you may run into some small issues that you will have to fix manually (about 4 files from this directory had issues after being converted).

Micro syntax highlighting files

These are the syntax highlighting files for micro. To install them, just put all the syntax files in ~/.config/micro/syntax.

They are taken from Nano, specifically from this repository. Micro syntax files are almost identical to Nano's, except for some key differences:

  • Micro does not use icolor. Instead, for a case insensitive match, use the case insensitive flag (i) in the regular expression
    • For example, icolor green ".*" would become color green "(?i).*"

Using with colorschemes

Not all of these files have been converted to use micro's colorscheme feature. Most of them just hardcode the colors, which can be problematic depending on the colorscheme you use.

Here is a list of the files that have been converted to properly use colorschemes:

  • vi
  • go
  • c
  • d
  • markdown
  • html
  • lua
  • swift
  • rust
  • java
  • javascript
  • pascal
  • python
  • ruby
  • sh
  • git
  • tex
  • solidity

License

Because the nano syntax files I have modified are distributed under the GNU GPLv3 license, these files are also distributed under that license. See LICENSE.