From fa72d27f9a78d6af8052523d9166a31000d4cba8 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 23 Dec 2013 21:26:07 +0000 Subject: [PATCH] Make kak more installable * Kak relies on the kakrc file to be in ../share/kak/kakrc relative to kak binary rather than in the same directory * Added an install target to the Makefile --- {src/rc => rc}/asciidoc.kak | 0 {src/rc => rc}/clang.kak | 0 {src/rc => rc}/client.kak | 0 {src/rc => rc}/cpp.kak | 6 ++++-- {src/rc => rc}/ctags.kak | 0 {src/rc => rc}/diff.kak | 0 {src/rc => rc}/git-tools.kak | 0 {src/rc => rc}/git.kak | 0 {src/rc => rc}/global.kak | 0 {src/rc => rc}/grep.kak | 0 {src/rc => rc}/kakrc.kak | 1 + {src/rc => rc}/mail.kak | 0 {src/rc => rc}/make.kak | 0 {src/rc => rc}/man.kak | 0 {src/rc => rc}/mime.kak | 0 {src/rc => rc}/sh.kak | 0 {src => share/kak}/kakrc | 0 src/Makefile | 21 +++++++++++++++++++-- src/main.cc | 2 +- 19 files changed, 25 insertions(+), 5 deletions(-) rename {src/rc => rc}/asciidoc.kak (100%) rename {src/rc => rc}/clang.kak (100%) rename {src/rc => rc}/client.kak (100%) rename {src/rc => rc}/cpp.kak (92%) rename {src/rc => rc}/ctags.kak (100%) rename {src/rc => rc}/diff.kak (100%) rename {src/rc => rc}/git-tools.kak (100%) rename {src/rc => rc}/git.kak (100%) rename {src/rc => rc}/global.kak (100%) rename {src/rc => rc}/grep.kak (100%) rename {src/rc => rc}/kakrc.kak (94%) rename {src/rc => rc}/mail.kak (100%) rename {src/rc => rc}/make.kak (100%) rename {src/rc => rc}/man.kak (100%) rename {src/rc => rc}/mime.kak (100%) rename {src/rc => rc}/sh.kak (100%) rename {src => share/kak}/kakrc (100%) diff --git a/src/rc/asciidoc.kak b/rc/asciidoc.kak similarity index 100% rename from src/rc/asciidoc.kak rename to rc/asciidoc.kak diff --git a/src/rc/clang.kak b/rc/clang.kak similarity index 100% rename from src/rc/clang.kak rename to rc/clang.kak diff --git a/src/rc/client.kak b/rc/client.kak similarity index 100% rename from src/rc/client.kak rename to rc/client.kak diff --git a/src/rc/cpp.kak b/rc/cpp.kak similarity index 92% rename from src/rc/cpp.kak rename to rc/cpp.kak index 2b98af9a..bc06fc89 100644 --- a/src/rc/cpp.kak +++ b/rc/cpp.kak @@ -16,6 +16,8 @@ def -hidden _cpp_indent_on_new_line %~ try %{ exec -draft k s \h+$ d } # align to opening paren of previous line try %{ exec -draft [( \`\([^\n]+\n[^\n]*\n?\' s \`\(\h*.|.\' & } + # align to previous statement start when previous line closed a parenthesis + # try %{ exec -draft \)M\`\(.*\)[^\n()]*\n\h*\n?\'s\`|.\'1 } # copy // comments prefix try %{ exec -draft k s ^\h*\K(/{2,}) yP } # indent after visibility specifier @@ -31,8 +33,8 @@ def -hidden _cpp_indent_on_opening_curly_brace %[ ] def -hidden _cpp_indent_on_closing_curly_brace %[ - # deindent on insert } alone on a line - try %[ exec -draft ^\h+\}$ < ] + # align to opening curly brace when alone on a line + try %[ exec -itersel -draft ^\h+\}$hms\`|.\'1 ] # add ; after } if class or struct definition try %[ exec -draft "hm(class|struct)\`(class|struct)[^{}\n]+(\n)?\s*\{\'ma;" ] ] diff --git a/src/rc/ctags.kak b/rc/ctags.kak similarity index 100% rename from src/rc/ctags.kak rename to rc/ctags.kak diff --git a/src/rc/diff.kak b/rc/diff.kak similarity index 100% rename from src/rc/diff.kak rename to rc/diff.kak diff --git a/src/rc/git-tools.kak b/rc/git-tools.kak similarity index 100% rename from src/rc/git-tools.kak rename to rc/git-tools.kak diff --git a/src/rc/git.kak b/rc/git.kak similarity index 100% rename from src/rc/git.kak rename to rc/git.kak diff --git a/src/rc/global.kak b/rc/global.kak similarity index 100% rename from src/rc/global.kak rename to rc/global.kak diff --git a/src/rc/grep.kak b/rc/grep.kak similarity index 100% rename from src/rc/grep.kak rename to rc/grep.kak diff --git a/src/rc/kakrc.kak b/rc/kakrc.kak similarity index 94% rename from src/rc/kakrc.kak rename to rc/kakrc.kak index 9d1026b1..3cb4056d 100644 --- a/src/rc/kakrc.kak +++ b/rc/kakrc.kak @@ -10,6 +10,7 @@ addhl -def-group kakrc regex (?<=\