Skip to content

Commit

Permalink
Added keybindings for new selector popup commands
Browse files Browse the repository at this point in the history
  • Loading branch information
Nimaoth committed Sep 8, 2024
1 parent d8bdb2f commit f3bef27
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
15 changes: 11 additions & 4 deletions config/default_config.nim
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,16 @@ proc loadDefaultKeybindings*(clearExisting: bool = false) {.expose("load-default
addCommand "editor", "<LEADER>ffm", "toggle-flag", "text.print-matches"
addCommand "editor", "<LEADER>ffh", "toggle-flag", "text.show-node-highlight"
addCommand "editor", "<LEADER>iii", "toggleShowDrawnNodes"
addCommand "editor", "<C-5>", proc() =
addCommandBlockDesc "editor", "<C-5>", "":
setOption("text.node-highlight-parent-index", clamp(getOption[int]("text.node-highlight-parent-index") - 1, 0, 100000))
echo "text.node-highlight-parent-index: ", getOption[int]("text.node-highlight-parent-index")
addCommand "editor", "<C-6>", proc() =
addCommandBlockDesc "editor", "<C-6>", "":
setOption("text.node-highlight-parent-index", clamp(getOption[int]("text.node-highlight-parent-index") + 1, 0, 100000))
echo "text.node-highlight-parent-index: ", getOption[int]("text.node-highlight-parent-index")
addCommand "editor", "<C-2>", proc() =
addCommandBlockDesc "editor", "<C-2>", "":
setOption("text.node-highlight-sibling-index", clamp(getOption[int]("text.node-highlight-sibling-index") - 1, -100000, 100000))
echo "text.node-highlight-sibling-index: ", getOption[int]("text.node-highlight-sibling-index")
addCommand "editor", "<C-3>", proc() =
addCommandBlockDesc "editor", "<C-3>", "":
setOption("text.node-highlight-sibling-index", clamp(getOption[int]("text.node-highlight-sibling-index") + 1, -100000, 100000))

# addCommand "editor", "<S-SPACE><*-l>", ""
Expand Down Expand Up @@ -158,7 +158,14 @@ proc loadDefaultKeybindings*(clearExisting: bool = false) {.expose("load-default
addCommand "popup.selector", "<C-n>", "next"
addCommand "popup.selector", "<C-u>", "prev", 5
addCommand "popup.selector", "<C-d>", "next", 5
addCommand "popup.selector", "<C-b>", "toggle-preview"
addCommand "popup.selector", "<TAB>", "toggle-focus-preview"
addCommand "popup.selector", "<C-k>s", "sort", "Toggle"
addCommand "popup.selector", "<C-k>n", "normalize-scores", "Toggle"
addCommand "popup.selector", "<C-k>f", "set-min-score", 0.0
addCommand "popup.selector", "<C-k>F", "set-min-score", -1.0
addCommand "popup.selector", "<C-k>+", "set-min-score", 0.2, add = true
addCommand "popup.selector", "<C-k>-", "set-min-score", -0.2, add = true
addCommand "popup.selector.preview", "<TAB>", "toggle-focus-preview"
addCommandBlock "popup.selector", "<C-l>":
setLocationListFromCurrentPopup()
Expand Down
2 changes: 2 additions & 0 deletions config/keybindings_vim.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1559,3 +1559,5 @@ proc loadVimKeybindings*() {.expose("load-vim-keybindings").} =
editor.centerCursor()
addTextCommand "", "<LEADER>gx", "close-diff"
addTextCommand "", "<LEADER>gc", "update-diff"
addTextCommand "", "<LEADER>gl", "fuzzy-search-lines"
addTextCommand "", "<LEADER>gL", "fuzzy-search-lines", minScore = 0.4, sort = false

0 comments on commit f3bef27

Please sign in to comment.