From 74d4dd79e50d816f87d4f7127b978d5f1467e1e6 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Tue, 28 Oct 2025 00:51:10 +0530 Subject: Fix editor for daffm and gitu --- autoload/cursor.kak | 8 ++++---- autoload/files.kak | 2 +- autoload/git.kak | 6 +++++- autoload/window.kak | 6 ------ 4 files changed, 10 insertions(+), 12 deletions(-) (limited to 'autoload') diff --git a/autoload/cursor.kak b/autoload/cursor.kak index d3abd3b..a37bb00 100644 --- a/autoload/cursor.kak +++ b/autoload/cursor.kak @@ -1,14 +1,14 @@ # declare-option -hidden regex curword -# Highlight word under cursor +# # Highlight word under cursor # add-highlighter global/ dynregex '%opt{curword}' 0:CurWord # hook global NormalIdle .* %{ -# eval -draft %{try %{ -# exec w \A\w+\z +# eval -draft %{ try %{ +# exec w\A\w+\z # set-option buffer curword "\b\Q%val{selection}\E\b" # } catch %{ # set-option buffer curword '' -# }} +# } } # } # Change cursor face based on mode diff --git a/autoload/files.kak b/autoload/files.kak index 001ef07..4598569 100644 --- a/autoload/files.kak +++ b/autoload/files.kak @@ -3,7 +3,7 @@ def find -docstring "find files" -menu -params 1 \ -shell-script-candidates %{ fd -t f --hidden --color=never -E .git } def file-manager -params .. %{ - terminal-singleton files env "EDITOR=kcr edit" sh -c "DAFFM_PATH_RELATIVE_TO=$PWD daffm -c @kak %arg{@};" + terminal-singleton files env "DAFFM_PATH_RELATIVE_TO=%val{client_env_PWD}" daffm -c @kak %arg{@} } declare-user-mode buffer diff --git a/autoload/git.kak b/autoload/git.kak index c8426db..2cc3228 100644 --- a/autoload/git.kak +++ b/autoload/git.kak @@ -1,4 +1,8 @@ -define-command gitui -params .. %{ terminal-singleton git gitu %arg{@} } +define-command gitui -params .. %{ + terminal-singleton git \ + env "GIT_EDITOR=kak -c %val{session}" 'EDITOR=kcr edit' 'VISUAL=kcr edit' \ + gitu %arg{@} +} declare-user-mode git declare-user-mode git-r diff --git a/autoload/window.kak b/autoload/window.kak index ba1fab7..a405924 100644 --- a/autoload/window.kak +++ b/autoload/window.kak @@ -5,10 +5,6 @@ map global win q ': quit' -docstring 'Quit' map global win ': quit' -docstring 'Quit' map global win v ': tmux-terminal-horizontal kak -c %val{session}' -docstring 'Split vertical' map global win s ': tmux-terminal-vertical kak -c %val{session}' -docstring 'Split horizontal' -map global win h ': nop %sh{tmux select-pane -L}' -docstring 'Jump left' -map global win j ': nop %sh{tmux select-pane -D}' -docstring 'Jump down' -map global win k ': nop %sh{tmux select-pane -U}' -docstring 'Jump up' -map global win l ': nop %sh{tmux select-pane -R}' -docstring 'Jump right' map global win z ': wq' define-command terminal-singleton -params 2.. -docstring 'terminal-singleton [args...]' %{ @@ -17,9 +13,7 @@ define-command terminal-singleton -params 2.. -docstring 'terminal-singleton /dev/null 2>&1 -- cgit v1.3.1