2026-01-28 18:46:44 +00:00
2026-01-28 18:46:44 +00:00
2026-01-21 15:05:37 +00:00
2026-01-28 18:46:44 +00:00
2026-01-28 18:46:44 +00:00
2026-01-21 15:05:37 +00:00
2026-01-28 18:46:44 +00:00
2026-01-21 15:05:37 +00:00
2025-09-20 15:13:01 +01:00
2026-01-28 18:46:44 +00:00
2026-01-28 18:46:44 +00:00
2026-01-28 18:46:44 +00:00

Copyright 2025 Syed Daanish

Crib - a text editor

About

Crib is a TUI based text editor built primaririly for personal use.
Crib has a vim-style editor modes system but navigation and shortcuts are very different.
It supports superfast incremental syntax highlighting.
And LSP for auto-completion, diagnostics, hover docs etc.
It aims to be complete general purpose IDE.
(It is still very much a work in progress so a lot of things may seem incomplete)
For now it is just a single file editor. I plan to add a multi-file support with file pickers and tabs soon.

Building

Get started

Make sure the repo is cloned with submodules to get libgrapheme.

git clone --recurse-submodules https://git.syedm.dev/SyedM/crib.git

Dependencies

System-wide libraries

Make sure you have the following dependencies installed (apart from the standard C++ libraries):

  • nlohmann/json Install it via your package manager. Once installed, the header should be available as:

    #include <nlohmann/json.hpp>
    
  • PCRE2 Install the library to use its headers:

    #include <pcre2.h>
    
  • libmagic Install it so that you can include it in your code (most *nix systems have it installed):

    #include <magic.h>
    

It also uses xclip at runtime for copying/pasting (TODO: make it os portable). And any modern terminal should work fine - preferably kitty or wezterm.

./libs folder

Some other dependancies are added as submodules or copied.

  • unicode_width is compiled by the makefile so nothing to do there.
  • libgrapheme needs to be compiled using make in it's folder.
  • ``

LSPs

Lsp's are defined in the libcrib.rb file and you can use your config/main.rb file to add more.

The following lsp's are added by default and can be installed anywhere in your $PATH

As it is still in development, some of these may not work as expected or that well.
It should work even if the lsp is not installed but lsp features will not work.

Compiler

clang++ should work fine but c++23+ is required.
Can remove ccache if you want from the makefile.

Compliling

make release

Running

Preferably add the bin folder to PATH or move bin/crib to somewhere in PATH.
For some LSP's to work properly crib needs to be run from the root folder of the project. To be fixed
then do -

crib ./filename.ext

If filename.ext does not exist, it will be created

Keybindings

TODO: add keybind information on how to set in config/main.rb and default / unchangeable keybinds

Features Implemented

Core workflow:

  • NORMAL / INSERT / SELECT / RUNNER / JUMPER modes
  • full mouse support for scrolling and multi-click word/line selection.
    • Double click to select word
    • Triple click to select line

Core editing tools:

  • indent/dedent
  • move lines up/down
  • folding on a selected range
  • yank/cut/paste via system clipboard
  • per-language smart auto-indent on new line insert
  • bracket/quote auto-pairing
  • hooks jumping (bookmarking)
  • color hex code highlighting
  • current line highlighting
  • all instances of current word under cursor highlighting

syntax highlighting and filetype detection (using extention or libmagic) for:

  • ruby

LSP-powered features:

  • diagnostics
  • autocompletion
  • hover docs
  • formatting support
    • Full file formatting on save
    • Ontype formatting when inserting special characters defined by the language server
    • (few lsp's actually support this - try to configure a few more which can but need configuration and for others need to add support for external formatters)
  • A list of some lsp's can be found here.
  • Any lsp can be added to the config/main.rb file.
  • Though not all might work well. Open an issue if you find a lsp that doesn't work well.

A lot lot more to come

Description
A TUI IDE.
Readme 6.9 MiB
Languages
C++ 94.7%
Ruby 3.9%
Makefile 0.8%
Shell 0.4%
C 0.2%