diff options
Diffstat (limited to '')
| -rw-r--r-- | autoload/lsp-config.kak | 11 | ||||
| -rw-r--r-- | autoload/refactor/javascript.kak | 1 | ||||
| -rw-r--r-- | autoload/repl.kak | 22 | ||||
| -rw-r--r-- | autoload/window.kak | 1 |
4 files changed, 31 insertions, 4 deletions
diff --git a/autoload/lsp-config.kak b/autoload/lsp-config.kak index 2851011..888085a 100644 --- a/autoload/lsp-config.kak +++ b/autoload/lsp-config.kak @@ -87,6 +87,17 @@ hook -group lsp-filetype-haskell global BufSetOption filetype=haskell %{ } } +hook global BufCreate .*[.]ua %{ set-option buffer filetype uiua } +hook global BufSetOption filetype=uiua %{ + set-option buffer lsp_servers %{ + [uiua] + args = [ "lsp" ] + root_globs = [ "main.ua", ".fmt.ua", ".git" ] + } + # Auto-formatter for uiua (TODO: Move to formatter.kak) + hook buffer BufWritePre .* %{ lsp-formatting-sync } +} + hook global WinSetOption filetype=.* %{ hook window -group semantic-tokens BufReload .* lsp-semantic-tokens hook window -group semantic-tokens NormalIdle .* lsp-semantic-tokens diff --git a/autoload/refactor/javascript.kak b/autoload/refactor/javascript.kak index 51797de..514b883 100644 --- a/autoload/refactor/javascript.kak +++ b/autoload/refactor/javascript.kak @@ -2,6 +2,7 @@ hook global BufSetOption filetype=(?:javascript|typescript|jsx|tsx) %{ map global refactor o ': js-test-toggle-it-state<ret>' -docstring 'Toggle it/it.only' } +# TODO: Doesnt work right. Switch to treesitter code mods define-command js-test-toggle-it-state %{ try %{ execute-keys 'Z<a-;><a-i>imxsit\(<ret>cit.only(<esc>z' diff --git a/autoload/repl.kak b/autoload/repl.kak index 10c2367..910815a 100644 --- a/autoload/repl.kak +++ b/autoload/repl.kak @@ -14,6 +14,8 @@ declare-option bool xrepl_running false; declare-option str xrepl_current_name; declare-option str xrepl_current_cmd; declare-option str xrepl_current_transform; +declare-option str xrepl_current_split_size; +declare-option bool xrepl_current_split_vertical false; declare-option bool xrepl_current_clear_screen false; # TODO: Use register set to selection (paragraph) instead of selection @@ -24,17 +26,17 @@ declare-option bool xrepl_current_clear_screen false; declare-user-mode repl-mode-select define-command define-repl-mode -params 4 %{ - # TODO: USe a hidden command and use for keymap + # TODO: Use a hidden command and use for keymap map %arg{1} repl-mode-select %arg{2} -docstring %arg{3} %sh{ kak_escape() { printf "'"; printf '%s' "$1" | sed "s/'/''/g"; printf "'"; } printf ": xrepl-quit<ret>" printf ": set global xrepl_current_name '$3'<ret>" printf ": set global xrepl_current_cmd \"\$SHELL\"<ret>" printf ": set global xrepl_current_transform \"\"<ret>" + printf ": set global xrepl_current_split_size 45%%<ret>" + printf ": set global xrepl_current_split_vertical false<ret>" printf ": set global xrepl_current_clear_screen false<ret>" printf ": evaluate-commands $(kak_escape "$(echo "$4" | tr '\n' ';')")<ret>" - # echo "$4" >> foobarity - # echo "$(kak_escape "$(echo "$4" | tr '\n' ';')")" >> foobarity printf ": xrepl-begin<ret>" } } @@ -66,7 +68,18 @@ hook global BufSetOption filetype=ruby %{ } } +hook global BufSetOption filetype=clojure %{ + # TODO: Just temporary for messing around. Remove module name + map buffer repl r ': repl-send-text %{(require ''[pluribus.core :as p] :reload)}; xrepl-send-keys Enter<ret>' -docstring 'Cljs reload' + define-repl-mode buffer j 'Clojurescript repl' %{ + set global xrepl_current_cmd 'clj -M -m cljs.main --repl-opts "{:launch-browser false}" --compile pluribus.core --repl' + set global xrepl_current_split_size 30%% + set global xrepl_current_split_vertical true + } +} + hook global BufSetOption filetype=(?:javascript|typescript|jsx|tsx) %{ + # TODO: Search for root cypress config file and cd into it define-repl-mode buffer c 'Cypress' %{ set global xrepl_current_cmd '$SHELL' set global xrepl_current_transform 'cat > /dev/null @@ -128,7 +141,8 @@ define-command xrepl-begin %{ if [ -z "$init_cmd" ]; then init_cmd="$SHELL"; fi echo "info %opt{xrepl_current_name}" echo "set-option global xrepl_running true" - echo "repl-new -l 45% $init_cmd" + cmd=$([ "$kak_opt_xrepl_current_split_vertical" == "true" ] && echo "tmux-repl-vertical" || echo "tmux-repl-horizontal") + echo "$cmd -l $kak_opt_xrepl_current_split_size $init_cmd" echo "nop %sh{ tmux last-pane }" fi } diff --git a/autoload/window.kak b/autoload/window.kak index b3b9371..96372be 100644 --- a/autoload/window.kak +++ b/autoload/window.kak @@ -6,6 +6,7 @@ map global win <c-q> ': quit<ret>' -docstring 'Quit' map global win s ': tmux-terminal-horizontal kak -c %val{session}<ret>' -docstring 'Split vertical' map global win v ': tmux-terminal-vertical kak -c %val{session}<ret>' -docstring 'Split horizontal' map global win z ': wq<ret>' +map global win t ': toolsclient<ret>' def toolsclient %{ rename-client main |
