Skip to content
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

デフォルトキーマップを廃止して色々整理 #79

Merged
merged 6 commits into from
Jul 5, 2024

Conversation

kamecha
Copy link
Owner

@kamecha kamecha commented Jul 5, 2024

Close #78

ユーザーの設定と競合しないように、設定フレンドリーになりたいよね

Summary by CodeRabbit

  • New Features

    • Introduced customizable key mappings for various operations in the traqvim plugin.
  • Documentation

    • Added a new section to the README for settings related to Vim key mappings.
    • Updated doc/traqvim.jax with new key mappings for message operations.
  • Refactor

    • Renamed key mappings in ftplugin/traqvim.vim for consistency and clarity.

@kamecha kamecha self-assigned this Jul 5, 2024
Copy link

coderabbitai bot commented Jul 5, 2024

Walkthrough

A new section to handle key mappings for traqvim plugin operations is added to the README.md, along with an updated traqvim_setting() function. Key mappings have been renamed and standardized in documentation and vim plugin files for consistency and better user configurability.

Changes

Files Change Summary
README.md Added traqvim_setting() function with key mappings for motion, yanking, deleting, and toggling operations.
doc/traqvim.jax Introduced new key mappings for specific message operations including motion, yanking, deleting, and toggling pins.
ftplugin/traqvim.vim Renamed existing key mappings to align with new naming conventions for better clarity and consistency.

Assessment against linked issues

