-
-
Notifications
You must be signed in to change notification settings - Fork 58
Add customizable keymap for window_navigation and scrolling #79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
TheoBrigitte
wants to merge
3
commits into
greggh:main
Choose a base branch
from
TheoBrigitte:window-navigation-keymap
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,8 +42,10 @@ local M = {} | |
| --- ClaudeCodeKeymaps class for keymap configuration | ||
| -- @table ClaudeCodeKeymaps | ||
| -- @field toggle ClaudeCodeKeymapsToggle Keymaps for toggling Claude Code | ||
| -- @field window_navigation boolean Enable window navigation keymaps | ||
| -- @field scrolling boolean Enable scrolling keymaps | ||
| -- @field window_navigation table|nil Window navigation keymaps | ||
| -- @field window_navigation.enabled boolean Enable window navigation keymaps | ||
| -- @field scrolling table|nil Scrolling keymaps | ||
| -- @field scrolling.enabled boolean Enable scrolling keymaps | ||
|
|
||
| --- ClaudeCodeCommandVariants class for command variant configuration | ||
| -- @table ClaudeCodeCommandVariants | ||
|
|
@@ -131,8 +133,18 @@ M.default_config = { | |
| verbose = '<leader>cV', -- Normal mode keymap for Claude Code with verbose flag | ||
| }, | ||
| }, | ||
| window_navigation = true, -- Enable window navigation keymaps (<C-h/j/k/l>) | ||
| scrolling = true, -- Enable scrolling keymaps (<C-f/b>) for page up/down | ||
| window_navigation = { | ||
| enabled = true, -- Enable window navigation keymaps | ||
| left = '<C-h>', -- Move to left window | ||
| down = '<C-j>', -- Move to down window | ||
| up = '<C-k>', -- Move to up window | ||
| right = '<C-l>', -- Move to right window | ||
| }, | ||
| scrolling = { | ||
| enabled = true, -- Enable scrolling keymaps | ||
| page_down = '<C-f>', -- Scroll down one page | ||
| page_up = '<C-b>', -- Scroll up one page | ||
| }, | ||
| }, | ||
| } | ||
|
|
||
|
|
@@ -351,12 +363,44 @@ local function validate_keymaps_config(keymaps) | |
| end | ||
| end | ||
|
|
||
| if type(keymaps.window_navigation) ~= 'boolean' then | ||
| return false, 'keymaps.window_navigation must be a boolean' | ||
| if type(keymaps.window_navigation) ~= 'table' then | ||
| return false, 'keymaps.window_navigation must be a table' | ||
| end | ||
|
|
||
| if type(keymaps.window_navigation.enabled) ~= 'boolean' then | ||
| return false, 'keymaps.window_navigation.enabled boolean' | ||
| end | ||
|
Comment on lines
370
to
372
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix incorrect error message. Line 371 validates that Apply this diff to fix the error message: if type(keymaps.window_navigation.enabled) ~= 'boolean' then
- return false, 'keymaps.window_navigation.enabled must be a table'
+ return false, 'keymaps.window_navigation.enabled must be a boolean'
end🤖 Prompt for AI Agents |
||
|
|
||
| if type(keymaps.window_navigation.left) ~= 'string' then | ||
| return false, 'keymaps.window_navigation.left must be a string' | ||
| end | ||
|
|
||
| if type(keymaps.window_navigation.down) ~= 'string' then | ||
| return false, 'keymaps.window_navigation.down must be a string' | ||
| end | ||
|
|
||
| if type(keymaps.window_navigation.up) ~= 'string' then | ||
| return false, 'keymaps.window_navigation.up must be a string' | ||
| end | ||
|
|
||
| if type(keymaps.window_navigation.right) ~= 'string' then | ||
| return false, 'keymaps.window_navigation.right must be a string' | ||
| end | ||
|
|
||
| if type(keymaps.scrolling) ~= 'table' then | ||
| return false, 'keymaps.scrolling must be a table' | ||
| end | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| if type(keymaps.scrolling.enabled) ~= 'boolean' then | ||
| return false, 'keymaps.scrolling.enabled must be a boolean' | ||
| end | ||
|
|
||
| if type(keymaps.scrolling.page_down) ~= 'string' then | ||
| return false, 'keymaps.scrolling.page_down must be a string' | ||
| end | ||
|
|
||
| if type(keymaps.scrolling) ~= 'boolean' then | ||
| return false, 'keymaps.scrolling must be a boolean' | ||
| if type(keymaps.scrolling.page_up) ~= 'string' then | ||
| return false, 'keymaps.scrolling.page_up must be a string' | ||
| end | ||
|
|
||
| return true, nil | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Documentation is incomplete for window_navigation and scrolling fields.
The documentation only mentions the
enabledfield but omits the actual key binding fields. Users need to know aboutleft,down,up,rightfor window_navigation andpage_down,page_upfor scrolling.Apply this diff to complete the documentation:
🤖 Prompt for AI Agents