Kakoune: how do I set tab-width?

Created on 24 Sep 2017  路  3Comments  路  Source: mawww/kakoune

I edited this file to set the tabwidth to a width of 2: $MY_KAK_DIR/share/kak/rc/extra/editorconfig.kak but when I insert a new tab, I get 4 spaces. How do I set my tab-width (indentwidth, tabstop) to 2 universally on my system?

Most helpful comment

The editorconfig.kak file is a script that teaches Kakoune to understand EditorConfig files in the current directory, it's not the actual configuration of Kakoune.

If you want Kakoune to use two-space indents all the time, put something like the following into ~/.config/kak/kakrc:

hook global InsertChar \t %{ exec -draft -itersel h@ }                      
set global tabstop 4                                                        
set global indentwidth 4

(the "hook" line makes Kakoune expand tabs as you type them)

See Indentation & Tabulation in the wiki for more details.

All 3 comments

The editorconfig.kak file is a script that teaches Kakoune to understand EditorConfig files in the current directory, it's not the actual configuration of Kakoune.

If you want Kakoune to use two-space indents all the time, put something like the following into ~/.config/kak/kakrc:

hook global InsertChar \t %{ exec -draft -itersel h@ }                      
set global tabstop 4                                                        
set global indentwidth 4

(the "hook" line makes Kakoune expand tabs as you type them)

See Indentation & Tabulation in the wiki for more details.

Great, this works.

Seems like the up to date wiki page is: https://github.com/mawww/kakoune/wiki/Indentation-and-Tabulation ("and" rather than "&")

Was this page helpful?
0 / 5 - 0 ratings

Related issues

radare picture radare  路  3Comments

hwmack picture hwmack  路  4Comments

Parasrah picture Parasrah  路  4Comments

dpc picture dpc  路  4Comments

notramo picture notramo  路  3Comments