Zee: A modern text editor for the terminal written in Rust
github.com
github.com
This looks to be a hobby project, and it looks very professional and presentable, so good work! I like it!
But if you wanted to entice me to download and try it, I'd argue you have to give me something new. I would prefer more reasoning about why things are the way they are (keybinds are done because X). I'd prefer something that can be hacked upon (vim, Emacs, kak, etc all have scripts). I'd prefer something different (the entire window has physic simulation and typing too fast causes a massive loading force on the indents). Etc.
But this is your project, do what you want! well done!
Another editor worth mentioning here is Micro (https://micro-editor.github.io/), written in Go, which is also a TUI editor, is hackable not only because open source but also in the sense you mentioned (with plugins written in Lua), and (exceptionally for a TUI editor) it has the "usual" default keybindings that all of us non-Vim and non-Emacs diehards are accustomed to (Ctrl+S for save, Ctrl+F for find etc. etc.).
This is something I've wanted back when I was doing professional PHP development, when life was still in black and white. I still reckon it would be useful today.
I started to build exactly that myself, in Nim, but got distracted building the editor itself and eventually moved on to other personal projects. Maybe I should revisit it.
An example, based on the current HN home page, would be htmx integration in HTML editing, that is aware of the rest of your project and how htmx works to give excellent, powerful autocomplete within your bindings. Maybe even have it be able to be aware of the backends route set!
But... Don't they already do that? I am a daily vim user and there is a million plugins that were created using those "hooks" you talk about. I guess that's the case with emacs too.
Just two days ago I jumped into a huge bazel project and needed a good way to navigate through 100s of files that are connected through @funny//labels/across/directories/and.files. By only reading vim's :help, I was able to write that 10lines of code which hooks into the existing "go-to-file" or "find-where-this-is-defined" functionality.
(In fact, after "implementing" this feature, I was wondering how I'd do this as a user (not as a plug in author) in any other editors.)
It was borne specifically out of my difficulty extending Vim to do what I was after when working with PHP frameworks!
Basically, I'd like the editor to understand the AST of the language(s, including mixed-language files, which is really hard) and be able to hook into parts of that AST to say "while this is a string, it's really this weird DSL that hooks into Javascript, so look for symbols here, here and here".
Its definitely possible to make Vim, Emacs and TA work this way, but its a lot more work than I had in mind, when I tried to extend them (well, not Emacs. It might be best at this, I'm just not a good emacs user) to achieve what I was after at the time, which was understanding the dependency injection annotation patterns from Symfony in PHP.
I think one could get pretty close with LSPs and the powerful AST parsers we have nowadays. Though doing it fast might be difficult!
I use the lite-xl fork https://lite-xl.com/
Neovim?
Sounds like emacs in text mode
(Though I doubt the statement re: Zee < 10ms latency in practical terms. I think only xterm and Terminal.app are consistently below that in terms of pure terminal latency)
[1]: https://zed.dev/
I hope they figure out the plugin system, but honestly, if they'd just add something like Telescope(an absolutely amazing neovim plugin), I'd be more than happy enough.
The major thing I would want differently, breaking tradition from emacs is not waste the bottom two lines for modeline and a usually-empty prompt line and instead only show it on demand. Emacs can sort of do this, but in my experience, it doesn't work very well.
ADD: I know some HNers feel there's too much Rust here, but let me just add how I love that I can do `cargo install zee` on macOS, FreeBSD, and Linux (AMD64, Arm64, RISC-V) and it just works. Cargo is my favorite package manager (where available).
(Personally running Emacs 29 built from source on an M1 Pro; everything is instant! Even on my old dumpy i5 machine, everything except startup was pretty snappy, with the exception of startup which took ~4 seconds.)
If it's startup you're concerned about, try the esup[1] package to figure out what's taking so long.
(setq lsp-print-io t)
while debugging a configuration problem. That setting was basically filling up a buffer with _enormous_ amounts of text. I guess that appending frequently to that massive buffer slowed things to a halt.After disabling this, LSP inside emacs has been flawless.
> The following keybindings are available:
Sigh. Could software please stop being so opinionated when it comes to keybindings? Let me configure my own keybindings please. Emacs bindings are terrible for people suffering from RSI and the like.
And there's probably some way you can configure the key bindings to your liking.
AFAICT there is no such way, hence my original comment.
> Should all software come with no assigned key bindings?
Personally, I find it very annoying having to re-bind all the keys to my liking / to what I'm used to whenever I start using a new piece of software. But to answer your question: Probably not. Most people seem to be happy to go with whatever are the default keybindings, so I guess it works for them.
That would make it unsuitable for text editor usage.
On a more serious note: the only complex piece of code to write is the merge and split operations, but since the structure of the tree is given it isn't theoretically hard. It is just a pain in the ass.
There are two high quality implementations. One for c++ (immer) and the one in scala.
Bagwell did a talk about it on YouTube as well.
Stuff like use of tree-sitter seems neat.
Perhaps "modern" in the terminal editor space is just a codebase that does not have 30 years of cruft (where cruft may include various legacy support and fixes for subtle/obscure/legacy bugs).
I don’t love the emacs bindings but I’m open minded.
Again kudos to the author.
Compiling zee-grammar v0.2.0 (/tmp/zee/grammar)
Compiling crossclip v0.7.0
Compiling phf_codegen v0.8.0
Compiling futures v0.3.17
Compiling palette v0.5.0
Compiling zi-term v0.2.0
The following warnings were emitted during compilation:warning: cc: error: languages/tree-sitter-css/src/parser.c: No such file or dire ctory warning: cc: fatal error: no input files warning: compilation terminated. warning: cc: error: languages/tree-sitter-css/src/scanner.c: No such file or directory warning: cc: fatal error: no input files warning: compilation terminated.
error: failed to run custom build command for `zee-grammar v0.2.0 (/tmp/zee/grammar)`
Caused by: process didn't exit successfully: `/tmp/zee/target/release/build/zee-grammar-38a42fe479d4b0dd/build-script-build` (exit status: 1) --- stdout cargo:rustc-link-lib=static=tree-sitter-css TARGET = Some("x86_64-unknown-linux-gnu") OPT_LEVEL = Some("3") HOST = Some("x86_64-unknown-linux-gnu") CC_x86_64-unknown-linux-gnu = None CC_x86_64_unknown_linux_gnu = None HOST_CC = None CC = None CFLAGS_x86_64-unknown-linux-gnu = None CFLAGS_x86_64_unknown_linux_gnu = None HOST_CFLAGS = None CFLAGS = None CRATE_CC_NO_DEFAULTS = None DEBUG = Some("false") CARGO_CFG_TARGET_FEATURE = Some("fxsr,lzcnt,pclmulqdq,popcnt,rdrand,sse,sse2,sse3,sse4.1,sse4.2,ssse3") running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "languages/tree-sitter-css/src" "-Wall" "-Wextra" "-w" "-o" "/tmp/zee/target/release/build/zee-grammar-76ca683c42d5d7dd/out/languages/tree-sitter-css/src/parser.o" "-c" "languages/tree-sitter-css/src/parser.c" cargo:warning=cc: error: languages/tree-sitter-css/src/parser.c: No such file or directory cargo:warning=cc: fatal error: no input files cargo:warning=compilation terminated. exit status: 1 running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "languages/tree-sitter-css/src" "-Wall" "-Wextra" "-w" "-o" "/tmp/zee/target/release/build/zee-grammar-76ca683c42d5d7dd/out/languages/tree-sitter-css/src/scanner.o" "-c" "languages/tree-sitter-css/src/scanner.c"
Not interested enough... :/ Took long enough to compile with its ~260 dependencies. Each Rust project I want to cargo build, I end up fetching & compiling >200 dependencies (the same ones, not sure if different versions though), and then by the end of it all it fails.
I am going to rm -rf it, I need the space anyways.
For example, the Unix line of washing solutions (http://www.washing-solution.de/en/washing-machines/unix/ ) and the Unix line of curtains (https://www.kvadrat.dk/en/kinnasand/products/curtains/6704-u...! ) and the Unix line of liquid chromatography products (https://www.sepax-tech.com/Unix.php ) do not infringe on the Unix trademark related operating systems.
According to TESS, the US trademark search system, Unix in the category "IC 009. US 021 023 026 036 038. G & S: COMPUTER PROGRAMS, * NAMELY, TEST SUITES USED TO DETERMINE COMPLIANCE WITH CERTAIN SPECIFICATIONS AND STANDARDS *. FIRST USE: 19721214. FIRST USE IN COMMERCE: 19721214"
There is no trademark conflict to use that term for a far different product or service area.
FWIW, TESS says the following are three of the many existing trademarks for "Zee" in the US:
"IC 009. US 021 023 026 036 038. G & S: Camera hardware systems for IP (Internet protocol) video surveillance; IP (Internet protocol) cameras. FIRST USE: 20130809. FIRST USE IN COMMERCE: 20130809"
"IC 041. US 100 101 107. G & S: Educational services, professional educational orientation services, organization of expositions with educational or cultural purposes"
"IC 009. US 021 023 026 036 038. G & S: Portable chargers, namely, batteries with multiple ports for charging electronics; Portable power station, namely, batteries with multiple ports for charging electronic devices; Portable battery power station, namely, rechargeable batteries with multiple ports for charging electronics; Battery charge devices; Batteries, electric"
You'll notice they are in different areas of trade, hence no trademark conflict.
Maybe check out trademark law again. :)