Crate edtui_papier

Source
Expand description

§EdTUI

§Overview

EdTUI is a text editor widget for the Ratatui ecosystem. It is designed to provide a light-weight user experience inspired by Vim.

§Features

  • Vim-like keybindings and editing modes for efficient text manipulation.
  • Normal, Insert and Visual mode.
  • Clipboard: Uses the arboard clibpboard by default which allows copy pasting between the system clipboard and the editor.

§Keybindings

EdTUI offers a set of keybindings similar to Vim. Here are some of the most common keybindings:

§Normal/Visual Mode:
KeybindingDescription
iEnter Insert mode
vEnter Visual mode
h, j, k, lNavigate left, down, up, and right
w, bMove forward or backward by word
xDelete the character under the cursor
DelDelete the character left of the cursor
u, rUndo/Redo last action
EscEscape Insert mode or Visual mode
0Move cursor to start of line
^Move cursor to first non-blank character
$Move cursor to end of line
aAppend after the cursor
AAppend at the end of the line
oAdd a new line below and enter Insert mode
OAdd a new line above and enter Insert mode
BackspaceDelete the previous character
dDelete the selection
ddDelete the current line
ciwSelect between delimiters. Supported: [“]
uUndo the last change
rRedo the last undone action
yCopy the selected text
pPaste the copied text
§Insert Mode:
KeybindingDescription
EscReturn to Normal mode

For more keybindings and customization options, refer to the code.

§Demo

§Roadmap

  • Clipboard

  • Search

  • Vims f/t go to first

  • Support termwiz and termion

  • Display line numbers

  • Remap keybindings

  • Soft-wrap lines

Re-exports§

pub use input::Input;
pub use state::mode::EditorMode;
pub use state::EditorState;
pub use view::theme::EditorTheme;
pub use view::EditorView;
pub use view::StatusLine;

Modules§

actions
Editor actions such as move, insert, delete
clipboard
The editors clipboard
input
Handles key input events
state
The editors state
view
The editors state

Structs§

Index2
An index representing a specific position in a 2d jagged array.

Type Aliases§

Lines
A data structure that contains chars organized in rows and columns