kickstart.nvim icon indicating copy to clipboard operation
kickstart.nvim copied to clipboard

Backspace not working in INSERT mode

Open Mosazghi opened this issue 1 year ago • 2 comments

Describe the bug

After installing kickstart.nvim, my backspace has suddenly stopped working while in INSERT mode. This issue did not occur prior to install kickstart. Also i have tried reinstalling.

To Reproduce

  1. Install kickstart.nvim
  2. Edit any file

Desktop

  • OS: Ubuntu 22.04 LTS
  • Terminal: Alacritty

Neovim Version

NVIM v0.9.5
Build type: Release
LuaJIT 2.1.1692716794

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/__w/neovim/neovim/build/nvim.AppDir/usr/share/nvim"


Mosazghi avatar Mar 27 '24 22:03 Mosazghi

Kickstart uses ctrl-h for completion snippet navigation. Most terminals should output an ASCII DEL when hitting the backspace (ascii 7f) but sometimes backspace is bound to ctrl-h. This is for example gnome-terminal config: image You can verify that by running cat from shell and then pressing ctrl-v backspace and see whether it prints ^H or ^? Can you try that and see how your alacritty behaves? I tried installing it and it produces ascii del as expected and backspace in nvim insert mode works. I installed it with:

sudo snap install alacritty --classic

Does backspace work properly for you when using gnome-terminal?

Anyway, if you want to disable or change the ctrl-h mapping, this is the piece of kickstart init.lua that you need to change:

diff --git a/init.lua b/init.lua
index db55a9e..5e617c1 100644
--- a/init.lua
+++ b/init.lua
@@ -711,11 +711,11 @@ require('lazy').setup({
               luasnip.expand_or_jump()
             end
           end, { 'i', 's' }),
-          ['<C-h>'] = cmp.mapping(function()
-            if luasnip.locally_jumpable(-1) then
-              luasnip.jump(-1)
-            end
-          end, { 'i', 's' }),
+          -- ['<C-h>'] = cmp.mapping(function()
+          --   if luasnip.locally_jumpable(-1) then
+          --     luasnip.jump(-1)
+          --   end
+          -- end, { 'i', 's' }),
 
           -- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see:
           --    https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps

dam9000 avatar Mar 28 '24 08:03 dam9000

Hi again, sorry for late response. But i managed to fix it (unless i have broken something) by simply commenting it out:

          . . . 
          -- ['<BS>'] = cmp.mapping(function()
          --   if luasnip.locally_jumpable(-1) then
          --     luasnip.jump(-1)
          --   end
          -- end, { 'i', 's' }),
          . . . 

I could've also remapped it to something else, other than the default value (e.g., <BS>), and that'd presumably have still worked.

Mosazghi avatar Mar 28 '24 19:03 Mosazghi

Lots of good fixes and work arounds here but in the end analysis this isn't a kickstart bug. Closing.

feoh avatar Apr 04 '24 16:04 feoh