pub struct Vi { /* private fields */ }
Expand description
Vi keybindings for Editor
.
use sl_liner::*;
use sl_liner::keymap;
struct EmptyCompleter;
impl Completer for EmptyCompleter {
fn completions(&mut self, _start: &str) -> Vec<String> {
Vec::new()
}
}
let mut context = Context::new();
context.set_keymap(Box::new(keymap::Vi::new()));
// This will hang github actions on windows...
//let res = context.read_line(Prompt::from("[prompt]$ "), None);
Implementations§
Source§impl Vi
impl Vi
pub fn new() -> Self
pub fn set_normal_prompt_prefix(&mut self, prefix: Option<String>)
pub fn set_normal_prompt_suffix(&mut self, suffix: Option<String>)
pub fn set_insert_prompt_prefix(&mut self, prefix: Option<String>)
pub fn set_insert_prompt_suffix(&mut self, suffix: Option<String>)
pub fn set_esc_sequence(&mut self, key1: char, key2: char, timeout_ms: u32)
pub fn set_keyword_rule(&mut self, keyword_rule: Box<dyn ViKeywordRule>)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Vi
impl !RefUnwindSafe for Vi
impl !Send for Vi
impl !Sync for Vi
impl Unpin for Vi
impl !UnwindSafe for Vi
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more