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

fix(mappings): add a note for overriding mapping #158

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

1024th
Copy link

@1024th 1024th commented Jul 19, 2024

Related issue: AstroNvim/AstroNvim#2353 (comment)

📑 Description

Add a note for possible race condition when overriding default mapping.

Copy link

netlify bot commented Jul 19, 2024

Deploy Preview for peaceful-platypus-6db452 ready!

Name Link
🔨 Latest commit f7a0ebc
🔍 Latest deploy log https://app.netlify.com/sites/peaceful-platypus-6db452/deploys/669a878ce431dc0008f59b57
😎 Deploy Preview https://deploy-preview-158--peaceful-platypus-6db452.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 96 (no change from production)
Accessibility: 98 (no change from production)
Best Practices: 100 (no change from production)
SEO: 93 (no change from production)
PWA: 90 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@@ -9,6 +9,12 @@ Mappings can be customized through [AstroCore](https://github.com/AstroNvim/astr

These tables are a direct conversion to the `vim.keymap.set({mode}, {lhs}, {rhs}, {opts})` Lua API. The first key into the table is the `{mode}`, the second key into the table is the `{lhs}`, and the element there is the `{opts}` table with the `{rhs}` in the first key. Also AstroLSP supports adding a `cond` key which can dictate when the mapping should be attached (this is described in detail in the [AstroLSP plugin configuration documentation](https://github.com/AstroNvim/astrolsp#%EF%B8%8F-configuration)) Here is a simple plugin specification example of setting both core and LSP mappings:

:::note

If you want to override a default mapping, the key needs to exactly match (case sensitive) the existing definition in the table; otherwise, there is a race condition. AstroCore uses capital modifiers.
Copy link
Member

Choose a reason for hiding this comment

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

We should probably mention that we normalize on the keycode casing used in the official vimdocs such as :h keycodes

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.

2 participants