ratatui_toolkit/primitives/termtui/keybindings/mod.rs
1//! Keybindings configuration for TermTui
2//!
3//! This module provides customizable keybindings for terminal operations.
4
5mod constructors;
6mod methods;
7
8use crossterm::event::KeyEvent;
9
10/// Customizable keybindings for TermTui
11///
12/// This struct holds all keybindings that can be customized.
13/// Each field is a `KeyEvent` that specifies the key combination.
14#[derive(Debug, Clone)]
15pub struct TermTuiKeyBindings {
16 /// Enter copy mode (default: Ctrl+X)
17 pub enter_copy_mode: KeyEvent,
18 /// Copy selection to clipboard (default: Ctrl+Shift+C)
19 pub copy_selection: KeyEvent,
20
21 // Copy mode keybindings
22 /// Exit copy mode (default: Esc)
23 pub copy_exit: KeyEvent,
24 /// Alternative exit copy mode (default: q)
25 pub copy_exit_alt: KeyEvent,
26 /// Move cursor up in copy mode (default: k or Up)
27 pub copy_move_up: KeyEvent,
28 /// Alternative move up (default: Up arrow)
29 pub copy_move_up_alt: KeyEvent,
30 /// Move cursor down in copy mode (default: j or Down)
31 pub copy_move_down: KeyEvent,
32 /// Alternative move down (default: Down arrow)
33 pub copy_move_down_alt: KeyEvent,
34 /// Move cursor left in copy mode (default: h or Left)
35 pub copy_move_left: KeyEvent,
36 /// Alternative move left (default: Left arrow)
37 pub copy_move_left_alt: KeyEvent,
38 /// Move cursor right in copy mode (default: l or Right)
39 pub copy_move_right: KeyEvent,
40 /// Alternative move right (default: Right arrow)
41 pub copy_move_right_alt: KeyEvent,
42 /// Move to line start (default: 0 or Home)
43 pub copy_line_start: KeyEvent,
44 /// Alternative line start (default: Home)
45 pub copy_line_start_alt: KeyEvent,
46 /// Move to line end (default: $ or End)
47 pub copy_line_end: KeyEvent,
48 /// Alternative line end (default: End)
49 pub copy_line_end_alt: KeyEvent,
50 /// Page up (default: u or PageUp)
51 pub copy_page_up: KeyEvent,
52 /// Alternative page up (default: PageUp)
53 pub copy_page_up_alt: KeyEvent,
54 /// Page down (default: d or PageDown)
55 pub copy_page_down: KeyEvent,
56 /// Alternative page down (default: PageDown)
57 pub copy_page_down_alt: KeyEvent,
58 /// Go to top (default: g)
59 pub copy_top: KeyEvent,
60 /// Go to bottom (default: G)
61 pub copy_bottom: KeyEvent,
62 /// Move word left (default: b)
63 pub copy_word_left: KeyEvent,
64 /// Move word right (default: w)
65 pub copy_word_right: KeyEvent,
66 /// Start/toggle selection (default: v or Space)
67 pub copy_start_selection: KeyEvent,
68 /// Alternative start selection (default: Space)
69 pub copy_start_selection_alt: KeyEvent,
70 /// Copy and exit (default: y or Enter)
71 pub copy_and_exit: KeyEvent,
72 /// Alternative copy and exit (default: Enter)
73 pub copy_and_exit_alt: KeyEvent,
74}