8df921cf96
* Overall syntax highlighting improvements for C++ Most of these changes are based on the information on cppreference.com; specifically from here: https://en.cppreference.com/w/cpp/keyword - made `identifier` actually match any identifier - add ~ as an operator - add `static_assert` as a keyword (statement) - add keywords that are interchangeable with operators as operators - add keywords `sizeof`, `alignof` and `typeid` as operators - add the quasi-keywords `asm`, `fortran` and `final`, `override` - add the keyword `nullptr` - add `_Pragma` as a preprocessor keyword - add C++20 (concepts and modules) -related keywords - add casting keywords - add the keyword (specifier) `noexcept` - remove `nothrow` (because it's not any more special than `vector` is) - add `wchar_t` and `charXX_t` types - add cv type keywords as `type.keyword`s - move some fitting keywords into `type.keywords` (mostly because they appear in/near type signatures etc.) I didn't include coroutine-related language features, primarily because there is no good source of information about them other than the ISO C++ standard. * Further changes to C++ syntax highlighting - reverted the changes to the `identifier` regex, since most colorschemes color it the same as `type`s and/or `statement`s - fix the 2nd `type` regex (the word boundaries were in only two pipe-options) - move `nullptr` back into `constant.bool`, since it looks better in-editor this way (imo) - add `?` as an operator - add regexes that match all the correct number literals, and nothing else (see https://en.cppreference.com/w/cpp/language/floating_literal) (that is, if I haven't made a mistake) |
||
---|---|---|
.. | ||
ada.yaml | ||
apacheconf.yaml | ||
arduino.yaml | ||
asciidoc.yaml | ||
asm.yaml | ||
ats.yaml | ||
awk.yaml | ||
bat.yaml | ||
c.yaml | ||
caddyfile.yaml | ||
clojure.yaml | ||
cmake.yaml | ||
coffeescript.yaml | ||
colortest.yaml | ||
conf.yaml | ||
conky.yaml | ||
cpp.yaml | ||
crontab.yaml | ||
crystal.yaml | ||
csharp.yaml | ||
css.yaml | ||
csx.yaml | ||
cython.yaml | ||
d.yaml | ||
dart.yaml | ||
dockerfile.yaml | ||
dot.yaml | ||
elixir.yaml | ||
elm.yaml | ||
erb.yaml | ||
erlang.yaml | ||
fish.yaml | ||
forth.yaml | ||
fortran.yaml | ||
fsharp.yaml | ||
gdscript.yaml | ||
gentoo-ebuild.yaml | ||
gentoo-etc-portage.yaml | ||
git-commit.yaml | ||
git-config.yaml | ||
git-rebase-todo.yaml | ||
glsl.yaml | ||
go.yaml | ||
godoc.yaml | ||
golo.yaml | ||
graphql.yaml | ||
groff.yaml | ||
haml.yaml | ||
haskell.yaml | ||
html.yaml | ||
html4.yaml | ||
html5.yaml | ||
ini.yaml | ||
inputrc.yaml | ||
java.yaml | ||
javascript.yaml | ||
jinja2.yaml | ||
json.yaml | ||
jsonnet.yaml | ||
julia.yaml | ||
keymap.yaml | ||
kickstart.yaml | ||
kotlin.yaml | ||
ledger.yaml | ||
lfe.yaml | ||
LICENSE | ||
lilypond.yaml | ||
lisp.yaml | ||
lua.yaml | ||
mail.yaml | ||
make_headers.go | ||
makefile.yaml | ||
man.yaml | ||
markdown.yaml | ||
mc.yaml | ||
micro.yaml | ||
mpdconf.yaml | ||
nanorc.yaml | ||
nginx.yaml | ||
nim.yaml | ||
objc.yaml | ||
ocaml.yaml | ||
octave.yaml | ||
pascal.yaml | ||
patch.yaml | ||
peg.yaml | ||
perl.yaml | ||
perl6.yaml | ||
php.yaml | ||
pkg-config.yaml | ||
po.yaml | ||
pony.yaml | ||
pov.yaml | ||
PowerShell.yaml | ||
privoxy-action.yaml | ||
privoxy-config.yaml | ||
privoxy-filter.yaml | ||
proto.yaml | ||
puppet.yaml | ||
python2.yaml | ||
python3.yaml | ||
r.yaml | ||
README.md | ||
renpy.yaml | ||
reST.yaml | ||
rpmspec.yaml | ||
ruby.yaml | ||
rust.yaml | ||
sage.yaml | ||
scala.yaml | ||
sed.yaml | ||
sh.yaml | ||
sls.yaml | ||
solidity.yaml | ||
sql.yaml | ||
stata.yaml | ||
svelte.yaml | ||
swift.yaml | ||
syntax_checker.go | ||
syntax_converter.go | ||
systemd.yaml | ||
tcl.yaml | ||
tex.yaml | ||
toml.yaml | ||
twig.yaml | ||
typescript.yaml | ||
v.yaml | ||
vala.yaml | ||
verilog.yaml | ||
vhdl.yaml | ||
vi.yaml | ||
vue.yaml | ||
xml.yaml | ||
xresources.yaml | ||
yaml.yaml | ||
yum.yaml | ||
zig.yaml | ||
zscript.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 becomecolor green "(?i).*"
- For example,
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
See LICENSE.