1

When pressing tab in any language in edit mode, nothing happens if the character before the cursor is not a space or a tab. Doing ctrl-v tab works, but I don't want to have to do that every time and presumably it would cause some problems if I rebind tab to that.

When doing nvim --clean, I have no problems, but before I uninstall every plugin and start from the top, does anyone know which plugin or piece of config may be causing this?

Config:

https://github.com/pseud0n/nixos-config/blob/main/home-manager/home.nix#L205

https://github.com/pseud0n/nixos-config/blob/main/home-manager/config/nvim/init.vim

Doot
  • 151
  • 7

1 Answers1

1

From https://github.com/neoclide/coc.nvim/wiki/Completion-with-sources#improve & https://bleepcoder.com/coc-nvim/421789422/issue-on-pressing-tab-at-the-end-of-a-word, a better version without this problem:

inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"

function! s:check_back_space() abort let col = col('.') - 1 return !col || getline('.')[col - 1] =~# '\s' endfunction

Doot
  • 151
  • 7