Compare commits

...

32 Commits

Author SHA1 Message Date
George Sokianos 1279fde93b Cleaned up and fixed os4build.sh 2022-01-11 22:49:14 +00:00
George Sokianos 7a347ca436 Some extra changes before the release 2022-01-11 20:04:48 +00:00
George Sokianos 7930499e6e Prepare 1.16.12.7 release 2022-01-11 20:00:14 +00:00
George Sokianos 9908e129a6 Added addons folder with plugins and color schemes 2022-01-11 19:59:12 +00:00
George Sokianos fb3d36da43 Some fixes on the README_OS4.md file 2022-01-06 20:22:35 +00:00
George Sokianos 94807d505c Added 'SDL_RENDERER_ACCELERATED' and 'SDL_RENDERER_PRESENTVSYNC' on SDL_CreateRenderer() 2022-01-05 22:13:35 +00:00
George Sokianos 44cd036b7a Added "SDL_RENDERER_ACCELERATED 2022-01-05 22:12:18 +00:00
George Sokianos 3c7da82ad2 Added the latest update version file in repo 2022-01-05 20:05:56 +00:00
George Sokianos d30a9622a5 Added config.scroll_past_end 2022-01-05 20:03:20 +00:00
George Sokianos 2fdf19ec49 Prepare 1.16.12.6 release 2022-01-04 12:47:51 +00:00
George Sokianos 9f656f8ab4 Fixed the issue with the current path introduced in 1.16.12.5 release #13 2022-01-03 21:25:25 +00:00
George Sokianos 32a3d4b933 Prepare 1.16.12.5 release 2022-01-03 00:53:13 +00:00
George Sokianos c5309e04d6 Fixed loading the current folder from terminal using the dot character 2022-01-03 00:43:04 +00:00
George Sokianos 1c3f766e6b Fixed the resolution on fullscreen toggle to be like the workbench (#4) 2022-01-02 23:47:50 +00:00
George Sokianos de6c0fd575 Removed the extra title bar when return from fullscreen 2022-01-02 23:47:19 +00:00
George Sokianos 7bd164b17e Added a workaround to fix the window resize assertion crash #2 2022-01-02 21:04:41 +00:00
George Sokianos de3e4815ee Removed clearQuit() and applied commit 456f6ed changes to free the resources 2022-01-02 19:04:18 +00:00
George Sokianos b5d4f3f0f8 Prepare 1.16.12.4 release 2021-12-31 12:15:39 +00:00
George Sokianos a788ac871b Fixed the gfx memory leak 2021-12-31 12:15:15 +00:00
George Sokianos 1f27d6f923 Removed some commented code 2021-12-31 12:14:48 +00:00
George Sokianos 5af782b884 prepare 1.16.12.3 release 2021-12-29 13:15:35 +00:00
George Sokianos 95ece12d74 Added Makefile and releases files 2021-12-27 15:11:10 +00:00
George Sokianos 03f2818657 Added more information at README_OS4 file 2021-12-26 17:26:15 +00:00
George Sokianos 689901daca Added Amiga version and cookie stack 2021-12-26 17:15:22 +00:00
George Sokianos 4499f1f111 Some code cleanup and added .config folder to gitignore 2021-12-26 17:08:09 +00:00
George Sokianos 14d813cea1 Made HOME optional and added some caching at the _fullpath() 2021-12-26 17:04:00 +00:00
George Sokianos 2c711138d7 Removed the AMIGAOS4 global variable and now I am using the PLATFORM one to determine the running platform 2021-12-22 19:10:33 +00:00
George Sokianos ff535843e8 Fixed keyboard shortcuts 2021-12-21 20:26:28 +00:00
George Sokianos fdd2f3af33 Fixed a forgotten hardcoded path 2021-12-21 18:27:25 +00:00
George Sokianos 7c85530e92 Added icon and OS4 readme file 2021-12-21 17:56:49 +00:00
George Sokianos e13efe91b4 Added the build script for font renderer 2021-12-21 17:55:37 +00:00
George Sokianos c155f797cf First commit of compilable code for OS4 2021-12-21 17:52:44 +00:00
136 changed files with 2983 additions and 17 deletions

2
.gitignore vendored
View File

@ -7,3 +7,5 @@ build*
subprojects/lua
subprojects/libagg
sybprojects/lua
lite
.config/

25
Makefile.os4 Normal file
View File

@ -0,0 +1,25 @@
#
# Project: Lite XL
#
# Created on: 26-12-2021
#
.PHONY: build release
default: build
build:
@sh os4build.sh
release:
mkdir -p release/LiteXL
cp release_files/* release/LiteXL/ -r
mv release/LiteXL/LiteXL.info release/
cp data release/LiteXL/ -r
cp doc release/LiteXL/ -r
cp lite release/LiteXL/
strip release/LiteXL/lite
cp README.md release/LiteXL/
cp README_OS4.md release/LiteXL/
cp LICENSE release/LiteXL/
lha -aeqr3 a LiteXL.lha release/

231
README_OS4.md Normal file
View File

@ -0,0 +1,231 @@
# Lite XL for AmigaOS 4.1 FE
Lite XL is a lightweight text editor written in Lua.
## Installation
You can extract the Lite XL archive wherever you want and run the *lite*
editor.
## Configuration folder
This editor creates a `.config` folder where the configuration is saved, as
well as plugins, themes etc.. By default this AmigaOS 4.1 FE version uses the
executable folder, but if you want to ovveride it, create an ENV variable
named `HOME` and set there your path.
You can check if there is one already set by executing the following command
in a shell
```
GetEnv HOME
```
If there is one set, then you will see the path at the output.
Otherwise, you can set your home path be executing the following command.
Change the path to the one of your preference.
```
SetEnv SAVE HOME "Sys:home/"
```
## Addons
### Colors
Colors are lua files that set the color scheme of the editor. There are
light and dark themes for you to choose.
To install and use them you have to copy the ones you would like from
`addons/colors/light` or `addons/colors/dark` into the folder
`.config/lite-xl/colors/`. Don't add light or dark folders. Just copy the
.lua files in there.
Then you have to start Lite XL and open your configuration by clicking
at the cog icon at the toolbar (bottom left sixth icon). Go at the line
that looks like below
```
-- core.reload_module("colors.summer")
```
and change the `summer` with the name of your color theme. Also, remove
the two dashes `--` at the start of the line and save the file. If you
did everything right, the color schema should change instantly.
The themes can also be found at
https://github.com/lite-xl/lite-xl-colors
### Plugins
The Lite XL that you are using on AmigaOS 4 is based on version 1.16.12
and not the latest version that is available by the development team.
This means that the latest plugins are not working at all or need some
modifications to work.
To make it easier for you, I gathered some of the plugins that are working
well, and I included them at the `addons/plugins`. For you to install the
ones you would like to use, you have to copy the `.lua` files into the
folder `.config/lite-xl/plugins/` and restart the editor.
The included plugins are the following:
**autoinsert**
Automatically inserts closing brackets and quotes. Also allows selected
text to be wrapped with brackets or quotes.
**autowrap**
Automatically hardwraps lines when typing
**bigclock**
Shows the current time and date in a view with large text
**bracketmatch**
Underlines matching pair for bracket under the caret
**colorpreview**
Underlays color values (eg. `#ff00ff` or `rgb(255, 0, 255)`) with their
resultant color.
**eofnewline**
Make sure the file ends with one blank line.
**ephemeraldocviews**
Preview tabs. Opening a doc will replace the contents of the preview tab.
Marks tabs as non-preview on any change or tab double clicking.
**ghmarkdown**
Opens a preview of the current markdown file in a browser window
**hidelinenumbers**
Hides the line numbers on the left of documents
**indentguide**
Adds indent guides
**language_make**
Syntax for the Make build system language
**language_sh**
Syntax for shell scripting language
**lfautoinsert**
Automatically inserts indentation and closing bracket/text after newline
**markers**
Add markers to docs and jump between them quickly
**memoryusage**
Show memory usage in the status view
**minimap**
Shows a minimap on the right-hand side of the docview.
**motiontrail**
Adds a motion-trail to the caret
**navigate**
Allows moving back and forward between document positions, reducing the
amount of scrolling
**rainbowparen**
Show nesting of parentheses with rainbow colours
**restoretabs**
Keep a list of recently closed tabs, and restore the tab in order on
cntrl+shift+t.
**selectionhighlight**
Highlights regions of code that match the current selection
**todotreeview**
Todo tree viewer for annotations in code like `TODO`, `BUG`, `FIX`,
`IMPROVEMENT`
## Tips and tricks
### Transitions
If you want to disable the transitions and make the scrolling a little faster,
open your configuration by clicking at the cog icon at the toolbar
(bottom left sixth icon) and add the followline at the end of the file and
save it.
```
config.transitions = false
```
### Hide files from the file list
If you would like to hide files or whole folder from the left side bar list,
open your configuration by clicking at the cog icon at the toolbar
(bottom left sixth icon) and add the followline at the end of the file and
save it. This hides all the files that start with a dot, and all the `.info`
files.
```
config.ignore_files = {"^%.", "%.info$"}
```
You can add as many rules as you want in there, to hide fore files or
folders, as you like.
## Know issues
You can find the known issues at
https://git.walkero.gr/walkero/lite-xl/issues
# Changelog
## [1.16.12.7] - 2022-01-11
## Added
- Added config.scroll_past_end that when its true lets the user scroll
further than the end of the file. By default is set to true.
- Added "SDL_RENDERER_ACCELERATED" and "SDL_RENDERER_PRESENTVSYNC" on
SDL_CreateRenderer() since this reduces the CPU usage when the user
scrolls and seems to work pretty good on my systems (X5000, A1222 and
microAmigaOne). This is exeprimental. If this brings problems on your
system, you can disable them using SDL ENV variable, like below:
setenv SDL_RENDER_VSYNC 0
setenv SDL_RENDER_DRIVER "software"
- Added plugins and color schemas in addons folder and information at
the README_OS4 file (#10)
## Changed
- Compiled Lite XL with gcc 8.4.0
## [1.16.12.6] - 2022-01-04
### Fixed
- Fixed a problem introduced in previous version when LiteXL was executed
from the root path of a partition or from ram disk (#13)
## [1.16.12.5] - 2022-01-03
### Changed
- Changed the Gfx memory leak solution to a fix that was applied by the
editor development team on Lua scripts at a later version. Less custom
code for AmigaOS 4 port.
- Now, when return from fullscreen, there is no extra header visible
at the top of the window content
### Fixed
- Fixed the assertion error and crash when the window is resized (#2)
- Fixed the resolution on fullscreen toggle to be like the workbench (#4)
- Fixed loading the current folder from terminal using the dot, like
`lite .` or without it (#3)
## [1.16.12.4] - 2021-12-31
### Fixed
- Fixed the Gfx memory leak. Now LiteXL frees the reserved memory from the
gfx card.
## [1.16.12.3] - 2021-12-29
### Changed
- Compiled with an experimental version of the latest Anti-Grain Geometry
library. This is might have issues and crash LiteXL
## [1.16.12.2] - 2021-12-26
### Added
- Added Amiga version. This version of LiteXL is based on v1.16.12 source code
which will not change. I will use the fourth digit to distinguish different
AmigaOS 4 releases, until a new port of the latest available source (v2.x)
is made.
### Fixed
- The keyboard shortcuts are now working
### Changed
- Now the `HOME` ENV variable is optional. If this is not set, the LiteXL
folder will be used to create user's `.config` folder

BIN
README_OS4.md.info Normal file

Binary file not shown.

0
data/colors/fall.lua Normal file → Executable file
View File

0
data/colors/summer.lua Normal file → Executable file
View File

0
data/core/command.lua Normal file → Executable file
View File

0
data/core/commands/command.lua Normal file → Executable file
View File

View File

@ -6,6 +6,7 @@ local LogView = require "core.logview"
local fullscreen = false
local restore_title_view = false
local function suggest_directory(text)
text = common.home_expand(text)
@ -27,9 +28,12 @@ command.add(nil, {
["core:toggle-fullscreen"] = function()
fullscreen = not fullscreen
if fullscreen then
restore_title_view = core.title_view.visible
end
system.set_window_mode(fullscreen and "fullscreen" or "normal")
core.show_title_bar(not fullscreen)
core.title_view:configure_hit_test(not fullscreen)
core.show_title_bar(not fullscreen and restore_title_view)
core.title_view:configure_hit_test(not fullscreen and restore_title_view)
end,
["core:reload-module"] = function()

0
data/core/commands/doc.lua Normal file → Executable file
View File

0
data/core/commands/drawwhitespace.lua Normal file → Executable file
View File

0
data/core/commands/files.lua Normal file → Executable file
View File

0
data/core/commands/findreplace.lua Normal file → Executable file
View File

0
data/core/commands/root.lua Normal file → Executable file
View File

0
data/core/commandview.lua Normal file → Executable file
View File

0
data/core/common.lua Normal file → Executable file
View File

View File

@ -6,6 +6,7 @@ config.max_log_items = 80
config.message_timeout = 5
config.mouse_wheel_scroll = 50 * SCALE
config.file_size_limit = 10
config.scroll_past_end = true
config.ignore_files = "^%."
config.symbol_pattern = "[%a_][%w_]*"
config.non_word_chars = " \t\n/\\()\"':,.;<>~!@#$%^&*|+=[]{}`?-"

0
data/core/doc/highlighter.lua Normal file → Executable file
View File

0
data/core/doc/init.lua Normal file → Executable file
View File

0
data/core/doc/search.lua Normal file → Executable file
View File

0
data/core/doc/translate.lua Normal file → Executable file
View File

View File

@ -96,7 +96,10 @@ function DocView:get_filename()
end
function DocView:get_scrollable_size()
function DocView:get_scrollable_size()
if not config.scroll_past_end then
return self:get_line_height() * (#self.doc.lines) + style.padding.y * 2
end
return self:get_line_height() * (#self.doc.lines - 1) + self.size.y
end

View File

@ -59,9 +59,9 @@ end
function core.reschedule_project_scan()
if core.project_scan_thread_id then
core.threads[core.project_scan_thread_id].wake = 0
end
-- if core.project_scan_thread_id then
-- core.threads[core.project_scan_thread_id].wake = 0
-- end
end
@ -512,6 +512,7 @@ function core.init()
core.redraw = true
core.visited_files = {}
core.restart_request = false
core.quite_request = false
core.replacements = whitespace_replacements()
core.root_view = RootView()
@ -535,7 +536,7 @@ function core.init()
local plugins_success, plugins_refuse_list = core.load_plugins()
do
local pdir, pname = project_dir_abs:match("(.*)[/\\\\](.*)")
local pdir, pname = project_dir_abs:match("(.*)[:/\\\\](.*)")
core.log("Opening project %q from directory %s", pname, pdir)
end
local got_project_error = not core.load_project_module()
@ -668,7 +669,8 @@ local function quit_with_function(quit_fn, force)
end
function core.quit(force)
quit_with_function(os.exit, force)
-- quit_with_function(os.exit, force)
quit_with_function(function() core.quit_request = true end, force)
end
@ -1044,7 +1046,7 @@ function core.run()
core.frame_start = system.get_time()
local did_redraw = core.step()
local need_more_work = run_threads()
if core.restart_request then break end
if core.restart_request or core.quit_request then break end
if not did_redraw and not need_more_work then
idle_iterations = idle_iterations + 1
-- do not wait of events at idle_iterations = 1 to give a chance at core.step to run

0
data/core/keymap-macos.lua Normal file → Executable file
View File

View File

@ -6,9 +6,12 @@ keymap.map = {}
keymap.reverse_map = {}
local macos = rawget(_G, "MACOS_RESOURCES")
local os4 = false
if PLATFORM == "AmigaOS 4" then
os4 = true
end
-- Thanks to mathewmariani, taken from his lite-macos github repository.
local modkeys_os = require("core.modkeys-" .. (macos and "macos" or "generic"))
local modkeys_os = require("core.modkeys-" .. (macos and "macos" or os4 and "os4" or "generic"))
local modkey_map = modkeys_os.map
local modkeys = modkeys_os.keys

0
data/core/logview.lua Normal file → Executable file
View File

0
data/core/modkeys-generic.lua Normal file → Executable file
View File

0
data/core/modkeys-macos.lua Normal file → Executable file
View File

15
data/core/modkeys-os4.lua Executable file
View File

@ -0,0 +1,15 @@
local modkeys = {}
modkeys.map = {
["left amiga"] = "cmd",
["right amiga"] = "cmd",
["control"] = "ctrl",
["left shift"] = "shift",
["right shift"] = "shift",
["left alt"] = "alt",
["right alt"] = "altgr",
}
modkeys.keys = { "cmd", "ctrl", "alt", "altgr", "shift" }
return modkeys

0
data/core/nagview.lua Normal file → Executable file
View File

0
data/core/object.lua Normal file → Executable file
View File

0
data/core/rootview.lua Normal file → Executable file
View File

0
data/core/start.lua Normal file → Executable file
View File

0
data/core/statusview.lua Normal file → Executable file
View File

0
data/core/strict.lua Normal file → Executable file
View File

0
data/core/style.lua Normal file → Executable file
View File

0
data/core/syntax.lua Normal file → Executable file
View File

0
data/core/titleview.lua Normal file → Executable file
View File

0
data/core/tokenizer.lua Normal file → Executable file
View File

0
data/core/view.lua Normal file → Executable file
View File

0
data/fonts/FiraSans-Regular.ttf Normal file → Executable file
View File

0
data/fonts/JetBrainsMono-Regular.ttf Normal file → Executable file
View File

0
data/fonts/icons.ttf Normal file → Executable file
View File

0
data/plugins/autocomplete.lua Normal file → Executable file
View File

0
data/plugins/autoreload.lua Normal file → Executable file
View File

0
data/plugins/detectindent.lua Normal file → Executable file
View File

0
data/plugins/language_c.lua Normal file → Executable file
View File

0
data/plugins/language_cpp.lua Normal file → Executable file
View File

0
data/plugins/language_css.lua Normal file → Executable file
View File

0
data/plugins/language_html.lua Normal file → Executable file
View File

0
data/plugins/language_js.lua Normal file → Executable file
View File

0
data/plugins/language_lua.lua Normal file → Executable file
View File

0
data/plugins/language_md.lua Normal file → Executable file
View File

0
data/plugins/language_python.lua Normal file → Executable file
View File

0
data/plugins/language_xml.lua Normal file → Executable file
View File

0
data/plugins/macro.lua Normal file → Executable file
View File

0
data/plugins/projectsearch.lua Normal file → Executable file
View File

0
data/plugins/quote.lua Normal file → Executable file
View File

0
data/plugins/reflow.lua Normal file → Executable file
View File

0
data/plugins/tabularize.lua Normal file → Executable file
View File

0
data/plugins/toolbarview.lua Normal file → Executable file
View File

0
data/plugins/treeview.lua Normal file → Executable file
View File

0
data/plugins/trimwhitespace.lua Normal file → Executable file
View File

0
data/plugins/workspace.lua Normal file → Executable file
View File

14
lib/font_renderer/os4build.sh Executable file
View File

@ -0,0 +1,14 @@
#!/bin/bash
cxxcompiler="g++"
cxxflags="-Wall -O3 -g -std=c++03 -fno-exceptions -fno-rtti -Isrc -Ilib/font_renderer -DFONT_RENDERER_HEIGHT_HACK -lagg -lfreetype -I/sdk/local/common/include/agg"
echo "compiling font renderer library..."
g++ -c $cxxflags agg_font_freetype.cpp -o agg_font_freetype.o
g++ -c $cxxflags font_renderer.cpp -o font_renderer.o
ar -rcs libfontrenderer.a *.o
rm *.o
echo "font renderer library created"

BIN
lite.info Normal file

Binary file not shown.

34
os4build.sh Normal file
View File

@ -0,0 +1,34 @@
#!/bin/bash
outfile="lite"
compiler="gcc"
cxxcompiler="g++"
INCPATH="-Isrc -Ilib/font_renderer -I/sdk/local/newlib/include/SDL2"
DFLAGS="-D__USE_INLINE__ -DLITE_XL_DATA_USE_EXEDIR -DLITE_USE_SDL_RENDERER"
CFLAGS="-Wall -O3 -std=gnu11 -fno-strict-aliasing"
LFLAGS="-mcrt=newlib -static-libgcc -static-libstdc++ -lauto -lSDL2 -lfontrenderer -lagg -lfreetype -llua -lm -lpthread -athread=native"
echo "compiling lite..."
gcc -c src/fontdesc.c -o fontdesc.o $CFLAGS $INCPATH $DFLAGS
gcc -c src/main.c -o main.o $CFLAGS $INCPATH $DFLAGS
gcc -c src/rencache.c -o rencache.o $CFLAGS $INCPATH $DFLAGS
gcc -c src/renderer.c -o renderer.o $CFLAGS $INCPATH $DFLAGS
gcc -c src/renwindow.c -o renwindow.o $CFLAGS $INCPATH $DFLAGS
gcc -c src/api/api.c -o api.o $CFLAGS $INCPATH $DFLAGS
gcc -c src/api/cp_replace.c -o cp_replace.o $CFLAGS $INCPATH $DFLAGS
gcc -c src/api/renderer.c -o apirenderer.o $CFLAGS $INCPATH $DFLAGS
gcc -c src/api/renderer_font.c -o renderer_font.o $CFLAGS $INCPATH $DFLAGS
gcc -c src/api/system.c -o system.o $CFLAGS $INCPATH $DFLAGS
gcc -c src/platform/amigaos4.c -o amigaos4.o $CFLAGS $INCPATH $DFLAGS
echo "linking..."
g++ -o $outfile *.o $LFLAGS
echo "cleaning up..."
rm *.o
echo "done"

BIN
release_files/LiteXL.info Normal file

Binary file not shown.

Binary file not shown.

BIN
release_files/addons.info Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,28 @@
local style = require "core.style"
local common = require "core.common"
style.background = { common.color "#073642" }
style.background2 = { common.color "#073642" }
style.background3 = { common.color "#073642" }
style.text = { common.color "#00d1d1" }
style.caret = { common.color "#f053f3" }
style.accent = { common.color "#f053f3" }
style.dim = { common.color "#586e75" }
style.divider = { common.color "#6c71c4" }
style.selection = { common.color "#415256" }
style.line_number = { common.color "#586e75" }
style.line_number2 = { common.color "#f053f3" }
style.line_highlight = { common.color "#415256" }
style.scrollbar = { common.color "#6c71c4" }
style.scrollbar2 = { common.color "#6c71c4" }
style.syntax["normal"] = { common.color "#00d1d1" }
style.syntax["symbol"] = { common.color "#00ff7f" }
style.syntax["comment"] = { common.color "#6c71c4" }
style.syntax["keyword"] = { common.color "#6c71c4" }
style.syntax["keyword2"] = { common.color "#6c71c4" }
style.syntax["number"] = { common.color "#00ff7f" }
style.syntax["literal"] = { common.color "#1586d2" }
style.syntax["string"] = { common.color "#f7f97d" }
style.syntax["operator"] = { common.color "#00ff7f" }
style.syntax["function"] = { common.color "#55ffff" }

View File

@ -0,0 +1,28 @@
local style = require "core.style"
local common = require "core.common"
style.background = { common.color "#282a36" }
style.background2 = { common.color "#21222b" }
style.background3 = { common.color "#21222b" }
style.text = { common.color "#7b81a6" }
style.caret = { common.color "#f8f8f0" }
style.accent = { common.color "#8be9fd" }
style.dim = { common.color "#4f5873" }
style.divider = { common.color "#1f2029" }
style.selection = { common.color "#44475a" }
style.line_number = { common.color "#53576e" }
style.line_number2 = { common.color "#f8f8f0" }
style.line_highlight = { common.color "#313442" }
style.scrollbar = { common.color "#44475a" }
style.scrollbar2 = { common.color "#ff79c6" }
style.syntax["normal"] = { common.color "#f8f8f2" }
style.syntax["symbol"] = { common.color "#f8f8f2" }
style.syntax["comment"] = { common.color "#6272a4" }
style.syntax["keyword"] = { common.color "#ff79c6" }
style.syntax["keyword2"] = { common.color "#ff79c6" }
style.syntax["number"] = { common.color "#bd93f9" }
style.syntax["literal"] = { common.color "#f1fa8c" }
style.syntax["string"] = { common.color "#f1fa8c" }
style.syntax["operator"] = { common.color "#ff79c6" }
style.syntax["function"] = { common.color "#50fa7b" }

View File

@ -0,0 +1,37 @@
local style = require "core.style"
local common = require "core.common"
math.randomseed(os.time())
local color = {
math.random(90, 255),
math.random(90, 255),
math.random(90, 255)
}
style.background = { common.color "#151515" }
style.background2 = { common.color "#151515" }
style.background3 = { common.color "#151515" }
style.text = { common.color "#707070" }
style.caret = { common.color "#dfdfdf" }
style.accent = { common.color "#d0d0d0" }
style.dim = { common.color "#303030" }
style.divider = { common.color "#151515" }
style.selection = { common.color "#303030" }
style.line_number = { common.color "#252525" }
style.line_number2 = { common.color "#444444" }
style.line_highlight = { common.color "#101010" }
style.scrollbar = { common.color "#252525" }
style.scrollbar2 = { common.color "#444444" }
style.syntax = {}
style.syntax["normal"] = { common.color "#a0a0a0" }
style.syntax["symbol"] = { common.color "#a0a0a0" }
style.syntax["comment"] = { common.color "#404040" }
style.syntax["keyword"] = { common.color "#dfdfdf" }
style.syntax["keyword2"] = { common.color "#dfdfdf" }
style.syntax["number"] = { common.color "#dfdfdf" }
style.syntax["literal"] = { common.color "#dfdfdf" }
style.syntax["string"] = { common.color "#dfdfdf" }
style.syntax["operator"] = color
style.syntax["function"] = color

View File

@ -0,0 +1,29 @@
local style = require "core.style"
local common = require "core.common"
style.background = { common.color "#151515" }
style.background2 = { common.color "#151515" }
style.background3 = { common.color "#151515" }
style.text = { common.color "#707070" }
style.caret = { common.color "#dfdfdf" }
style.accent = { common.color "#d0d0d0" }
style.dim = { common.color "#303030" }
style.divider = { common.color "#151515" }
style.selection = { common.color "#242424" }
style.line_number = { common.color "#252525" }
style.line_number2 = { common.color "#444444" }
style.line_highlight = { common.color "#101010" }
style.scrollbar = { common.color "#252525" }
style.scrollbar2 = { common.color "#444444" }
style.syntax = {}
style.syntax["normal"] = { common.color "#a0a0a0" }
style.syntax["symbol"] = { common.color "#a0a0a0" }
style.syntax["comment"] = { common.color "#404040" }
style.syntax["keyword"] = { common.color "#dfdfdf" }
style.syntax["keyword2"] = { common.color "#dfdfdf" }
style.syntax["number"] = { common.color "#dfdfdf" }
style.syntax["literal"] = { common.color "#dfdfdf" }
style.syntax["string"] = { common.color "#dfdfdf" }
style.syntax["operator"] = { common.color "#01A870" }
style.syntax["function"] = { common.color "#01A870" }

View File

@ -0,0 +1,28 @@
local style = require "core.style"
local common = require "core.common"
style.background = { common.color "#282828" }
style.background2 = { common.color "#1d2021" }
style.background3 = { common.color "#1d2021" }
style.text = { common.color "#928374" }
style.caret = { common.color "#fbf1c7" }
style.accent = { common.color "#ebdbb2" }
style.dim = { common.color "#928374" }
style.divider = { common.color "#1d2021" }
style.selection = { common.color "#3c3836" }
style.line_number = { common.color "#928374" }
style.line_number2 = { common.color "#ebdbb2" }
style.line_highlight = { common.color "#32302f" }
style.scrollbar = { common.color "#928374" }
style.scrollbar2 = { common.color "#fbf1c7" }
style.syntax["normal"] = { common.color "#ebdbb2" }
style.syntax["symbol"] = { common.color "#ebdbb2" }
style.syntax["comment"] = { common.color "#928374" }
style.syntax["keyword"] = { common.color "#fb4934" }
style.syntax["keyword2"] = { common.color "#83a598" }
style.syntax["number"] = { common.color "#d3869b" }
style.syntax["literal"] = { common.color "#d3869b" }
style.syntax["string"] = { common.color "#b8bb26" }
style.syntax["operator"] = { common.color "#ebdbb2" }
style.syntax["function"] = { common.color "#8ec07c" }

View File

@ -0,0 +1,32 @@
-- Liqube Dark Code for Lite <liqube.com>
local style = require "core.style"
local common = require "core.common"
style.background = { common.color "#13171e" }
style.background2 = { common.color "#21252b" }
style.background3 = { common.color "#21252b" }
style.text = { common.color "#abb2bf" }
style.caret = { common.color "#abb2bf" }
style.accent = { common.color "#ffffff" }
style.dim = { common.color "#545e70" }
style.divider = { common.color "#242223" }
style.selection = { common.color "#3e4451" }
style.line_number = { common.color "#323641" }
style.line_number2 = { common.color "#596275" }
style.line_highlight = { common.color "#1c1f25" }
style.scrollbar = { common.color "#3d3f43" }
style.scrollbar2 = { common.color "#595b5f" }
style.guide = { common.color "#1c1f25" } -- indentguide
style.syntax["normal"] = { common.color "#abb2bf" }
style.syntax["symbol"] = { common.color "#71a9d7" }
style.syntax["comment"] = { common.color "#5c6370" }
style.syntax["keyword"] = { common.color "#98c875" }
style.syntax["keyword2"] = { common.color "#ffffff" }
style.syntax["number"] = { common.color "#ffffff" }
style.syntax["literal"] = { common.color "#ea5964" }
style.syntax["string"] = { common.color "#ea5964" }
style.syntax["operator"] = { common.color "#657085" }
style.syntax["function"] = { common.color "#ffffff" }
style.syntax["preprocessor"] = { common.color "#98c875" } -- thinking ahead

View File

@ -0,0 +1,28 @@
local style = require "core.style"
local common = require "core.common"
style.background = { common.color "#303841" }
style.background2 = { common.color "#1d2227" }
style.background3 = { common.color "#1d2227" }
style.text = { common.color "#9ea191" }
style.caret = { common.color "#61efce" }
style.accent = { common.color "#ffd152" }
style.dim = { common.color "#4c5863" }
style.divider = { common.color "#242223" }
style.selection = { common.color "#4c5863" }
style.line_number = { common.color "#bfc5d0" }
style.line_number2 = { common.color "#848b95" }
style.line_highlight = { common.color "#303841" }
style.scrollbar = { common.color "#696f75" }
style.scrollbar2 = { common.color "#444b53" }
style.syntax["normal"] = { common.color "#d7dde9" }
style.syntax["symbol"] = { common.color "#d8dee9" }
style.syntax["comment"] = { common.color "#a6acb9" }
style.syntax["keyword"] = { common.color "#e55e66" }
style.syntax["keyword2"] = { common.color "#ef6179" }
style.syntax["number"] = { common.color "#ffd152" }
style.syntax["literal"] = { common.color "#e75550" }
style.syntax["string"] = { common.color "#939d5d" }
style.syntax["operator"] = { common.color "#c2674f" }
style.syntax["function"] = { common.color "#6699ca" }

View File

@ -0,0 +1,29 @@
local style = require "core.style"
local common = require "core.common"
style.background = { common.color "#080808" }
style.background2 = { common.color "#080808" }
style.background3 = { common.color "#101010" }
style.text = { common.color "#707070" }
style.caret = { common.color "#ffffff" }
style.accent = { common.color "#d0d0d0" }
style.dim = { common.color "#303030" }
style.divider = { common.color "#080808" }
style.selection = { common.color "#242424" }
style.line_number = { common.color "#202020" }
style.line_number2 = { common.color "#707070" }
style.line_highlight = { common.color "#101010" }
style.scrollbar = { common.color "#252525" }
style.scrollbar2 = { common.color "#303030" }
style.syntax = {}
style.syntax["normal"] = { common.color "#a0a0a0" }
style.syntax["symbol"] = { common.color "#a0a0a0" }
style.syntax["comment"] = { common.color "#404040" }
style.syntax["keyword"] = { common.color "#f0f0f0" }
style.syntax["keyword2"] = { common.color "#f0f0f0" }
style.syntax["number"] = { common.color "#f0f0f0" }
style.syntax["literal"] = { common.color "#f0f0f0" }
style.syntax["string"] = { common.color "#f0f0f0" }
style.syntax["operator"] = { common.color "#f0f0f0" }
style.syntax["function"] = { common.color "#a0a0a0" }

View File

@ -0,0 +1,28 @@
local style = require "core.style"
local common = require "core.common"
style.background = { common.color "#272822" }
style.background2 = { common.color "#22231C" }
style.background3 = { common.color "#22231C" }
style.text = { common.color "#9ea191" }
style.caret = { common.color "#F8F8F0" }
style.accent = { common.color "#F8F8F2" }
style.dim = { common.color "#5e6052" }
style.divider = { common.color "#1b1c17" }
style.selection = { common.color "#49483E" }
style.line_number = { common.color "#75715E" }
style.line_number2 = { common.color "#d2d0c6" }
style.line_highlight = { common.color "#36372f" }
style.scrollbar = { common.color "#49483E" }
style.scrollbar2 = { common.color "#636254" }
style.syntax["normal"] = { common.color "#F8F8F2" }
style.syntax["symbol"] = { common.color "#F8F8F2" }
style.syntax["comment"] = { common.color "#75715E" }
style.syntax["keyword"] = { common.color "#F92672" }
style.syntax["keyword2"] = { common.color "#66DAEF" }
style.syntax["number"] = { common.color "#AE81FF" }
style.syntax["literal"] = { common.color "#AE81FF" }
style.syntax["string"] = { common.color "#E6DB74" }
style.syntax["operator"] = { common.color "#F8F8F2" }
style.syntax["function"] = { common.color "#A6E22E" }

View File

@ -0,0 +1,28 @@
local style = require "core.style"
local common = require "core.common"
style.background = { common.color "#282923" }
style.background2 = { common.color "#181915" }
style.background3 = { common.color "#181915" }
style.text = { common.color "#9ea191" }
style.caret = { common.color "#f8f8f2" }
style.accent = { common.color "#f8f8f2" }
style.dim = { common.color "#5e6052" }
style.divider = { common.color "#1b1c17" }
style.selection = { common.color "#3a3a32" }
style.line_number = { common.color "#90918b" }
style.line_number2 = { common.color "#d2d0c6" }
style.line_highlight = { common.color "#282923" }
style.scrollbar = { common.color "#63635f" }
style.scrollbar2 = { common.color "#3d3d38" }
style.syntax["normal"] = { common.color "#f8f8f2" }
style.syntax["symbol"] = { common.color "#f8f8f2" }
style.syntax["comment"] = { common.color "#75715E" }
style.syntax["keyword"] = { common.color "#f92472" }
style.syntax["keyword2"] = { common.color "#f92472" }
style.syntax["number"] = { common.color "#ac80ff" }
style.syntax["literal"] = { common.color "#e7db74" }
style.syntax["string"] = { common.color "#e7db74" }
style.syntax["operator"] = { common.color "#f92472" }
style.syntax["function"] = { common.color "#5cd5ef" }

View File

@ -0,0 +1,39 @@
local style = require "core.style"
local common = require "core.common"
local config = require "core.config"
style.background = { common.color "#2E3440" }
style.background2 = { common.color "#2E3440" }
style.background3 = { common.color "#3B4252" }
style.text = { common.color "#D8DEE9" }
style.caret = { common.color "#D8DEE9" }
style.accent = { common.color "#88C0D0" }
style.dim = { common.color "#d8dee966" }
style.divider = { common.color "#3B4252" }
style.selection = { common.color "#434C5ECC" }
style.line_number = { common.color "#4C566A" }
style.line_number2 = { common.color "#D8DEE9" }
style.line_highlight = { common.color "#3B4252" }
style.scrollbar = { common.color "#434c5eaa" }
style.scrollbar2 = { common.color "#434c5e" }
style.good = { common.color "#72b886cc" }
style.warn = { common.color "#d08770" }
style.error = { common.color "#bf616a" }
style.modified = { common.color "#ebcb8b" }
style.syntax["normal"] = { common.color "#ECEFF4" }
style.syntax["symbol"] = { common.color "#D8DEE9" }
style.syntax["comment"] = { common.color "#616E88" }
style.syntax["keyword"] = { common.color "#81A1C1" }
style.syntax["keyword2"] = { common.color "#81A1C1" }
style.syntax["number"] = { common.color "#B48EAD" }
style.syntax["literal"] = { common.color "#81A1C1" }
style.syntax["string"] = { common.color "#A3BE8C" }
style.syntax["operator"] = { common.color "#81A1C1" }
style.syntax["function"] = { common.color "#88C0D0" }
config.highlight_current_line = "no_selection"
style.guide = { common.color "#434c5eb3" }
style.bracketmatch_color = { common.color "#8fbcbb" }

View File

@ -0,0 +1,29 @@
local style = require "core.style"
local common = require "core.common"
style.background = { common.color "#282c34" }
style.background2 = { common.color "#21252B" }
style.background3 = { common.color "#21252B" }
style.text = { common.color "#abb2bf" }
style.caret = { common.color "#528bff" }
style.accent = { common.color "#ffffff" }
style.dim = { common.color "#4f5873" }
style.divider = { common.color "#181A1F" }
style.selection = { common.color "#383D49" }
style.line_number = { common.color "#53576e" }
style.line_number2 = { common.color "#666B76" }
style.line_highlight = { common.color "#2C333E" }
style.scrollbar = { common.color "#4f5873" }
style.scrollbar2 = { common.color "#3060C1" }
style.syntax["normal"] = { common.color "#abb2bf" }
style.syntax["symbol"] = { common.color "#abb2bf" }
style.syntax["comment"] = { common.color "#5f697a" }
style.syntax["keyword"] = { common.color "#cd74e8" }
style.syntax["keyword2"] = { common.color "#eb6772" }
style.syntax["number"] = { common.color "#db9d63" }
style.syntax["literal"] = { common.color "#e6c07b" }
style.syntax["string"] = { common.color "#9acc76" }
style.syntax["operator"] = { common.color "#abb2bf" }
style.syntax["function"] = { common.color "#5cb3fa" }

View File

@ -0,0 +1,31 @@
local style = require "core.style"
local common = require "core.common"
style.background = { common.color "#242424" }
style.background2 = { common.color "#252528" }
style.background3 = { common.color "#44475A" }
style.text = { common.color "#fffff0" }
style.caret = { common.color "#69FF94" }
style.accent = { common.color "#ff0fff" }
style.dim = { common.color "#0fffff" }
style.divider = { common.color "#7b7f8b" }
style.selection = { common.color "#48484f" }
style.selectionhighlight = { common.color "#dddeee" }
style.line_number = { common.color "#525259" }
style.line_number2 = { common.color "#f6f6e0" }
style.line_highlight = { common.color "#343438" }
style.scrollbar = { common.color "#414146" }
style.scrollbar2 = { common.color "#4b4bff" }
style.syntax["normal"] = { common.color "#e1e1e6" }
style.syntax["symbol"] = { common.color "#97e1f1" }
style.syntax["comment"] = { common.color "#676b6f" }
style.syntax["keyword"] = { common.color "#E58AC9" }
style.syntax["keyword2"] = { common.color "#F77483" }
style.syntax["number"] = { common.color "#FFA94D" }
style.syntax["literal"] = { common.color "#ee6666" }
style.syntax["string"] = { common.color "#f7c95c" }
style.syntax["operator"] = { common.color "#93DDFA" }
style.syntax["function"] = { common.color "#bf9eee" }

View File

@ -0,0 +1,37 @@
-- Most of the colors are taken from:
-- https://github.com/microsoft/vscode/tree/master/extensions/theme-defaults/themes
local style = require "core.style"
local common = require "core.common"
style.background = { common.color "#1E1E1E" }
style.background2 = { common.color "#252526" }
style.background3 = { common.color "#252526" }
style.text = { common.color "#D4D4D4" }
style.caret = { common.color "#FFFFFF" }
style.accent = { common.color "#76BCFF" } -- Text in autocomplete and command, col(>80) in satusbar
style.dim = { common.color "#7A7A7A" } -- Text of nonactive tabs, prefix in log
style.divider = { common.color "#1E1E1E" }
style.selection = { common.color "#264F78" }
style.line_number = { common.color "#707070" }
style.line_number2 = { common.color "#A0A0A0" } -- Number on line with caret
style.line_highlight = { common.color "#333A40"}
style.scrollbar = { common.color "#404040" }
style.scrollbar2 = { common.color "#707070" } -- Hovered
style.syntax["normal"] = { common.color "#D4D4D4" }
style.syntax["symbol"] = { common.color "#D4D4D4" }
style.syntax["comment"] = { common.color "#6A9955" }
style.syntax["keyword"] = { common.color "#569CD6" } -- local function end, if case
style.syntax["keyword2"] = { common.color "#C586C0" } -- self, int float
style.syntax["number"] = { common.color "#B5CEA8" }
style.syntax["literal"] = { common.color "#569CD6" }
style.syntax["string"] = { common.color "#CE9178" }
style.syntax["operator"] = { common.color "#8590A5"} -- = + - / < >
style.syntax["function"] = { common.color "#DCDCAA" }
-- PLUGINS
style.linter_warning = { common.color "#B89500" } -- linter
style.bracketmatch_color = { common.color "#76BCFF" } -- bracketmatch
style.guide = { common.color "#404040" } -- indentguide
style.guide_width = 1 -- indentguide

View File

@ -0,0 +1,28 @@
local style = require "core.style"
local common = require "core.common"
style.background = { common.color "#282a36" }
style.background2 = { common.color "#22242e" }
style.background3 = { common.color "#22242e" }
style.text = { common.color "#aab3e6" }
style.caret = { common.color "#f5faff" }
style.accent = { common.color "#ffb86c" }
style.dim = { common.color "#4f526b" }
style.divider = { common.color "#22242e" }
style.selection = { common.color "#4c5163" }
style.line_number = { common.color "#44475a" }
style.line_number2 = { common.color "#717796" }
style.line_highlight = { common.color "#2d303d" }
style.scrollbar = { common.color "#44475a" }
style.scrollbar2 = { common.color "#4c5163" }
style.syntax["normal"] = { common.color "#f5faff" }
style.syntax["symbol"] = { common.color "#f5faff" }
style.syntax["comment"] = { common.color "#6272a4" }
style.syntax["keyword"] = { common.color "#ff79c6" }
style.syntax["keyword2"] = { common.color "#8be9fd" }
style.syntax["number"] = { common.color "#bd93f9" }
style.syntax["literal"] = { common.color "#bd93f9" }
style.syntax["string"] = { common.color "#f1fa8c" }
style.syntax["operator"] = { common.color "#ff79c6" }
style.syntax["function"] = { common.color "#8be9fd" }

View File

@ -0,0 +1,28 @@
local style = require "core.style"
local common = require "core.common"
style.background = { common.color "#404040" }
style.background2 = { common.color "#3d3d3d" }
style.background3 = { common.color "#2b2b2b" }
style.text = { common.color "#dcdccc" }
style.caret = { common.color "#f8f8f0" }
style.accent = { common.color "#dcdccc" }
style.dim = { common.color "#8f8f8f" }
style.divider = { common.color "#383838" }
style.selection = { common.color "#2f2f2f" }
style.line_number = { common.color "#545454" }
style.line_number2 = { common.color "#545454" }
style.line_highlight = { common.color "#383838" }
style.scrollbar = { common.color "#4c4c4c" }
style.scrollbar2 = { common.color "#5e5e5e" }
style.syntax["normal"] = { common.color "#dcdccc" }
style.syntax["symbol"] = { common.color "#dcdccc" }
style.syntax["comment"] = { common.color "#7f9f7f" }
style.syntax["keyword"] = { common.color "#f0dfaf" }
style.syntax["keyword2"] = { common.color "#dfdfbf" }
style.syntax["number"] = { common.color "#8cd0d3" }
style.syntax["literal"] = { common.color "#dfaf8f" }
style.syntax["string"] = { common.color "#cc9393" }
style.syntax["operator"] = { common.color "#f0efd0" }
style.syntax["function"] = { common.color "#efef8f" }

Binary file not shown.

View File

@ -0,0 +1,31 @@
local style = require "core.style"
local common = require "core.common"
-- GitHubs style varies from language to language so its hard to get perfect
-- Originally written by thebirk, 2019
style.background = { common.color "#fbfbfb" }
style.background2 = { common.color "#f2f2f2" }
style.background3 = { common.color "#f2f2f2" }
style.text = { common.color "#404040" }
style.caret = { common.color "#181818" }
style.accent = { common.color "#0366d6" }
style.dim = { common.color "#b0b0b0" }
style.divider = { common.color "#e8e8e8" }
style.selection = { common.color "#b7dce8" }
style.line_number = { common.color "#d0d0d0" }
style.line_number2 = { common.color "#808080" }
style.line_highlight = { common.color "#f2f2f2" }
style.scrollbar = { common.color "#e0e0e0" }
style.scrollbar2 = { common.color "#c0c0c0" }
style.syntax["normal"] = { common.color "#24292e" }
style.syntax["symbol"] = { common.color "#24292e" }
style.syntax["comment"] = { common.color "#6a737d" }
style.syntax["keyword"] = { common.color "#d73a49" }
style.syntax["keyword2"] = { common.color "#d73a49" }
style.syntax["number"] = { common.color "#005cc5" }
style.syntax["literal"] = { common.color "#005cc5" }
style.syntax["string"] = { common.color "#032f62" }
style.syntax["operator"] = { common.color "#d73a49" }
style.syntax["function"] = { common.color "#005cc5" }

View File

@ -0,0 +1,28 @@
local style = require "core.style"
local common = require "core.common"
style.background = { common.color "#f7f9f9" }
style.background2 = { common.color "#f7f9f9" }
style.background3 = { common.color "#f7f9f9" }
style.text = { common.color "#404040" }
style.caret = { common.color "#ff5971" }
style.accent = { common.color "#ff5971" }
style.dim = { common.color "#b0b0b0" }
style.divider = { common.color "#e8e8e8" }
style.selection = { common.color "#fde6eb" }
style.line_number = { common.color "#d0d0d0" }
style.line_number2 = { common.color "#808080" }
style.line_highlight = { common.color "#f2f2f2" }
style.scrollbar = { common.color "#e0e0e0" }
style.scrollbar2 = { common.color "#c0c0c0" }
style.syntax["normal"] = { common.color "#181818" }
style.syntax["symbol"] = { common.color "#181818" }
style.syntax["comment"] = { common.color "#43cdbd" }
style.syntax["keyword"] = { common.color "#5f7dcd" }
style.syntax["keyword2"] = { common.color "#9c53c6" }
style.syntax["number"] = { common.color "#3daee9" }
style.syntax["literal"] = { common.color "#3daee9" }
style.syntax["string"] = { common.color "#3daee9" }
style.syntax["operator"] = { common.color "#5f7dcd" }
style.syntax["function"] = { common.color "#9c53c6" }

View File

@ -0,0 +1,28 @@
local style = require "core.style"
local common = require "core.common"
style.background = { common.color "#fdf6e3" }
style.background2 = { common.color "#eee8d5" }
style.background3 = { common.color "#eee8d5" }
style.text = { common.color "#657b83" }
style.caret = { common.color "#657b83" }
style.accent = { common.color "#002b36" }
style.dim = { common.color "#93a1a1" }
style.divider = { common.color "#e0dbc8" }
style.selection = { common.color "#eee8d5" }
style.line_number = { common.color "#93a1a1" }
style.line_number2 = { common.color "#002b36" }
style.line_highlight = { common.color "#eee8d5" }
style.scrollbar = { common.color "#e0dbc8" }
style.scrollbar2 = { common.color "#bfbbaa" }
style.syntax["normal"] = { common.color "#657b83" }
style.syntax["symbol"] = { common.color "#657b83" }
style.syntax["comment"] = { common.color "#93a1a1" }
style.syntax["keyword"] = { common.color "#859900" }
style.syntax["keyword2"] = { common.color "#268bd2" }
style.syntax["number"] = { common.color "#d33682" }
style.syntax["literal"] = { common.color "#2aa198" }
style.syntax["string"] = { common.color "#2aa198" }
style.syntax["operator"] = { common.color "#859900" }
style.syntax["function"] = { common.color "#268bd2" }

View File

@ -0,0 +1,28 @@
local style = require "core.style"
local common = require "core.common"
style.background = { common.color "#fdf6e3" }
style.background2 = { common.color "#2e2c29" }
style.background3 = { common.color "#3e3c37" }
style.text = { common.color "#b2ada1" }
style.caret = { common.color "#b2ada1" }
style.accent = { common.color "#6c71c4" }
style.dim = { common.color "#b2ada1" }
style.divider = { common.color "#201f1d" }
style.selection = { common.color "#eee8d5" }
style.line_number = { common.color "#93a1a1" }
style.line_number2 = { common.color "#002b36" }
style.line_highlight = { common.color "#fcefcd" }
style.scrollbar = { common.color "#e0dbc8" }
style.scrollbar2 = { common.color "#9d9988" }
style.syntax["normal"] = { common.color "#3e3c37" }
style.syntax["symbol"] = { common.color "#4c4f82" }
style.syntax["comment"] = { common.color "#93a1a1" }
style.syntax["keyword"] = { common.color "#d33682" }
style.syntax["keyword2"] = { common.color "#6c71c4" }
style.syntax["number"] = { common.color "#859900" }
style.syntax["literal"] = { common.color "#b58900" }
style.syntax["string"] = { common.color "#cb4b16" }
style.syntax["operator"] = { common.color "#859900" }
style.syntax["function"] = { common.color "#268bd2" }

Binary file not shown.

View File

@ -0,0 +1,115 @@
-- mod-version:1 -- lite-xl 1.16
local core = require "core"
local translate = require "core.doc.translate"
local config = require "core.config"
local DocView = require "core.docview"
local command = require "core.command"
local keymap = require "core.keymap"
config.autoinsert_map = {
["["] = "]",
["{"] = "}",
["("] = ")",
['"'] = '"',
["'"] = "'",
["`"] = "`",
}
local function is_closer(chr)
for _, v in pairs(config.autoinsert_map) do
if v == chr then
return true
end
end
end
local function count_char(text, chr)
local count = 0
for _ in text:gmatch(chr) do
count = count + 1
end
return count
end
local on_text_input = DocView.on_text_input
function DocView:on_text_input(text)
local mapping = config.autoinsert_map[text]
-- prevents plugin from operating on `CommandView`
if getmetatable(self) ~= DocView then
return on_text_input(self, text)
end
-- wrap selection if we have a selection
if mapping and self.doc:has_selection() then
local l1, c1, l2, c2, swap = self.doc:get_selection(true)
self.doc:insert(l2, c2, mapping)
self.doc:insert(l1, c1, text)
self.doc:set_selection(l1, c1, l2, c2 + 2, swap)
return
end
-- skip inserting closing text
local chr = self.doc:get_char(self.doc:get_selection())
if text == chr and is_closer(chr) then
self.doc:move_to(1)
return
end
-- don't insert closing quote if we have a non-even number on this line
local line = self.doc:get_selection()
if text == mapping and count_char(self.doc.lines[line], text) % 2 == 1 then
return on_text_input(self, text)
end
-- auto insert closing bracket
if mapping and (chr:find("%s") or is_closer(chr) and chr ~= '"') then
on_text_input(self, text)
on_text_input(self, mapping)
self.doc:move_to(-1)
return
end
on_text_input(self, text)
end
local function predicate()
return getmetatable(core.active_view) == DocView
and not core.active_view.doc:has_selection()
end
command.add(predicate, {
["autoinsert:backspace"] = function()
local doc = core.active_view.doc
local l, c = doc:get_selection()
local chr = doc:get_char(l, c)
if config.autoinsert_map[doc:get_char(l, c - 1)] and is_closer(chr) then
doc:delete_to(1)
end
command.perform "doc:backspace"
end,
["autoinsert:delete-to-previous-word-start"] = function()
local doc = core.active_view.doc
local le, ce = translate.previous_word_start(doc, doc:get_selection())
while true do
local l, c = doc:get_selection()
if l == le and c == ce then
break
end
command.perform "autoinsert:backspace"
end
end,
})
keymap.add {
["backspace"] = "autoinsert:backspace",
["ctrl+backspace"] = "autoinsert:delete-to-previous-word-start",
["ctrl+shift+backspace"] = "autoinsert:delete-to-previous-word-start",
}

View File

@ -0,0 +1,36 @@
-- mod-version:1 -- lite-xl 1.16
require "plugins.reflow"
local config = require "core.config"
local command = require "core.command"
local DocView = require "core.docview"
config.autowrap_files = { "%.md$", "%.txt$" }
local on_text_input = DocView.on_text_input
DocView.on_text_input = function(self, ...)
on_text_input(self, ...)
-- early-exit if the filename does not match a file type pattern
local filename = self.doc.filename or ""
local matched = false
for _, ptn in ipairs(config.autowrap_files) do
if filename:match(ptn) then
matched = true
break
end
end
if not matched then return end
-- do automatic reflow on line if we're typing at the end of the line and have
-- reached the line limit
local line, col = self.doc:get_selection()
local text = self.doc:get_text(line, 1, line, math.huge)
if #text >= config.line_limit and col > #text then
command.perform("doc:select-lines")
command.perform("reflow:reflow")
command.perform("doc:move-to-next-char")
command.perform("doc:move-to-previous-char")
end
end

View File

@ -0,0 +1,73 @@
-- mod-version:1 -- lite-xl 1.16
local core = require "core"
local style = require "core.style"
local command = require "core.command"
local common = require "core.common"
local config = require "core.config"
local View = require "core.view"
config.bigclock_time_format = "%H:%M:%S"
config.bigclock_date_format = "%A, %d %B %Y"
config.bigclock_scale = 1
local ClockView = View:extend()
function ClockView:new()
ClockView.super.new(self)
self.time_text = ""
self.date_text = ""
end
function ClockView:get_name()
return "Big Clock"
end
function ClockView:update_fonts()
local size = math.floor(self.size.x * 0.15 / 15) * 15 * config.bigclock_scale
if self.font_size ~= size then
self.time_font = renderer.font.load(DATADIR .. "/fonts/font.ttf", size)
self.date_font = renderer.font.load(DATADIR .. "/fonts/font.ttf", size * 0.3)
self.font_size = size
collectgarbage()
end
return self.font
end
function ClockView:update()
local time_text = os.date(config.bigclock_time_format)
local date_text = os.date(config.bigclock_date_format)
if self.time_text ~= time_text or self.date_text ~= date_text then
core.redraw = true
self.time_text = time_text
self.date_text = date_text
end
ClockView.super.update(self)
end
function ClockView:draw()
self:update_fonts()
self:draw_background(style.background)
local x, y = self.position.x, self.position.y
local w, h = self.size.x, self.size.y
local _, y = common.draw_text(self.time_font, style.text, self.time_text, "center", x, y, w, h)
local th = self.date_font:get_height()
common.draw_text(self.date_font, style.dim, self.date_text, "center", x, y, w, th)
end
command.add(nil, {
["big-clock:open"] = function()
local node = core.root_view:get_active_node()
node:add_view(ClockView())
end,
})
return ClockView

View File

@ -0,0 +1,118 @@
-- mod-version:1 -- lite-xl 1.16
local core = require "core"
local style = require "core.style"
local command = require "core.command"
local keymap = require "core.keymap"
local DocView = require "core.docview"
local bracket_maps = {
-- [ ] ( ) { }
{ [91] = 93, [40] = 41, [123] = 125, step = 1 },
-- ] [ ) ( } {
{ [93] = 91, [41] = 40, [125] = 123, step = -1 },
}
local function get_matching_bracket(doc, line, col, line_limit, open_byte, close_byte, step)
local end_line = line + line_limit * step
local depth = 0
while line ~= end_line do
local byte = doc.lines[line]:byte(col)
if byte == open_byte then
depth = depth + 1
elseif byte == close_byte then
depth = depth - 1
if depth == 0 then return line, col end
end
local prev_line, prev_col = line, col
line, col = doc:position_offset(line, col, step)
if line == prev_line and col == prev_col then
break
end
end
end
local state = {}
local function update_state(line_limit)
line_limit = line_limit or math.huge
-- reset if we don't have a document (eg. DocView isn't focused)
local doc = core.active_view.doc
if not doc then
state = {}
return
end
-- early exit if nothing has changed since the last call
local line, col = doc:get_selection()
local change_id = doc:get_change_id()
if state.doc == doc and state.line == line and state.col == col
and state.change_id == change_id and state.limit == line_limit then
return
end
-- find matching bracket if we're on a bracket
local line2, col2
for _, map in ipairs(bracket_maps) do
for i = 0, -1, -1 do
local line, col = doc:position_offset(line, col, i)
local open = doc.lines[line]:byte(col)
local close = map[open]
if close then
line2, col2 = get_matching_bracket(doc, line, col, line_limit, open, close, map.step)
goto found
end
end
end
::found::
-- update
state = {
change_id = change_id,
doc = doc,
line = line,
col = col,
line2 = line2,
col2 = col2,
limit = line_limit,
}
end
local update = DocView.update
function DocView:update(...)
update(self, ...)
update_state(100)
end
local draw_line_text = DocView.draw_line_text
function DocView:draw_line_text(idx, x, y)
draw_line_text(self, idx, x, y)
if self.doc == state.doc and idx == state.line2 then
local color = style.bracketmatch_color or style.syntax["function"]
local x1 = x + self:get_col_x_offset(idx, state.col2)
local x2 = x + self:get_col_x_offset(idx, state.col2 + 1)
local h = math.ceil(1 * SCALE)
renderer.draw_rect(x1, y + self:get_line_height() - h, x2 - x1, h, color)
end
end
command.add("core.docview", {
["bracket-match:move-to-matching"] = function()
update_state()
if state.line2 then
core.active_view.doc:set_selection(state.line2, state.col2)
end
end,
})
keymap.add { ["ctrl+m"] = "bracket-match:move-to-matching" }

View File

@ -0,0 +1,54 @@
-- mod-version:1 -- lite-xl 1.16
local common = require "core.common"
local DocView = require "core.docview"
local white = { common.color "#ffffff" }
local black = { common.color "#000000" }
local tmp = {}
local function draw_color_previews(self, idx, x, y, ptn, base, nibbles)
local text = self.doc.lines[idx]
local s, e = 0, 0
while true do
s, e = text:find(ptn, e + 1)
if not s then break end
local str = text:sub(s, e)
local r, g, b = str:match(ptn)
r, g, b = tonumber(r, base), tonumber(g, base), tonumber(b, base)
-- #123 becomes #112233
if nibbles then
r = r * 16
g = g * 16
b = b * 16
end
local x1 = x + self:get_col_x_offset(idx, s)
local x2 = x + self:get_col_x_offset(idx, e + 1)
local oy = self:get_line_text_y_offset()
local text_color = math.max(r, g, b) < 128 and white or black
tmp[1], tmp[2], tmp[3] = r, g, b
local l1, _, l2, _ = self.doc:get_selection(true)
if not (self.doc:has_selection() and idx >= l1 and idx <= l2) then
renderer.draw_rect(x1, y, x2 - x1, self:get_line_height(), tmp)
renderer.draw_text(self:get_font(), str, x1, y + oy, text_color)
end
end
end
local draw_line_text = DocView.draw_line_text
function DocView:draw_line_text(idx, x, y)
draw_line_text(self, idx, x, y)
draw_color_previews(self, idx, x, y, "#(%x%x)(%x%x)(%x%x)%f[%W]", 16)
draw_color_previews(self, idx, x, y, "#(%x)(%x)(%x)%f[%W]", 16, true) -- support #fff css format
draw_color_previews(self, idx, x, y, "rgba?%((%d+)%D+(%d+)%D+(%d+).-%)", 10)
end

View File

@ -0,0 +1,29 @@
-- mod-version:1 -- lite-xl 1.16
local core = require "core"
local command = require "core.command"
local Doc = require "core.doc"
local function eof_newline(doc)
local leof, neof = #doc.lines, #doc.lines
for i = leof, 1, -1 do
if not string.match(doc.lines[i], "^%s*$") then break end
neof = i
end
if neof ~= leof then
doc:remove(neof, 1, leof, math.huge)
return
end
if "\n" ~= doc.lines[leof] then doc:insert(leof, math.huge, "\n") end
end
command.add("core.docview", {
["eof-newline:eof-newline"] = function()
eof_newline(core.active_view.doc)
end,
})
local save = Doc.save
function Doc:save(...)
eof_newline(self)
save(self, ...)
end

Some files were not shown because too many files have changed in this diff Show More