1
0
Fork 0

Initial commit

master
Anthony Axenov 2022-06-25 00:15:40 +08:00
commit 7488dd5649
Signed by: anthony
GPG Key ID: EA9EC32FF7CCD4EC
3 changed files with 74 additions and 0 deletions

21
LICENSE 100644
View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2022 Антон Аксенов (aka Anthony Axenov)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

29
README.md 100644
View File

@ -0,0 +1,29 @@
# env syntax support plugin for lite-xl
[Lite-XL](https://lite-xl.com/) is lightweight, fast and customizable open-source code editor.
This plugin adds extra syntax highlighting for such fyletypes:
* `.gitignore`
* `.dockerignore`
* and any other `.blablablaignore` which has identical simple syntax rules.
Supported highlighting:
* comments;
* excluded (ignored) patterns;
* included (not-ignored) patterns.
You can use any of [these files](https://github.com/github/gitignore) to check how plugin works (just rename it to `.gitignore` or `.dockerignore`).
## How to install
To install a plugin:
* Drop `language_env.lua` file in:
* Linux: `~/.config/lite-xl/plugins/`
* MacOS: `~/.config/lite-xl/plugins/`
* Windows: `C:\Users\(username)\.config\lite-xl\plugins\`
* If lite-xl is already opened then `Ctrl+Shift+P => rst => <Enter>` to reboot editor's core and load plugin immidiately.
## License
[The MIT License](LICENSE)

View File

@ -0,0 +1,24 @@
-- mod-version:2
-- Anthony Axenov (c) 2022, The MIT License
-- https://github.com/anthonyaxenov/lite-xl-env-syntax
local syntax = require "core.syntax"
local style = require "core.style"
local common = require "core.common"
style.syntax["ignore"] = { common.color "#72B886" }
style.syntax["exclude"] = { common.color "#F36161" }
syntax.add {
name = ".ignore file",
files = { "%..*ignore$" },
comment = "#",
patterns = {
{ regex = "^ *#.*$", type = "comment" },
{ regex = { "(?=^ *!.)", "$" }, type = "ignore" },
{ regex = { "(?=.)", "$" }, type = "exclude" },
},
symbols = {}
}