m4xshen / autoclose.nvim

A minimalist Neovim plugin that auto pairs & closes brackets
MIT License
488 stars 13 forks source link

Allow Shift-Enter to trigger auto-indent #14

Closed mkrasnitski closed 1 year ago

mkrasnitski commented 1 year ago

I run alacritty as my terminal, and that lets me properly map <S-CR> in the terminal by sending vim the keystrokes it expects. This causes problems with auto-indent though, as sometimes if I type quickly I'll press Shift+{, then press enter while Shift is still pressed, and then the indentation won't trigger. I tried doing inoremap <S-CR> <CR> but that didn't seem to work. Any ideas on how to solve this minor annoyance?

m4xshen commented 1 year ago

Could you post your alacritty config file? When I use the plugin in alacritty with default config it doesn't have this issue.

mkrasnitski commented 1 year ago

Sure, this is the relevant part of my config:

key_bindings:
  # Vim expects these codes for <S-CR> and <C-CR>
  - { key: Return,   mods: Shift,   chars: "\x1b[13;2u" }
  - { key: Return,   mods: Control, chars: "\x1b[13;5u" }
m4xshen commented 1 year ago

This issue is fixed in 6b1def5229a461eed076d4d7ecad531edbfcea97. Thanks for your feedback.