How do I disable auto-indent on Kakoune?

1.7k views Asked by At

I don't like text editors that perform auto-indentation in my code, because of various reasons, but Kakoune seems to be hardcoded to do that? Is it possible to disable it?

I couldn't find any defined "hooks" for indent, just for autocomplete.

2

There are 2 answers

0
fiatjaf On BEST ANSWER

Just run :set global disabled_hooks .*-indent in your Kakoune window or put

set global disabled_hooks .*-indent

in your kakrc.

Found the answer at https://github.com/mawww/kakoune/wiki/How-To#disable-auto-indentation, although it wasn't immediately clear what "disabled_hooks option" meant.

1
Sebastian Graf On

It's not strictly an answer to your question, but I sometimes need to paste text into kakoune over an SSH session from Windows. In vim, I could do :set paste/:set nopaste.

In kakoune, I found I can enter insert mode with disabled hooks (see "Disabling Hooks" in https://discuss.kakoune.com/t/hooks/544) by typing in a \ first, e.g. \i. Then I paste the text without indentation fuss and can leave insert mode again. Neat!