diff --git a/app-editors/kakoune/kakoune-2021.11.08.recipe b/app-editors/kakoune/kakoune-2021.11.08.recipe
new file mode 100644
index 000000000..7dc03fd5a
--- /dev/null
+++ b/app-editors/kakoune/kakoune-2021.11.08.recipe
@@ -0,0 +1,61 @@
+SUMMARY="Modal code editor with a focus on interactivity"
+DESCRIPTION="Kakoune is a code editor that implements Vi's \"keystrokes as a text \
+editing language\" model. As it's also a modal editor, it is somewhat \
+similar to the Vim editor (after which Kakoune was originally inspired).
+
+Kakoune has a strong focus on interactivity, most commands provide \
+immediate and incremental results, while still being competitive (as \
+in keystroke count) with Vim.
+
+Kakoune works on selections, which are oriented, inclusive range of \
+characters, selections have an anchor and a cursor character. Most \
+commands move both of them, except when extending selection where the \
+anchor character stays fixed and the cursor one moves around."
+HOMEPAGE="https://kakoune.org/"
+COPYRIGHT="Public Domain"
+LICENSE="Unlicense"
+REVISION="1"
+SOURCE_URI="https://github.com/mawww/kakoune/releases/download/v$portVersion/kakoune-$portVersion.tar.bz2"
+CHECKSUM_SHA256="aa30889d9da11331a243a8f40fe4f6a8619321b19217debac8f565e06eddb5f4"
+PATCHES="kakoune-$portVersion.patchset"
+
+ARCHITECTURES="all !x86_gcc2"
+SECONDARY_ARCHITECTURES="x86"
+
+commandSuffix=$secondaryArchSuffix
+commandBinDir=$binDir
+if [ "$targetArchitecture" = x86_gcc2 ]; then
+ commandSuffix=
+ commandBinDir=$prefix/bin
+fi
+
+PROVIDES="
+ kakoune$secondaryArchSuffix
+ cmd:kak$commandSuffix
+ "
+REQUIRES="
+ haiku$secondaryArchSuffix
+ "
+
+BUILD_REQUIRES="
+ haiku${secondaryArchSuffix}_devel
+ "
+BUILD_PREREQUIRES="
+ cmd:cmp
+ cmd:find
+ cmd:gcc$secondaryArchSuffix
+ cmd:install
+ cmd:ld$secondaryArchSuffix
+ cmd:make
+ "
+
+BUILD()
+{
+ make $jobArgs
+}
+
+INSTALL()
+{
+ make bindir="$commandBinDir" docdir="$docDir" libexecdir="$libExecDir" \
+ mandir="$manDir/man1" sharedir="$dataDir/kak" install
+}
diff --git a/app-editors/kakoune/licenses/Unlicense b/app-editors/kakoune/licenses/Unlicense
new file mode 100644
index 000000000..efb980881
--- /dev/null
+++ b/app-editors/kakoune/licenses/Unlicense
@@ -0,0 +1,24 @@
+This is free and unencumbered software released into the public domain.
+
+Anyone is free to copy, modify, publish, use, compile, sell, or
+distribute this software, either in source code form or as a compiled
+binary, for any purpose, commercial or non-commercial, and by any
+means.
+
+In jurisdictions that recognize copyright laws, the author or authors
+of this software dedicate any and all copyright interest in the
+software to the public domain. We make this dedication for the benefit
+of the public at large and to the detriment of our heirs and
+successors. We intend this dedication to be an overt act of
+relinquishment in perpetuity of all present and future rights to this
+software under copyright law.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+For more information, please refer to
diff --git a/app-editors/kakoune/patches/kakoune-2021.11.08.patchset b/app-editors/kakoune/patches/kakoune-2021.11.08.patchset
new file mode 100644
index 000000000..7eda8a776
--- /dev/null
+++ b/app-editors/kakoune/patches/kakoune-2021.11.08.patchset
@@ -0,0 +1,57 @@
+From bffa49d630c70d004d4f205c94b0aca544f9e2fe Mon Sep 17 00:00:00 2001
+From: Tobias Kortkamp
+Date: Wed, 29 Dec 2021 15:57:52 +0000
+Subject: [PATCH] haiku: use BPathFinder to find runtime and settings dirs
+
+---
+ src/main.cc | 20 ++++++++++++++++++++
+ 1 file changed, 20 insertions(+)
+
+diff --git a/src/main.cc b/src/main.cc
+index 6da6e64..30760ee 100644
+--- a/src/main.cc
++++ b/src/main.cc
+@@ -35,6 +35,11 @@
+ #include
+ #include
+
++#ifdef __HAIKU__
++#include
++#include
++#endif
++
+ namespace Kakoune
+ {
+
+@@ -170,6 +175,13 @@ String runtime_directory()
+ if (stat(relpath, &st) == 0 and S_ISDIR(st.st_mode))
+ return real_path(relpath);
+
++#ifdef __HAIKU__
++ BPath path;
++ BPathFinder pathFinder;
++ if (pathFinder.FindPath(B_FIND_PATH_DATA_DIRECTORY, "kak", B_FIND_PATH_EXISTING_ONLY, path) == B_OK)
++ return path.Path();
++#endif
++
+ return "/usr/share/kak";
+ }
+
+@@ -177,6 +189,14 @@ String config_directory()
+ {
+ if (StringView kak_cfg_dir = getenv("KAKOUNE_CONFIG_DIR"); not kak_cfg_dir.empty())
+ return kak_cfg_dir.str();
++
++#ifdef __HAIKU__
++ BPath path;
++ BPathFinder pathFinder;
++ if (pathFinder.FindPath(B_FIND_PATH_SETTINGS_DIRECTORY, "kak", B_FIND_PATH_EXISTING_ONLY, path) == B_OK)
++ return path.Path();
++#endif
++
+ if (StringView xdg_cfg_home = getenv("XDG_CONFIG_HOME"); not xdg_cfg_home.empty())
+ return format("{}/kak", xdg_cfg_home);
+ return format("{}/.config/kak", homedir());
+--
+2.30.2
+