From c8e2bc3a5564774dade5e4fe168dca886e72cec6 Mon Sep 17 00:00:00 2001 From: Brian Hicks Date: Tue, 21 Jan 2020 16:27:58 -0600 Subject: [PATCH] use smarttab.kak for better tabbing --- dotfiles/kakoune.nix | 28 ++++++++++++++++++++-------- nix/sources.json | 13 +++++++++++++ 2 files changed, 33 insertions(+), 8 deletions(-) diff --git a/dotfiles/kakoune.nix b/dotfiles/kakoune.nix index 704cc08..1fdbef3 100644 --- a/dotfiles/kakoune.nix +++ b/dotfiles/kakoune.nix @@ -99,7 +99,6 @@ in { { commands = '' set-option buffer formatcmd nixfmt - set-option buffer indentwidth 2 ''; name = "WinCreate"; option = ".*.nix"; @@ -110,13 +109,6 @@ in { option = ".*.nix"; } - # Ruby - { - commands = "set-option buffer indentwidth 2"; - name = "WinCreate"; - option = ".*.rb"; - } - # Elm { name = "WinCreate"; @@ -134,6 +126,26 @@ in { name = "BufWritePre"; option = ".*.elm"; } + + # Indents + { + name = "WinCreate"; + option = ".*.(nix|rb)"; + commands = '' + expandtab + set-option buffer tabstop 2 + set-option buffer softtabstop 2 + ''; + } + { + name = "WinCreate"; + option = ".*.elm"; + commands = '' + expandtab + set-option buffer tabstop 4 + set-option buffer softtabstop 4 + ''; + } ]; keyMappings = [ diff --git a/nix/sources.json b/nix/sources.json index e1aa907..d9d67cd 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -345,6 +345,19 @@ "url": "https://github.com/whereswaldon/shellcheck.kak/archive/9acad49508ee95c215541e58353335d9d5b8a927.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, + "smarttab.kak": { + "branch": "master", + "description": "Automatic handling different styles of indentation and alignment. Mirror of https://gitlab.com/andreyorst/smarttab.kak", + "homepage": "", + "kakoune": "plugin", + "owner": "andreyorst", + "repo": "smarttab.kak", + "rev": "1321c308edac6bd892e2bd2f683432402a04be98", + "sha256": "048qq8aj405q3zm28jjh6ardxb8ixkq6gs1h3bwdv2qc4zi2nj4g", + "type": "tarball", + "url": "https://github.com/andreyorst/smarttab.kak/archive/1321c308edac6bd892e2bd2f683432402a04be98.tar.gz", + "url_template": "https://github.com///archive/.tar.gz" + }, "tabular": { "branch": "master", "description": "TODO",