Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gagbo/xile
A toy front-end to xi-editor written in Guile Scheme
https://github.com/gagbo/xile
front-end guile ncurses xi-editor
Last synced: about 2 months ago
JSON representation
A toy front-end to xi-editor written in Guile Scheme
- Host: GitHub
- URL: https://github.com/gagbo/xile
- Owner: gagbo
- License: mit
- Created: 2020-02-17T22:39:08.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-10-04T17:37:16.000Z (over 2 years ago)
- Last Synced: 2024-10-15T08:28:32.805Z (3 months ago)
- Topics: front-end, guile, ncurses, xi-editor
- Language: Scheme
- Homepage:
- Size: 486 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.org
- License: LICENSE
Awesome Lists containing this project
README
#+TITLE: [WIP] Xile : Xi + Guile
Let's find out if Guile goes with everything ; and make a front-end for Xi
Editor using GNU Guile and libraries.* Table of Contents :TOC_3:noexport:
- [[#quickstart][Quickstart]]
- [[#compile-xi-editor][Compile Xi editor]]
- [[#start][Start]]
- [[#sdl2][SDL2]]
- [[#curses][Curses]]
- [[#test-script][Test script]]
- [[#logs][Logs]]
- [[#stop][Stop]]
- [[#dependencies][Dependencies]]
- [[#roadmap][Roadmap]]
- [[#objectives][Objectives]]* Quickstart
** Compile Xi editor
Update the submodule and =cargo build --release= the bundled [[https://github.com/xi-editor/xi-editor][Xi editor]]** Start
By default it will load a user config located in this repo in =config/xile.scm=.
It's hardcoded for now but hopefully will be configurable later.*** Dependencies
All dependencies are managed with guix shell, you can setup direnv to work properly with
```bash
eval $(guix shell -Df guix.scm --search-paths)
path_add GUILE_LOAD_PATH src
```*** SDL2
#+BEGIN_SRC bash
./examples/sdl.scm
#+END_SRC*** Curses
#+BEGIN_SRC bash
./examples/curses.scm
#+END_SRC** Test script
For the time being we are just opening this README file to see how it's
displayed.You can :
- switch to insert state using =i=
- Insert letters at this point
- use =[ESC]= to switch back to normal stateThere is no visual indicator for the current state, and it's possible not all
letters are supported in insert state. The list can be found looking at how many
keys are bound to some sort of =self-insert-*= function in [[./xile/editor-states.scm][Editor States]] module
(in the =insert-state-keymap= variable probably).** Logs
All the logs are located in the [[./logs][logs]] folder after the run :
- xi-core.log :: hold the logs from Xi editor process
- xile-listen-{out,err}.log :: hold the logs from xile functions regarding
callbacks and Xi message parsing
- xile-{out,err}.log :: hold the logs from xile functions outside message
callbacks** Stop
Hit =q= _in normal state_ to stop Xile (it may error out, but you're still out,
right ?). In SDL you can also send a quit-event.* Roadmap
- [X] Display buffer ::
- [X] Scroll window ::
- [X] Move cursor ::
- [X] User config as scheme ::
- [X] Xile state (buffer local and session-global variables) ::
- [X] Implement the [[https://xi-editor.io/docs/frontend-protocol.html][complete protocol]] :: That is
1) front -> back serializing, and
2) back -> front parsing + callbacks
Currently only the ={find,replace}_status= notifications and the =show_hover=
response message are missing. For the notifications, we will see when we want to
support it. For the Show Hover message, this needs to be implemented at the
buffer level ; since the buffer will attach the correct id at runtime and
register the correct callback.
- [X] Keymaps :: holding keymaps to ease the event-loop code is also necessary
to have multiple editor states
- [ ] Editor states (normal and insert at least) ::
"Normal" state has been 'done' (it exists, and is the default). Now 1 more
state is needed :
1) Insert state where every letter is bound to some =self-insert= method in
the buffer
- [ ] Proper header/footer :: I want to decouple buffer from its curses window, and
have the curses-window module actually handle all of header, footer, and main
window together
- Decoupling is done, so now each "xile {sdl,curses} window" can implement
their own methods and callback handling to draw headers/footers as they want
- Management of header/footer is now missing in SDL application
- [ ] Scheme evaluator :: on =:= in a vim-like manner, I want to wrap evaluating
a user-input string. This probably means a new mode to handle this, using the
=eval-string= method of Guile or something.
*The Footer handling is a
prerequisite*, as the input should be checkable by the user.
- [ ] Edit file ::
Set the pristing flag correctly and be able to insert characters. *The insert
state is a prerequisite*, since, well, insert bindings are only going to live
there
- [ ] Syntax Highlighting :: (using xi-core bundled syntect)* Objectives
- Learn about using a lisp in a complex project
- Play with ncurses interfaces
- Play with SDL2 a little bit (Postponed until I can get a proper ncurses interface)
- See how difficult it is to build software with a json interface to a provider
(here we are using [[https://github.com/xi-editor/xi-editor][Xi Editor]] as the core text editor).