Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Inline multiline text-editor/prompt written in Rust.

License

NotificationsYou must be signed in to change notification settings

Avarel/mini-me

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

82 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

An embeddable, customizable, inline text-editor based oncrossterm.

      ╭───InputPrompt1 │ hello there2 │ this is a simple prompt3 │ thats multiline and decent enough4 ┃ _      ╰───Lines:4Chars:70Ln: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 invokingminime -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 orEnter 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};fnmain() ->Result<()>{println!("Write something cool!");// Build the prompt.letmut term =Editor::default();    term.read(NormalKeybinding,DefaultRenderer::default())?;dbg!(term.contents());Ok(())}

Advanced

You can lockstdout() orstderr() to get better performance. You can alsocustomize several settings in the renderer.

use minime::{    editor::{keybindings::NormalKeybinding,Editor},    renderer::{        full::CrosstermRenderer,        styles::classic::{ClassicFooter,ClassicGutter,ClassicHeader},},Result,};fnmain() ->Result<()>{// Redirect our output to stdout (default).let stdout = std::io::stdout();letmut lock = stdout.lock();let renderer =CrosstermRenderer::render_to(&mut lock).max_height(Some(10)).margin(ClassicGutter).header(ClassicHeader{message:"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);let result = term.read(NormalKeybinding)?;dbg!(result);Ok(())}

About

Inline multiline text-editor/prompt written in Rust.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp