All Projects → Avarel → mini-me

Avarel / mini-me

Licence: MIT license
Inline multiline text-editor/prompt written in Rust.

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to mini-me

tty-screen
Terminal screen detection - cross platform, major ruby interpreters
Stars: ✭ 78 (+239.13%)
Mutual labels:  console
phantomic
Pipe stdin to Phantom.JS
Stars: ✭ 20 (-13.04%)
Mutual labels:  console
multitextor
Multiplatform command line text editor.
Stars: ✭ 27 (+17.39%)
Mutual labels:  console
strip-ansi-stream
Strip ANSI escape codes
Stars: ✭ 32 (+39.13%)
Mutual labels:  console
xontrib-output-search
Get identifiers, paths, URLs and words from the previous command output and use them for the next command in xonsh shell.
Stars: ✭ 26 (+13.04%)
Mutual labels:  console
tvoip
Terminal-based P2P VoIP application (TeamSpeak-/Skype-like voice chatting over LAN or Internet)
Stars: ✭ 34 (+47.83%)
Mutual labels:  console
pelt-testing
A library testing for python, this package allows us to test algorithms and generate test data.
Stars: ✭ 14 (-39.13%)
Mutual labels:  console
std
stdout, for humans.
Stars: ✭ 17 (-26.09%)
Mutual labels:  console
colored-console
🌈 Add some color to your console >_
Stars: ✭ 74 (+221.74%)
Mutual labels:  console
go-color
A lightweight, simple and cross-platform package to colorize text in terminals
Stars: ✭ 65 (+182.61%)
Mutual labels:  console
teletype.js
A hyper-text terminal for web browsers.
Stars: ✭ 18 (-21.74%)
Mutual labels:  console
console-web-ui
Examples to show case how to build web based UI (that can be invoked using curl) for console applications using Javascript(NodeJS)
Stars: ✭ 28 (+21.74%)
Mutual labels:  console
Lua-Obfuscator
Obfuscate your lua code because it's so easy to steal!
Stars: ✭ 69 (+200%)
Mutual labels:  console
t-rex-game-bot
A bot that plays the Google Chrome T-Rex game for you
Stars: ✭ 60 (+160.87%)
Mutual labels:  console
leeks.js
Simple ANSI styling for your terminal
Stars: ✭ 12 (-47.83%)
Mutual labels:  console
tty-editor
Opens a file or text in the user's preferred editor
Stars: ✭ 26 (+13.04%)
Mutual labels:  console
react-native-console-time-polyfill
console.time and console.timeEnd polyfill for react-native
Stars: ✭ 92 (+300%)
Mutual labels:  console
congif
convert script(1) output to GIF
Stars: ✭ 52 (+126.09%)
Mutual labels:  console
barecolor
A tiny JavaScript utility for printing colorful console messages.
Stars: ✭ 20 (-13.04%)
Mutual labels:  console
laravel-make-me
Extendable Interactive Make Command for Laravel
Stars: ✭ 36 (+56.52%)
Mutual labels:  console

Mini-Me

An embeddable, customizable, inline text-editor based on crossterm.

      ╭─── Input Prompt
    1 │ hello there
    2 │ this is a simple prompt
    3 │ thats multiline and decent enough
    4 ┃ _
      ╰─── Lines: 4     Chars: 70    Ln: 3, Col: 0

Features

  • Simple, intuitive, and embeddable.
  • Customize header, footer, and or margin gutters.
    • Preset styles are unstable.
  • Range selection.
  • Toggle-able fullscreen mode.
  • (Unstable) Clipboard support.

Binary Installation

minime can be used as a CLI. The best way to install it is using:

cargo install --features=bin --path .

The binary can be used by invoking minime -h.

Default Controls

  • Arrow keys work as expected.
  • Home, end, delete, Tab and backtab mirrors VSCode behavior.
  • F12 to enter full screen mode.
  • Shift-arrow keys create a selection range.
  • Esc or Enter on the last empty line to close and submit the prompt.
  • Control-X/C/V clipboard support is unstable.

Usage

Basic Setup

This is the most basic setup available.

use minime::{editor::keybindings::NormalKeybinding, editor::Editor, Result};

fn main() -> Result<()> {
    println!("Write something cool!");
    // Build the prompt.
    let mut term = Editor::default();
    term.read(NormalKeybinding, DefaultRenderer::default())?;
    dbg!(term.contents());
    Ok(())
}

Advanced

You can lock stdout() or stderr() to get better performance. You can also customize several settings in the renderer.

use minime::{
    editor::{keybindings::NormalKeybinding, Editor},
    renderer::{
        full::CrosstermRenderer,
        styles::classic::{ClassicFooter, ClassicGutter, ClassicHeader},
    },
    Result,
};

fn main() -> Result<()> {
    // Redirect our output to stdout (default).
    let stdout = std::io::stdout();
    let mut lock = stdout.lock();

    let renderer = CrosstermRenderer::render_to(&mut lock)
        .max_height(Some(10))
        .margin(ClassicGutter)
        .header(ClassicHeader(
            "Enter on the last line or Esc to submit your input!",
        ))
        .footer(ClassicFooter);

    // Print out some prompt using styling options.
    let term = Editor::with_renderer(renderer);
    term.read(NormalKeybinding, renderer)?;
    dbg!(term.contents());
    Ok(())
}
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].