All Projects β†’ klange β†’ Bim

klange / Bim

Licence: isc
small terminal text editor with syntax highlighting

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Bim

Brackeys Ide
πŸ‘¨β€πŸ’» Brackeys IDE is a fast and free multi-language code editor for Android.
Stars: ✭ 154 (-11.49%)
Mutual labels:  text-editor, code-editor, syntax-highlighting
Moe
A command line based editor inspired by vi/vim. Written in Nim.
Stars: ✭ 252 (+44.83%)
Mutual labels:  terminal-based, editor, text-editor
Sapling
A highly experimental vi-inspired editor where you edit code, not text.
Stars: ✭ 195 (+12.07%)
Mutual labels:  editor, text-editor, code-editor
Squircle-IDE
πŸ‘¨β€πŸ’» Squircle CE is a fast and free multi-language code editor for Android
Stars: ✭ 642 (+268.97%)
Mutual labels:  syntax-highlighting, code-editor, text-editor
ash
A modern terminal text editor
Stars: ✭ 37 (-78.74%)
Mutual labels:  code-editor, text-editor, terminal-based
Zep
Zep - An embeddable editor, with optional support for using vim keystrokes.
Stars: ✭ 477 (+174.14%)
Mutual labels:  editor, text-editor, syntax-highlighting
Avaloniaedit
Avalonia-based text editor (port of AvalonEdit)
Stars: ✭ 201 (+15.52%)
Mutual labels:  editor, text-editor, code-editor
editor
A text editor written in Nim
Stars: ✭ 24 (-86.21%)
Mutual labels:  syntax-highlighting, text-editor, terminal-based
ax-editor
Ax is a code editor with syntax highlighting that runs in your terminal written completely in Swift.
Stars: ✭ 42 (-75.86%)
Mutual labels:  syntax-highlighting, code-editor, text-editor
That editor
*That* editor.
Stars: ✭ 262 (+50.57%)
Mutual labels:  editor, text-editor, syntax-highlighting
O
πŸŒ€ Text editor suitable for writing git commit messages and editing Markdown files. Can build executables and jump to errors at the press of `ctrl-space`, for several programming languages. Can format code with `ctrl-w`. Provides general syntax highlighting, rainbow parenthesis and cut/paste portals. o is intentionally limited to VT100.
Stars: ✭ 54 (-68.97%)
Mutual labels:  editor, text-editor, syntax-highlighting
Subethaedit
General purpose plain text editor for macOS. Widely known for its live collaboration feature.
Stars: ✭ 1,183 (+579.89%)
Mutual labels:  text-editor, syntax-highlighting
Codeeditor
A cool code editor library on Android with syntax-highlighting and auto-completion.
Stars: ✭ 84 (-51.72%)
Mutual labels:  code-editor, syntax-highlighting
Mazu Editor
a minimalist text editor with syntax highlight, copy/paste, and search
Stars: ✭ 88 (-49.43%)
Mutual labels:  terminal-based, text-editor
Wed
wed is a terminal text editor with key bindings commonly used in Windows based editors
Stars: ✭ 65 (-62.64%)
Mutual labels:  terminal-based, text-editor
Atsynedit
Multi-line editor control, with syntax highlighting, for Lazarus
Stars: ✭ 92 (-47.13%)
Mutual labels:  text-editor, syntax-highlighting
Dte
A small, configurable console text editor (moved to https://gitlab.com/craigbarnes/dte)
Stars: ✭ 98 (-43.68%)
Mutual labels:  editor, text-editor
Mg
Micro (GNU) Emacs-like text editor ❀️ public-domain
Stars: ✭ 117 (-32.76%)
Mutual labels:  editor, text-editor
Notepadqq
A simple, general-purpose editor for Linux
Stars: ✭ 1,738 (+898.85%)
Mutual labels:  editor, text-editor
Yawysiwygee
Yet another what-you-see-is-what-you-get equation editor
Stars: ✭ 60 (-65.52%)
Mutual labels:  text-editor, code-editor

Bim - A Text Editor

screenshot

Bim is a terminal text editor with syntax highlighting.

Inspired by Vim (one might say a Bad Imitation) and featuring similar mode-based editing, Bim was originally written for ToaruOS, but it has also been tested in Linux, Sortix, FreeBSD, and macOS.

Goals / Purpose

Bim is intended as the included text editor in ToaruOS, a hobby operating system built from scratch.

Bim aims to be lightweight and featureful with no external dependencies, providing a modern editing experience in a lightweight, extensible package.

NOTE: This branch currently represents a preview of an in-progress rewrite of Bim currently dubbed "Bim 3", which is being rebuilt from the ground up around Kuroko to provide a fully integrated environment for writing plugins and extensions.

Features

  • Vim-like modal interactions.
  • Arrow-key and traditional vi hjkl navigation.
  • Syntax highlighting (currently for C/C++, Python, Makefiles, Java, Rust, and a few others).
  • Integrated scripting environment with Kuroko.
  • Themes, including 256-color and 24-bit color support.
  • Indentation adjustment and naΓ―ve automatic indentation.
  • Multiple editor tabs.
  • Basic Unicode support (sufficient for things like Japanese, but not capable of more complex scripts).
  • Efficient screen redrawing.
  • Terminal support tested in ToaruOS, Sortix, xterm, urxvt, Gnome, XFCE, Linux and FreeBSD consoles, macOS Terminal.app, iTerm2.
  • Mouse support in Xterm-like terminals.
  • Line and character selection, with yanking (paste buffer).
  • Incremental forward and backward search with match highlighting and smart case sensitivity.
  • Undo/redo stack.
  • Highlight matching parens/braces.
  • Multi-line insert mode.
  • Persistent cursor location between sessions.
  • Git integration, shows git diff status in-line, along with unsaved changes.
  • Convert syntax highlighted code to an HTML document.
  • Split viewports to view multiple files or different parts of the same file.
  • Simple autocompletions using ctags.

Build Requirements

Bim requires a sufficiently Unix-like C library and a C99 compiler with certain GNU extensions (such as __attribute__((constructor))).

Additionally, in this and future versions, a system installation of Kuroko is needed.

Bim has been built successfully for a number of targets, including various BSDs, ToaruOS, Sortix, and others.

Terminal Support

Bim has been tested in a number of terminals, and while it does not use terminfo databases, basic functionality should be available in the vast majority of remnant emulators and even classic DEC hardware.

If the terminal you are using has some quirks or does not play well with the default assumptions, you can modify the behavior to suit your environment.

Capability features can be controlled with "quirks", either through the quirk command in a bimrc, or with the -O command line option.

The format of the quirk command is quirk(envvar,teststr,'no...','can...',...) where ENVVAR is the name of an environment variable and teststr is a string to check against which must be a prefix of the environment variable.

For example, quirk('TERM','xterm','nounicode') will disable Unicode output on all terminals starting with "xterm" (including "xterm-256color").

You may also specifies quirks with the $COLORTERM environment variable, or the $TERMINAL_EMULATOR variable set by certain IDEs.

Some example quirk configurations are provided in docs/example.bim3rc and may be a good place to start if you are experiencing rendering issues.

Unicode/UTF-8 support is recommended and assumed by default. The nounicode quirk option will disable output of UTF-8 characters and render them as codepoint hints like <U+1234> instead.

256-color and 24-bit color are also assumed by default, disable them with the no256color and no24bit quirks respectively.

If you have a particularly low-color terminal, the nobright quirk will hint to themes that only the lower 8 colors should be used.

Three scroll modes are supported: shift scrolling, insert/delete scrolling, and redraw scrolling.

Shift scrolling (^[[1S/^[[1T) is assumed by default. If your terminal supports insert/delete scrolling (^[[L/^[[M), enable the caninsert quirk.

If neither scrolling option is available, use the noscroll quirk to redraw the text field when scrolling. This will probably be slow!

Mouse support with ^[[?1000h is assumed by default. Use the nomouse quirk to disable it.

If your terminal supports SGR mouse modes ("1006"), enable the cansgrmouse quirk. Most xterm-like terminals support this and it will provide support for click on cells in larger terminal windows.

Alternate screen support is also assumed. This is normally fine even if your terminal doesn't support it, but if it causes issues the noaltscreen quirk will disable it.

Key Bindings

Default keybindings can be found in docs/mappings.md.

This listing can be generated with bim --dump-mappings.

Commands

A complete listing of available commands can be found in docs/commands.md.

This listing can be generated with bim --dump-commands.

Additional Bim Functionality

You can use Bim to display files in your terminal with syntax highlighting with bim -c (no line numbers) and bim -C (with line numbers).

screenshot

You can pipe text to bim for editing with bim -. Note that Bim will wait for end-of-file before launching, so this is not suitable for use as a pager (pager support is planned).

Bim can also be used to generate HTML documents with syntax-highlighted source code with bim --html; the configured theme will be used.

Themes

Bim includes a handful of color schemes for the interface and syntax highlighting.

ANSI

A plain 16-color theme. Can be configured for use on terminals with or without bright color support. Looks a bit like Irssi.

ansi

Sunsmoke

An original 24-bit color theme with rustic browns and subdued pastel colors.

sunsmoke

Sunsmoke-256

A 256-color version of Sunsmoke for use in terminals that do not support 24-bit color.

sunsmoke256

Wombat

A 256-color theme based on the theme of the same name for Vim.

wombat

Solarized Dark

A 24-bit color theme based on the popular color palette.

solarized-dark

City Lights

A 24-bit color theme based on the one for Atom and Sublime, featuring low contrast blues.

citylights

Light

Based on selenized by Jan WarchoΕ‚

light

Config File

Bim will automatically run commands from ~/.bim3rc on startup.

A detailed bimrc example is available at docs/example.bim3rc.

Bim scripts are written in Kuroko.

Syntax Support

Not all syntax highlighters are complete or support all features of their respective languages.

  • C/C++
  • Python
  • Java
  • diffs
  • Generic INI-style config files
  • Rust
  • git commits and interactive rebase
  • Make / GNU Make
  • Markdown (with some inline code highlighting support)
  • JSON
  • XML / HTML
  • Protobuf
  • Bash

Code Structure

Bim's core functionality lives in bim.c.

Syntax highlighters and themes are written in Kuroko and found in the syntax and themes directories.

Bim is not Vim

Some interactions in Bim work differently from Vim, and sometimes this is intentional. Bim's primary interactions are built around a selection, while Vim has verbs and navigation nouns. CHAR SELECTION does not let the cursor move past the end of the line, unlike VISUAL mode in Vim.

Bim wants to be more like Vim

Some interactions in Bim work differently from Vim, and sometimes this is unintentional. Bim is missing many features I would like to implement, like regular expression search (and replacement).

License

Bim is released under the terms of the ISC license, which is a simple BSD-style license. See LICENSE for details.

Development

Bim is still primarily developed alongside ToaruOS. This repository is a mirror with fake history going back to the start of that project. Pull requests merged here will be patched into ToaruOS.

Community

If you're using Bim, want to contribute to development, or have ideas for new features, join us in #bim on Freenode.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].