Flow Control: a programmer's text editor https://flow-control.dev
Find a file
CJ van den Berg 5ca9e18ee2 fix(vaxis): use an independant thread for InputReader and leave it running
There is no need to unblock the input reader thread. It can be cleaned
up by the OS and signaling it wrecks our exit code.
2024-05-22 21:21:44 +02:00
src fix(vaxis): use an independant thread for InputReader and leave it running 2024-05-22 21:21:44 +02:00
test Initial public release 2024-02-29 00:00:15 +01:00
.gitignore Initial public release 2024-02-29 00:00:15 +01:00
build.zig feat: add to_upper and to_lower commands on Alt-u and Alt-l 2024-05-12 00:10:11 +02:00
build.zig.version build: update to zig 0.12.0 2024-04-20 23:26:33 +02:00
build.zig.zon feat: implement remaining terminal handling functions via libvaxis 2024-05-22 10:40:08 +02:00
help.md feat: render language server diagnostics and add next/previous diagnostic commands 2024-04-20 00:04:46 +02:00
LICENSE Initial commit 2024-02-25 21:11:11 +01:00
README.md docs: add -Doptimize=ReleaseFast to macos build instructions 2024-04-25 18:49:34 +02:00
zig fix: move mkdir .cache/cdb step from zig wrapper to build.zig 2024-03-01 11:50:25 +01:00

Flow Control: a programmer's text editor

This is my Zig text editor. It is very much a work-in-progress, but far enough along that I am daily driving it.

https://github.com/neurocyte/flow/assets/1552770/97aae817-c209-4c08-bc65-0a0bf1f2d4c6

Requirements

  • A modern terminal with 24bit color and kitty keyboard protocol support (kitty and ghostty are the only recommended terminals at this time)
  • NerdFonts support
  • Linux or MacOS (help porting to *BSD or Windows is welcome!)
  • A UTF-8 locale (very important!)

Building

Make sure your system meets the requirements listed above.

Flow tracks zig master most of the time. Build with:

zig build -Doptimize=ReleaseFast

Or, for a slightly smaller executable (with no debug info):

zig build -Doptimize=ReleaseSmall

Sometimes zig master may introduce breaking changes and Flow may take a few days to catch up. In that case there is a simple zig wrapper script provided that will download and build with the last known compatible version of zig. The version is stored in build.zig.version.

Build with the zig wrapper:

./zig build -Doptimize=ReleaseFast

The zig wrapper places the downloaded zig compiler in the .cache directory and does not touch your system. It requires bash, curl and jq to run.

Run with:

zig-out/bin/flow

MacOS

On MacOS you will need to link Flow against a MacOS build of notcurses 3.0.9. This is easiest with brew:

brew install notcurses
zig build -Doptimize=ReleaseFast -Duse_system_notcurses=true --search-prefix $HOMEBREW_PREFIX

If HOMEBREW_PREFIX is not set in your environment check your brew configuration with brew config.

Running Flow Control

The output binary is:

zig-out/bin/flow

Place it in your path for convenient access:

sudo cp zig-out/bin/flow /usr/local/bin

Flow Control is a single statically linked binary. No further runtime is required. You may install it on another system by simply copying the binary.

scp zig-out/bin/flow root@otherhost:/usr/local/bin

Logs, traces and per-project most recently used file lists are stored in the standard user runtime cache directory. Usually ~/.cache/flow.

Configuration is mostly dynamically maintained with various commands in the UI. It stored under the standard user configuration path. Usually ~/.config/flow.

Files to load may be specifed on the command line:

flow fileA.zig fileB.zig

Common target line specifiers are supported to:

flow file.txt:123

Or Vim style:

flow file.txt +123

Use the --language option to force the file type of a file:

flow --language bash ~/.bash_profile

See flow --help for the full list of command line options.

Terminal configuration

Kitty, Ghostty and most other terminals have default keybindings that conflict with common editor commands. I highly recommend rebinding them to keys that are not generally used anywhere else.

For Kitty rebinding kitty_mod is usually enough:

kitty_mod ctrl+alt

For Ghostty each conflicting binding has to be reconfigured individually.

Features

  • fast TUI interface. no user interaction should take longer than one frame (6ms) (even debug builds)
  • tree sitter based syntax highlighting
  • linting (diagnostics) and code navigation (goto definition) via language server
  • multi cursor editing support
  • first class mouse support (yes, even with a scrollbar that actually works properly!)
  • vscode compatible keybindings (thanks to kitty keyboard protocol)
  • vim compatible keybindings (at least the basics, more to come)
  • good unicode support
  • hybrid rope/piece-table buffer for fast loading, saving and editing with hundreds of cursors
  • theme support (compatible with vscode themes via the flow-themes project)
  • infinite undo/redo (at least until you run out of ram)
  • stuff I've forgotten to mention...

Features in progress (aka, the road to 1.0)

  • completion UI/LSP support for completion
  • find in files
  • command palette
  • persistent undo/redo
  • file watcher for auto reload

Features planned for the future

  • multi tty support (shared editor sessions across multiple ttys)
  • multi host editing
  • multi user editing

Community

Discord

Join our Discord server or use the discussions section here on GitHub to meet with other Flow users!