Objective (Issue #) Addressed Explanation
Improve and document key mapping settings (Issues #78)
Allow users to configure their own key mappings (Issues #78)

Poem

In traqvim paths beneath the keys,
Settings changed with gentle ease.
Mappings clear and format bright,
For users’ Vim, customized delight.
Now each motion, yank, and pin,
Aligns in sync, let’s dive right in! 🎵🐇


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Outside diff range and nitpick comments (1)
README.md (1)

47-56: Avoid using hard tabs.

Use spaces instead of hard tabs for better consistency and readability in Markdown files.

-	omap <buffer> im
-				\ <Plug>(traqvim-message-motion)
-	nmap <buffer> <LocalLeader>y
-				\ <Plug>(traqvim-operator-message-yank-link)
-	nmap <buffer> <LocalLeader>Y
-				\ <Plug>(traqvim-operator-message-yank-markdown)
-	nmap <buffer> <LocalLeader>d
-				\ <Plug>(traqvim-operator-message-delete)
-	nmap <buffer> <LocalLeader>p
-				\ <Plug>(traqvim-operator-pin-toggle)
+  omap <buffer> im
+    \ <Plug>(traqvim-message-motion)
+  nmap <buffer> <LocalLeader>y
+    \ <Plug>(traqvim-operator-message-yank-link)
+  nmap <buffer> <LocalLeader>Y
+    \ <Plug>(traqvim-operator-message-yank-markdown)
+  nmap <buffer> <LocalLeader>d
+    \ <Plug>(traqvim-operator-message-delete)
+  nmap <buffer> <LocalLeader>p
+    \ <Plug>(traqvim-operator-pin-toggle)
Tools
Markdownlint

47-47: Column: 1
Hard tabs

(MD010, no-hard-tabs)


48-48: Column: 1
Hard tabs

(MD010, no-hard-tabs)


49-49: Column: 1
Hard tabs

(MD010, no-hard-tabs)


50-50: Column: 1
Hard tabs

(MD010, no-hard-tabs)


51-51: Column: 1
Hard tabs

(MD010, no-hard-tabs)


52-52: Column: 1
Hard tabs

(MD010, no-hard-tabs)


53-53: Column: 1
Hard tabs

(MD010, no-hard-tabs)


54-54: Column: 1
Hard tabs

(MD010, no-hard-tabs)


55-55: Column: 1
Hard tabs

(MD010, no-hard-tabs)


56-56: Column: 1
Hard tabs

(MD010, no-hard-tabs)

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between a1cc784 and a043d98.

Files selected for processing (3)
  • README.md (1 hunks)
  • doc/traqvim.jax (1 hunks)
  • ftplugin/traqvim.vim (1 hunks)
Files skipped from review due to trivial changes (1)
  • doc/traqvim.jax
Additional context used
Markdownlint
README.md

47-47: Column: 1
Hard tabs

(MD010, no-hard-tabs)


48-48: Column: 1
Hard tabs

(MD010, no-hard-tabs)


49-49: Column: 1
Hard tabs

(MD010, no-hard-tabs)


50-50: Column: 1
Hard tabs

(MD010, no-hard-tabs)


51-51: Column: 1
Hard tabs

(MD010, no-hard-tabs)


52-52: Column: 1
Hard tabs

(MD010, no-hard-tabs)


53-53: Column: 1
Hard tabs

(MD010, no-hard-tabs)


54-54: Column: 1
Hard tabs

(MD010, no-hard-tabs)


55-55: Column: 1
Hard tabs

(MD010, no-hard-tabs)


56-56: Column: 1
Hard tabs

(MD010, no-hard-tabs)

Additional comments not posted (4)
ftplugin/traqvim.vim (4)

16-16: Ensure the function traqvim#registerYankMessageLink exists and is correctly implemented.

The key mapping <Plug>(traqvim-operator-message-yank-link) is bound to traqvim#registerYankMessageLink().


25-25: Ensure the function traqvim#message_motion exists and is correctly implemented.

The key mapping <Plug>(traqvim-message-motion) is bound to traqvim#message_motion().


20-20: Ensure the function traqvim#registerDeleteMessage exists and is correctly implemented.

The key mapping <Plug>(traqvim-operator-message-delete) is bound to traqvim#registerDeleteMessage().


22-22: Ensure the function traqvim#registerTogglePin exists and is correctly implemented.

The key mapping <Plug>(traqvim-operator-pin-toggle) is bound to traqvim#registerTogglePin().

Verification successful

The function traqvim#registerTogglePin exists and is correctly implemented.

  • The function is defined in autoload/traqvim.vim.
  • The key mapping <Plug>(traqvim-operator-pin-toggle) is correctly referenced in the codebase.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the existence and implementation of `traqvim#registerTogglePin`.

# Test: Search for the function definition. Expect: The function is defined and implemented properly.
ast-grep --lang vimscript --pattern $'function! traqvim#registerTogglePin()' 

Length of output: 196


Script:

#!/bin/bash
# Description: Verify the existence and implementation of `traqvim#registerTogglePin`.

# Test: Search for the function definition. Expect: The function is defined and implemented properly.
rg 'function!\s*traqvim#registerTogglePin' --glob '*.vim'

Length of output: 59


Script:

#!/bin/bash
# Description: Verify the existence and implementation of `traqvim#registerTogglePin` and check the key mapping.

# Test 1: Search for any references to the function `traqvim#registerTogglePin` in the entire codebase.
rg 'traqvim#registerTogglePin'

# Test 2: Check the key mapping for <Plug>(traqvim-operator-pin-toggle).
rg '<Plug>\(traqvim-operator-pin-toggle\)'

Length of output: 421

\ traqvim#registerYankMessageLink()
nnoremap <buffer><expr> <Plug>(traqvim-yank-message-markdown-operator)
nnoremap <buffer><expr> <Plug>(traqvim-operator-message-yank-markdown)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tip

Codebase Verification

Function traqvim#registerYankMessageMarkdown not found

The function traqvim#registerYankMessageMarkdown does not exist in the codebase. This means the key mapping <Plug>(traqvim-operator-message-yank-markdown) is invalid and will not work as intended. Please define the function or correct the key mapping.

  • File: ftplugin/traqvim.vim
  • Line: 18
Analysis chain

Ensure the function traqvim#registerYankMessageMarkdown exists and is correctly implemented.

The key mapping <Plug>(traqvim-operator-message-yank-markdown) is bound to traqvim#registerYankMessageMarkdown().

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the existence and implementation of `traqvim#registerYankMessageMarkdown`.

# Test: Search for the function definition. Expect: The function is defined and implemented properly.
ast-grep --lang vimscript --pattern $'function! traqvim#registerYankMessageMarkdown()' 

Length of output: 206


Script:

#!/bin/bash
# Description: Verify the existence and implementation of `traqvim#registerYankMessageMarkdown`.

# Test: Search for the function definition. Expect: The function is defined and implemented properly.
rg 'function! traqvim#registerYankMessageMarkdown'

Length of output: 52


Script:

#!/bin/bash
# Description: Search for any functions that include "traqvim" in their name to ensure we haven't missed any relevant definitions.

# Test: Search for all function definitions that include "traqvim". Expect: To find relevant functions if they exist.
rg 'function!.*traqvim'

Length of output: 823

@kamecha kamecha force-pushed the refacter/delete-default-keymap branch from a043d98 to 3592c53 Compare July 5, 2024 11:46
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between a043d98 and 3592c53.

Files selected for processing (3)
  • README.md (1 hunks)
  • doc/traqvim.jax (1 hunks)
  • ftplugin/traqvim.vim (1 hunks)
Files skipped from review as they are similar to previous changes (2)
  • doc/traqvim.jax
  • ftplugin/traqvim.vim
Additional context used
Markdownlint
README.md

47-47: Column: 1
Hard tabs

(MD010, no-hard-tabs)


48-48: Column: 1
Hard tabs

(MD010, no-hard-tabs)


49-49: Column: 1
Hard tabs

(MD010, no-hard-tabs)


50-50: Column: 1
Hard tabs

(MD010, no-hard-tabs)


51-51: Column: 1
Hard tabs

(MD010, no-hard-tabs)


52-52: Column: 1
Hard tabs

(MD010, no-hard-tabs)


53-53: Column: 1
Hard tabs

(MD010, no-hard-tabs)


54-54: Column: 1
Hard tabs

(MD010, no-hard-tabs)


55-55: Column: 1
Hard tabs

(MD010, no-hard-tabs)


56-56: Column: 1
Hard tabs

(MD010, no-hard-tabs)

Additional comments not posted (1)
README.md (1)

44-44: LGTM!

The autocmd command correctly calls the s:traqvim_setting function when the traqvim file type is detected.

Comment on lines +47 to +56
omap <buffer> im
\ <Plug>(traqvim-motion-message)
nmap <buffer> <LocalLeader>y
\ <Plug>(traqvim-operator-message-yank-link)
nmap <buffer> <LocalLeader>Y
\ <Plug>(traqvim-operator-message-yank-markdown)
nmap <buffer> <LocalLeader>d
\ <Plug>(traqvim-operator-message-delete)
nmap <buffer> <LocalLeader>p
\ <Plug>(traqvim-operator-pin-toggle)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace hard tabs with spaces.

The use of hard tabs violates Markdownlint rules (MD010). Replace hard tabs with spaces for consistent formatting.

-	omap <buffer> im
-				\ <Plug>(traqvim-motion-message)
-	nmap <buffer> <LocalLeader>y
-				\ <Plug>(traqvim-operator-message-yank-link)
-	nmap <buffer> <LocalLeader>Y
-				\ <Plug>(traqvim-operator-message-yank-markdown)
-	nmap <buffer> <LocalLeader>d
-				\ <Plug>(traqvim-operator-message-delete)
-	nmap <buffer> <LocalLeader>p
-				\ <Plug>(traqvim-operator-pin-toggle)
+  omap <buffer> im
+    \ <Plug>(traqvim-motion-message)
+  nmap <buffer> <LocalLeader>y
+    \ <Plug>(traqvim-operator-message-yank-link)
+  nmap <buffer> <LocalLeader>Y
+    \ <Plug>(traqvim-operator-message-yank-markdown)
+  nmap <buffer> <LocalLeader>d
+    \ <Plug>(traqvim-operator-message-delete)
+  nmap <buffer> <LocalLeader>p
+    \ <Plug>(traqvim-operator-pin-toggle)
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
omap <buffer> im
\ <Plug>(traqvim-motion-message)
nmap <buffer> <LocalLeader>y
\ <Plug>(traqvim-operator-message-yank-link)
nmap <buffer> <LocalLeader>Y
\ <Plug>(traqvim-operator-message-yank-markdown)
nmap <buffer> <LocalLeader>d
\ <Plug>(traqvim-operator-message-delete)
nmap <buffer> <LocalLeader>p
\ <Plug>(traqvim-operator-pin-toggle)
omap <buffer> im
\ <Plug>(traqvim-motion-message)
nmap <buffer> <LocalLeader>y
\ <Plug>(traqvim-operator-message-yank-link)
nmap <buffer> <LocalLeader>Y
\ <Plug>(traqvim-operator-message-yank-markdown)
nmap <buffer> <LocalLeader>d
\ <Plug>(traqvim-operator-message-delete)
nmap <buffer> <LocalLeader>p
\ <Plug>(traqvim-operator-pin-toggle)
Tools
Markdownlint

47-47: Column: 1
Hard tabs

(MD010, no-hard-tabs)


48-48: Column: 1
Hard tabs

(MD010, no-hard-tabs)


49-49: Column: 1
Hard tabs

(MD010, no-hard-tabs)


50-50: Column: 1
Hard tabs

(MD010, no-hard-tabs)


51-51: Column: 1
Hard tabs

(MD010, no-hard-tabs)


52-52: Column: 1
Hard tabs

(MD010, no-hard-tabs)


53-53: Column: 1
Hard tabs

(MD010, no-hard-tabs)


54-54: Column: 1
Hard tabs

(MD010, no-hard-tabs)


55-55: Column: 1
Hard tabs

(MD010, no-hard-tabs)


56-56: Column: 1
Hard tabs

(MD010, no-hard-tabs)

@kamecha kamecha merged commit ac5b55f into master Jul 5, 2024
1 check passed
@kamecha kamecha deleted the refacter/delete-default-keymap branch July 5, 2024 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

キーマップの設定周りを改善
1 participant