minor changes

added makefile install and uninstall rules
changed license to inclue myself
modified some keybindings
added desktop file
added todo
master
Alessandro Mauri 3 years ago
parent 2957968afc
commit 52650661ec
  1. 1
      .gitignore
  2. 1
      LICENSE
  3. 30
      TODO
  4. 18
      data/core/keymap.lua
  5. 16
      lite.desktop
  6. 26
      makefile
  7. 3
      src/api/api.c
  8. 1
      src/main.c

1
.gitignore vendored

@ -1,3 +1,2 @@
**/*.o
lite
TODO

@ -1,4 +1,5 @@
Copyright (c) 2020 rxi
Copyright (c) 2021 Alessandro Mauri
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

30
TODO

@ -0,0 +1,30 @@
[x] use system lua lib
[ ] make it std=c11 not gnu11
[ ] make it compile on openbsd
[ ] update license, readme and documentation
[ ] add manpage
[x] add desktop file
[x] makefile: add install and uninstall
[ ] SDL: disable key not recognized messages
[ ] add menu to exec arbitrary command
[ ] that command can be what is selected
[ ] add a cross to close tab
[ ] prevent overscrolling on treeview
[ ] user config file and/or init.lua
[ ] save session and restore on reopening
[ ] some key bindings:
[ ] alt+right == End
[ ] alt+left == Home
[ ] alt+up == PageUp
[ ] alt+down == PageDown
[ ] ctrl+d == duplicate line
[ ] ctrl+x == cut line || selection
[ ] ctrl+c == copy line || selection
[ ] ctrl+shift+o == change & open project folder -> core:open-project-module
[ ] ctrl+q == quit
[x] change alt+<number> to ctrl+<number>
[ ] add multi cursor system
[ ] add binding to open up a cheatsheet of keybinding, with a
search feature
[ ] implement visual "ruler" at column 80
[ ] show hidden files config and binding

@ -104,15 +104,15 @@ keymap.add {
["ctrl+shift+tab"] = "root:switch-to-previous-tab",
["ctrl+pageup"] = "root:move-tab-left",
["ctrl+pagedown"] = "root:move-tab-right",
["alt+1"] = "root:switch-to-tab-1",
["alt+2"] = "root:switch-to-tab-2",
["alt+3"] = "root:switch-to-tab-3",
["alt+4"] = "root:switch-to-tab-4",
["alt+5"] = "root:switch-to-tab-5",
["alt+6"] = "root:switch-to-tab-6",
["alt+7"] = "root:switch-to-tab-7",
["alt+8"] = "root:switch-to-tab-8",
["alt+9"] = "root:switch-to-tab-9",
["ctrl+1"] = "root:switch-to-tab-1",
["ctrl+2"] = "root:switch-to-tab-2",
["ctrl+3"] = "root:switch-to-tab-3",
["ctrl+4"] = "root:switch-to-tab-4",
["ctrl+5"] = "root:switch-to-tab-5",
["ctrl+6"] = "root:switch-to-tab-6",
["ctrl+7"] = "root:switch-to-tab-7",
["ctrl+8"] = "root:switch-to-tab-8",
["ctrl+9"] = "root:switch-to-tab-9",
["ctrl+f"] = "find-replace:find",
["ctrl+r"] = "find-replace:replace",

@ -0,0 +1,16 @@
[Desktop Entry]
Name=Lite
GenericName=Text Editor
Comment=Lightweight Lua text editor
Icon=lite
Type=Application
Categories=Utility;TextEditor;Development;
Keywords=text;editor;syntax;
Exec=lite %F
StartupNotify=false
Terminal=false
MimeType=text/plain;text/x-chdr;text/x-csrc;text/x-c++hdr;text/x-c++src;text/x-java;text/x-dsrc;text/x-pascal;text/x-perl;text/x-python;application/x-php;application/x-httpd-php3;application/x-httpd-php4;application/x-httpd-php5;application/xml;text/html;text/css;text/x-sql;text/x-diff;

@ -1,9 +1,11 @@
.POSIX:
PREFIX = /usr/local
MANPREFIX = ${PREFIX}/share/man
CC ?= gcc
SRCDIR = ./src
CFLAGS = -Wall -Werror -pedantic -O3 -std=gnu11 -fno-strict-aliasing -I${SRCDIR}\
-DLUA_USE_POSIX
CFLAGS = -Wall -Werror -pedantic -O3 -std=gnu11 -fno-strict-aliasing \
-I${SRCDIR} -DLUA_USE_POSIX
# remove this
LDFLAGS = -lSDL2 -lm -llua5.2
FILES != find ${SRCDIR} -name '*.c'
@ -12,5 +14,25 @@ OBJS = $(FILES:.c=.o)
lite: ${OBJS}
${CC} ${LDFLAGS} $^ -o $@
install: lite
mkdir -p ${DESTDIR}${PREFIX}/share/lite
cp -f lite ${DESTDIR}${PREFIX}/share/lite/lite
chmod 755 ${DESTDIR}${PREFIX}/share/lite/lite
cp -rf data ${DESTDIR}${PREFIX}/share/lite/data
mkdir -p ${DESTDIR}${PREFIX}/bin
ln -sf ${DESTDIR}${PREFIX}/share/lite/lite ${DESTDIR}${PREFIX}/bin/lite
# mkdir -p ${DESTDIR}${MANPREFIX}/man1
# cp -f us.1 ${DESTDIR}${MANPREFIX}/man1/us.1
# chmod 644 ${DESTDIR}${MANPREFIX}/man1/us.1
cp -f lite.desktop ${DESTDIR}${PREFIX}/share/applications/lite.desktop
cp -f icon.ico ${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/apps/lite.ico
uninstall:
rm -f ${DESTDIR}${PREFIX}/bin/lite \
${DESTDIR}&{PREFIX}/share/applications/lite.desktop \
${DESTDIR}${PREFIX}/share/icons/hicolor/scalable/apps/lite.ico
# ${DESTDIR}${MANPREFIX}/man1/us.1
rm -rf ${DESTDIR}${PREFIX}/share/lite
clean:
rm -f lite ${OBJS}

@ -10,7 +10,6 @@ static const luaL_Reg libs[] = {
};
void api_load_libs(lua_State *L) {
for (int i = 0; libs[i].name; i++) {
for (int i = 0; libs[i].name; i++)
luaL_requiref(L, libs[i].name, libs[i].func, 1);
}
}

@ -94,7 +94,6 @@ int main(int argc, char **argv)
lua_pushstring(L, exename);
lua_setglobal(L, "EXEFILE");
(void) luaL_dostring(L,
"local core\n"
"xpcall(function()\n"

Loading…
Cancel
Save