| Crates.io | viks |
| lib.rs | viks |
| version | 1.0.5 |
| created_at | 2025-06-27 15:27:37.905538+00 |
| updated_at | 2025-07-31 14:31:45.537063+00 |
| description | vim-like key crate |
| homepage | |
| repository | https://github.com/TundraClimate/viks |
| max_upload_size | |
| id | 1728847 |
| size | 26,185 |
vim-like key crate
Parse string to Key:
use viks::Key;
let a_key = Key::new("a").unwrap();
let shift_a_key = Key::new("<s-a>").unwrap();
let shift_a_key_alt = Key::new("A").unwrap();
assert_eq!(shift_a_key, shift_a_key_alt);
Parse string to Keymap(wrapper for Vec<Key>):
use viks::Keymap;
let zz_map = Keymap::new("zz").unwrap();
let exit_map = Keymap::new("ZZ").unwrap();
let exit_map_alt = Keymap::new("<s-z><s-z>").unwrap();
assert_eq!(exit_map, exit_map_alt);
avaliable ascii characters.
Special tags:
| string | key |
|---|---|
<enter> or <cr> |
KeyCode::Enter |
<tab> |
KeyCode::Tab |
<esc> |
KeyCode::Esc |
<leader> or <space> |
KeyCode::Space |
<bs> |
KeyCode::Backspace |
<del> |
KeyCode::Delete |
<lt> |
KeyCode::LessThanSign |
Modifier tags:
| string | key |
|---|---|
| <s-{}> | KeyModifier::Shift |
| <a-{}> | KeyModifier::Alt |
| <c-{}> | KeyModifier::Control |
MIT