Automatic handling different styles of indentation and alignment
Switch branches/tags
Nothing to show
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.



smarttab.kak is a plugin for Kakoune editor. It provides three different ways of handling indentation and alignment with tab key.


With plug.kak (recommended)

Add this to your kakrc:

plug "andreyorst/smarttab.kak"

Source your kakrc or restart Kakoune, and execute :plug-install. Or if you don't want to source configuration file or restart Kakoune, simply run plug-install andreyorst/smarttab.kak. It will be enabled automatically.

Without plugin manager

Clone this repo somewhere

git clone

And source the smarttab.kak script from it.

After that you can use smarttab.kak.


This plugin adds these three commands to toggle different policy when using Tab and > keys:

  • noexpandtab - use tab for everything.
    Tab will insert \t character, and > will use \t character when indenting.
    Aligning cursors with & uses \t character.
  • expandtab - use space for everything.
    Tab will insert %opt{tabstop} amount of spaces, and > will indent with spaces.
  • smarttab - indent with tab, align with space.
    Tab will insert \t character if your cursor is inside indentation area, e.g. before any
    non-whitespace character, and insert spaces if cursor is after any non-whitespace character. Aligning
    cursors with & uses space.

By default smarttab.kak affects only Tab and > keys. If you want to deindent lines that are being indented with the spaces by hitting Backspace, you can set softtabstop option. This option describes how many spaces should be treated as single tab character when deleting spaces with backspace.

If you've used plug.kak for installation, you can set it within the plug command:

plug "andreyorst/smarttab.kak" %{
    set-option global softtabstop 4 # or other preferred value