Skip to content

Commit

Permalink
keymap: added nav bindings for qfix
Browse files Browse the repository at this point in the history
Signed-off-by: aserowy <serowy@hotmail.com>
  • Loading branch information
aserowy committed Oct 7, 2024
1 parent 865ad46 commit 6476015
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ register holds all files which got yanked and the last nine trashes.
| "p\<char> | paste register named \<char> from junk yard to current path |
| yp | copy current selected path to system clipboard |
| yy | yank file to junk yard |
| C-n, C-p | navigate to (n)ext or (p) qfix entry |

### navigation and normal mode

Expand Down
19 changes: 19 additions & 0 deletions yeet-keymap/src/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,24 @@ impl Default for KeyMap {
&mut mappings,
vec![Mode::Navigation],
vec![
(
vec![Key::new(KeyCode::from_char('n'), vec![KeyModifier::Ctrl])],
Binding {
kind: BindingKind::Message(KeymapMessage::ExecuteCommandString(
"cn".to_owned(),
)),
..Default::default()
},
),
(
vec![Key::new(KeyCode::from_char('p'), vec![KeyModifier::Ctrl])],
Binding {
kind: BindingKind::Message(KeymapMessage::ExecuteCommandString(
"cN".to_owned(),
)),
..Default::default()
},
),
(
vec![
Key::new(KeyCode::from_char('"'), vec![]),
Expand Down Expand Up @@ -819,6 +837,7 @@ fn add_mapping(
}

fn get_home_path() -> PathBuf {
// TODO: custom keymap message to remove dirs dependency in keymap
dirs::home_dir()
.expect("Failed to get home directory")
.to_path_buf()
Expand Down

0 comments on commit 6476015

Please sign in to comment.