diff options
| author | Mike Vink <mike.vink@stater.nl> | 2023-05-17 19:12:34 +0000 |
|---|---|---|
| committer | Mike Vink <mike.vink@stater.nl> | 2023-05-17 19:12:34 +0000 |
| commit | b25d7dbbbe17d640cb472e569cc8e9dd6d4cf66c (patch) | |
| tree | 38c2cb694544d23ca882f3ef633df8622fb100a3 | |
| parent | 8fd8826af43842c1ec4e5a3a6046dad41d93257d (diff) | |
update kakoune.nix
| -rw-r--r-- | home.nix | 3 | ||||
| -rw-r--r-- | home/kakoune.nix | 98 | ||||
| -rw-r--r-- | home/packages.nix | 3 | ||||
| -rwxr-xr-x | shell-scripts/terragrunt | 2 |
4 files changed, 105 insertions, 1 deletions
@@ -48,6 +48,9 @@ enable = true; extraConfig = '' set-option -g default-shell ${pkgs.bashInteractive}/bin/bash + set -s set-clipboard on + set -g default-terminal "tmux-256color" + set-option -sa terminal-overrides ",xterm-256color:RGB" set-option -g focus-events on set-option -sg escape-time 10 ''; diff --git a/home/kakoune.nix b/home/kakoune.nix index 5870388..6e81cf4 100644 --- a/home/kakoune.nix +++ b/home/kakoune.nix @@ -7,5 +7,103 @@ }: { programs.kakoune = { enable = true; + + config = { + autoReload = "yes"; + numberLines = { + enable = true; + relative = true; + }; + }; + extraConfig = '' + def ide %{ + rename-client main + set global jumpclient main + + new rename-client tools + set global toolsclient tools + + new rename-client docs + set global docsclient docs + } + # Source a local project kak config if it exists + # Make sure it is set as a kak filetype + hook global BufCreate (.*/)?(\.kakrc\.local) %{ + set-option buffer filetype kak + } + try %{ source .kakrc.local } + + eval %sh{kak-lsp --kakoune -s $kak_session} # Not needed if you load it with plug.kak. + hook global WinSetOption filetype=(rust|python|go|javascript|typescript|c|cpp) %{ + lsp-enable-window + lsp-auto-signature-help-enable + hook window -group semantic-tokens BufReload .* lsp-semantic-tokens + hook window -group semantic-tokens NormalIdle .* lsp-semantic-tokens + hook window -group semantic-tokens InsertIdle .* lsp-semantic-tokens + hook -once -always window WinSetOption filetype=.* %{ + remove-hooks window semantic-tokens + } + } + + map global user l %{:enter-user-mode lsp<ret>} -docstring "LSP mode" + map global insert <tab> '<a-;>:try lsp-snippets-select-next-placeholders catch %{ execute-keys -with-hooks <lt>tab> }<ret>' -docstring 'Select next snippet placeholder' + map global object a '<a-semicolon>lsp-object<ret>' -docstring 'LSP any symbol' + map global object <a-a> '<a-semicolon>lsp-object<ret>' -docstring 'LSP any symbol' + map global object e '<a-semicolon>lsp-object Function Method<ret>' -docstring 'LSP function or method' + map global object k '<a-semicolon>lsp-object Class Interface Struct<ret>' -docstring 'LSP class interface or struct' + map global object d '<a-semicolon>lsp-diagnostic-object --include-warnings<ret>' -docstring 'LSP errors and warnings' + map global object D '<a-semicolon>lsp-diagnostic-object<ret>' -docstring 'LSP errors' + + # Token Meaning + # {last} ! The last (previously active) pane + # {next} + The next pane by number + # {previous} - The previous pane by number + # {top} The top pane + # {bottom} The bottom pane + # {left} The leftmost pane + # {right} The rightmost pane + # {top-left} The top-left pane + # {top-right} The top-right pane + # {bottom-left} The bottom-left pane + # {bottom-right} The bottom-right pane + # {up-of} The pane above the active pane + # {down-of} The pane below the active pane + # {left-of} The pane to the left of the active pane + # {right-of} The pane to the right of the active pane + + map global user q ':new <ret>' -docstring "Open quickfix window" + define-command -override -hidden -params 1.. split-impl %{ + echo %sh{ + tmux=$${kak_client_env_TMUX:-$TMUX} + if [ -z "$tmux" ]; then + echo "fail 'This command is only available in a tmux session'" + exit + fi + TMUX=$tmux tmux select-pane -t "$1" # < /dev/null > /dev/null 2>&1 & + } + } + + map global normal <c-w> %{:enter-user-mode split<ret>} -docstring "Navigate splits" + map global split j %{:split-impl '{down-of}'<ret>} -docstring "Down" + map global split k %{:split-impl '{up-of}'<ret>} -docstring "Down" + map global split h %{:split-impl '{left-of}'<ret>} -docstring "Down" + map global split l %{:split-impl '{right-of}'<ret>} -docstring "Down" + + define-command -override -params 0.. split %{ + echo %sh{ + tmux=$${kak_client_env_TMUX:-$TMUX} + if [ -z "$tmux" ]; then + echo "fail 'This command is only available in a tmux session'" + exit + fi + TMUX=$tmux tmux split-window -t "$${kak_client_env_TMUX_PANE}" kak "$${kak_buffile}" # < /dev/null > /dev/null 2>&1 & + } + } + alias global sp split + ''; + + plugins = with pkgs.kakounePlugins; [ + kak-lsp + ]; }; } diff --git a/home/packages.nix b/home/packages.nix index 912ab9f..436120e 100644 --- a/home/packages.nix +++ b/home/packages.nix @@ -25,6 +25,9 @@ htop subversion ripgrep + gnused + gnugrep + curl inotify-tools fzf github-cli diff --git a/shell-scripts/terragrunt b/shell-scripts/terragrunt index f7ffe70..10d2160 100755 --- a/shell-scripts/terragrunt +++ b/shell-scripts/terragrunt @@ -1,4 +1,4 @@ -#!/bin/bash +#!@bash@/bin/bash TERRAGRUNT_ARGS=() CONTEXT="" ENV="" |
