AstroNvim / astrolsp

LSP Configuration Engine built for AstroNvim
https://AstroNvim.com
GNU General Public License v3.0
44 stars 4 forks source link

Unable to map insert-mode <C-s> #9

Closed IIamaseconds closed 4 months ago

IIamaseconds commented 4 months ago

Checklist

Neovim version (nvim -v)

0.9

Operating system/version

macOS

Terminal/GUI

warp

Describe the bug

I use CTRL-s for saving while in insert-mode. This is not possible using AstroLSP since it seems to reserve the shortcut for itself and cannot be overriden.

I am not completely sure how it works, and the only time the key works is when AstroLSP is removed from the plugin list.

Steps to Reproduce

Expected behavior

Command executes when combination is pressed in insert-mode.

Screenshots

No response

Additional Context

No response

mehalter commented 4 months ago

This is a new default in neovim 0.10 that we have backported to AstroNvim. We normalize our mappings to the official keycodes in the vim documentation.

The casing of the key here should be <C-S>. Here is a correct example for you to remove this mapping:

return {
  "AstroNvim/astrolsp",
  opts = {
    mappings = {
      i = {
        ["<C-S>"] = false
      }
    }
  }
}
mehalter commented 4 months ago

Also us backporting this mapping actually does break our own default mapping of <C-S> being mapped to save. I have reverted this and will release soon. So the above code will be unnecessary and your own mapping of <C-S> for save is also unnecessary since it's a default