Use c-indent-command in insert-state in C-mode

What happened?

When in insert mode in C-mode, is bound to (completion-at-point). I don’t want to start completion with tab, I just want to indent the line, exactly like pressing tab in normal-state does.

Steps to reproduce

  1. start c-mode
  2. press e.g. i to enter insert-state
  3. press C-h k to display what function in bound to the tab key

System information

Loading data dump...


I tried binding c-indent-command to Tab, using this:

(add-hook 'c-mode-common-hook
          (lambda ()
            (map! :map c-mode-base-map
                  "TAB" nil
                  "<tab>" nil
                  "TAB" #'c-indent-command
                  "<tab>" #'c-indent-command

Also I tried setting

(setq tab-always-indent t)
(setq c-tab-always-indent t)

Edit: I found the culprit, it's the new corfu-mode. If I disable to mode, it does indent in insert mode with TAB like it should. But how to I set that while corfu-mode is enabled?

I haven't set up anything in my config for the corfu module. In my init.el I just enabled (corfu +icons +orderless) and disabled company.

Is this a bug?

I opened an issue because of that as it is indeed a bug. Corfu: When in prog-mode indenting with tab does not work · Issue #7767 · doomemacs/doomemacs · GitHub Seems like there is already a PR for this to fix it.