Skip to content

Commit 749fbe1

Browse files
authored
chore: make skimCommandKey configurable and add help text (#1269)
1 parent 7cafb71 commit 749fbe1

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

crates/q_cli/src/cli/chat/input_source.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,12 @@ impl InputSource {
3838

3939
pub fn put_skim_command_selector(&mut self, context_manager: Arc<ContextManager>) {
4040
if let inner::Inner::Readline(rl) = &mut self.0 {
41+
let key_char = match fig_settings::settings::get_string_opt("chat.skimCommandKey").as_deref() {
42+
Some(key) if key.len() == 1 => key.chars().next().unwrap_or('k'),
43+
_ => 'k', // Default to 'k' if setting is missing or invalid
44+
};
4145
rl.bind_sequence(
42-
KeyEvent::ctrl('k'),
46+
KeyEvent::ctrl(key_char),
4347
EventHandler::Conditional(Box::new(SkimCommandSelector::new(context_manager))),
4448
);
4549
}

crates/q_cli/src/cli/chat/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ const WELCOME_TEXT: &str = color_print::cstr! {"
168168
<em>/quit</em> <black!>Quit the application</black!>
169169
170170
<cyan!>Use Ctrl(^) + j to provide multi-line prompts.</cyan!>
171-
<cyan!>Use Ctrl(^) + k to fuzzily search commands and context (use tab to select multiple files).</cyan!>
171+
<cyan!>Use Ctrl(^) + k to fuzzily search commands and context.</cyan!>
172172
173173
"};
174174

@@ -211,6 +211,8 @@ const HELP_TEXT: &str = color_print::cstr! {"
211211
<cyan,em>Tips:</cyan,em>
212212
<em>!{command}</em> <black!>Quickly execute a command in your current session</black!>
213213
<em>Ctrl(^) + j</em> <black!>Insert new-line to provide multi-line prompt. Alternatively, [Alt(⌥) + Enter(⏎)]</black!>
214+
<em>Ctrl(^) + k</em> <black!>Fuzzy search commands and context files. Use Tab to select multiple items.</black!>
215+
<black!>Change the keybind to ctrl+x with: q settings chat.skimCommandKey x (where x is any key)</black!>
214216
215217
"};
216218

0 commit comments

Comments
 (0)