From 1aa539001e0daceafe924c75821c0542b6e322bf Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sat, 6 Jun 2026 00:21:24 +0530 Subject: Switch makecmd to be global + disable treesitter --- autoload/+init.kak | 11 +++-------- autoload/build.kak | 12 ++++-------- autoload/plugins | 2 +- autoload/snippets/nix.kak | 26 ++++++++++++++++++++++++++ autoload/standard-library | 2 +- 5 files changed, 35 insertions(+), 18 deletions(-) create mode 100644 autoload/snippets/nix.kak diff --git a/autoload/+init.kak b/autoload/+init.kak index 6f5f607..7f0f2f8 100644 --- a/autoload/+init.kak +++ b/autoload/+init.kak @@ -9,15 +9,10 @@ nop %sh{ # Disable indent trimming set-option global disabled_hooks .*-trim-indent -eval %sh{kak-tree-sitter -dksvv --init "${kak_session}" --with-highlighting --with-text-objects} +# Disabled treesitter because eh +# eval %sh{kak-tree-sitter -dksvv --init "${kak_session}" --with-highlighting --with-text-objects} eval %sh{kcr init kakoune} -# hook global BufCreate .*[.]tsx %{ -# set-option buffer filetype tsx -# set-option buffer tree_sitter_lang tsx -# set-option buffer lsp_language_id typescriptreact -# } - colorscheme phenax set-option global autoreload yes set-option global incsearch true @@ -87,7 +82,7 @@ map global system o ':info %opt{}' -docstring 'Print opt' map global system v ':info %val{}' -docstring 'Print value' map global system d ': buffer *debug*' -docstring 'Switch to debug buffer' map global system f ':set buffer filetype ' -docstring 'Set filetype' -map global system M ':set buffer makecmd ""' -docstring 'Set compile command' +map global system M ':set global makecmd ""' -docstring 'Set global compile command' map global system m ': make' -docstring 'Compile' map global system p ': info %sh{ realpath -s --relative-to="$PWD" "$kak_buffile" }' -docstring 'Print relative file path' map global system P ': info %val{buffile}' -docstring 'Print absolute file path' diff --git a/autoload/build.kak b/autoload/build.kak index 903ce47..d8a676c 100644 --- a/autoload/build.kak +++ b/autoload/build.kak @@ -1,14 +1,10 @@ set-option global makecmd 'echo "Build command not set"; exit 1' -# TODO: For some reason doesnt jump to error -hook global BufSetOption filetype=(?:typescript|javascript|jsx|tsx) %{ - set-option buffer makecmd "%val{config}/scripts/tsc-vimgrep.sh" -} - -hook global BufSetOption filetype=haskell %{ set-option buffer makecmd "cabal build" } - -hook global BufSetOption filetype=rust %{ set-option buffer makecmd "cargo build" } +define-command makecmd-set-tsc %{ set-option buffer makecmd "%val{config}/scripts/tsc-vimgrep.sh" } +define-command makecmd-set-cabal %{ set-option buffer makecmd "cabal build" } +define-command makecmd-set-cargo %{ set-option buffer makecmd "cargo build" } +# Overriding the make command provide-module make-override %{ define-command -params .. -override -docstring %{ make []: make utility wrapper diff --git a/autoload/plugins b/autoload/plugins index b98db44..9f85c06 120000 --- a/autoload/plugins +++ b/autoload/plugins @@ -1 +1 @@ -/nix/store/fp4j8a28ynxjbhl2pjvyxkh6c48c81bq-kakoune-2025.06.03/share/kak/autoload/plugins \ No newline at end of file +/nix/store/v9k0893wwnagjmj0hn9rs5r57v14p7d8-kakoune-2026.04.12/share/kak/autoload/plugins \ No newline at end of file diff --git a/autoload/snippets/nix.kak b/autoload/snippets/nix.kak new file mode 100644 index 0000000..84c637d --- /dev/null +++ b/autoload/snippets/nix.kak @@ -0,0 +1,26 @@ +hook global BufSetOption filetype=(?:nix) %{ + define-snippet buffer snip-flake-mkderivation + define-snippet buffer snip-flake-mkshell +} + +define-command snip-flake-mkderivation %{ + prompt 'pname: ' %{ + set-register c %val{text} + execute-keys ',istdenv.mkDerivation {' + execute-keys ' pname = "c";' + execute-keys ' version = "0.0.0";' + execute-keys ' src = fetchGithub {' + execute-keys ' owner = "owner";' + execute-keys ' repo = "repo";' + execute-keys ' rev = "master";' + execute-keys ' hash = lib.fakeHash;' + execute-keys ' };' + execute-keys '}' + } +} + +define-command snip-flake-mkshell %{ + execute-keys ',ipkgs.mkShell {' + execute-keys ' buildInputs = with pkgs; [];' + execute-keys '}' +} diff --git a/autoload/standard-library b/autoload/standard-library index f3c10ee..d72ca43 120000 --- a/autoload/standard-library +++ b/autoload/standard-library @@ -1 +1 @@ -/nix/store/fp4j8a28ynxjbhl2pjvyxkh6c48c81bq-kakoune-2025.06.03/share/kak/rc \ No newline at end of file +/nix/store/v9k0893wwnagjmj0hn9rs5r57v14p7d8-kakoune-2026.04.12/share/kak/rc \ No newline at end of file -- cgit v1.3.1