Add vim bindings and directory expand/collapse
- Replace arrow keys with j/k for navigation - Add h/l for collapse/expand directories - Remove emoji icons, use clean text markers - Show directories with [-]/[+] expand markers - Track expanded state per directory path - Add directory suffix (/) for clarity - Update help text with vim bindings
This commit is contained in:
10
src/main.rs
10
src/main.rs
@@ -101,12 +101,18 @@ async fn handle_key_event(state: &mut AppState, key_code: KeyCode) -> Result<()>
|
||||
KeyCode::Char('q') => {
|
||||
state.should_quit = true;
|
||||
}
|
||||
KeyCode::Up => {
|
||||
KeyCode::Char('k') => {
|
||||
state.move_selection_up();
|
||||
}
|
||||
KeyCode::Down => {
|
||||
KeyCode::Char('j') => {
|
||||
state.move_selection_down();
|
||||
}
|
||||
KeyCode::Char('h') => {
|
||||
state.collapse_selected();
|
||||
}
|
||||
KeyCode::Char('l') => {
|
||||
state.expand_selected();
|
||||
}
|
||||
KeyCode::Enter => {
|
||||
if let Some(item) = state.get_selected_item() {
|
||||
if !item.node.is_dir {
|
||||
|
||||
Reference in New Issue
Block a user