diff options
| author | Akshay Nair <phenax5@gmail.com> | 2025-10-28 00:51:10 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2025-10-28 00:51:14 +0530 |
| commit | 74d4dd79e50d816f87d4f7127b978d5f1467e1e6 (patch) | |
| tree | 538a46ee9e6fbc5a5c3dd6375ecb4ac56ee0b03b | |
| parent | a699f41c228b573ff980927d6807ea2b538c0be0 (diff) | |
| download | kakoune-config-74d4dd79e50d816f87d4f7127b978d5f1467e1e6.tar.gz kakoune-config-74d4dd79e50d816f87d4f7127b978d5f1467e1e6.zip | |
Fix editor for daffm and gitu
| -rw-r--r-- | autoload/cursor.kak | 8 | ||||
| -rw-r--r-- | autoload/files.kak | 2 | ||||
| -rw-r--r-- | autoload/git.kak | 6 | ||||
| -rw-r--r-- | autoload/window.kak | 6 |
4 files changed, 10 insertions, 12 deletions
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 <space><a-i>w <a-k>\A\w+\z<ret> +# eval -draft %{ try %{ +# exec <a-i>w<a-k>\A\w+\z<ret> # 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<ret>' -docstring 'Quit' map global win <c-q> ': quit<ret>' -docstring 'Quit' map global win v ': tmux-terminal-horizontal kak -c %val{session}<ret>' -docstring 'Split vertical' map global win s ': tmux-terminal-vertical kak -c %val{session}<ret>' -docstring 'Split horizontal' -map global win h ': nop %sh{tmux select-pane -L}<ret>' -docstring 'Jump left' -map global win j ': nop %sh{tmux select-pane -D}<ret>' -docstring 'Jump down' -map global win k ': nop %sh{tmux select-pane -U}<ret>' -docstring 'Jump up' -map global win l ': nop %sh{tmux select-pane -R}<ret>' -docstring 'Jump right' map global win z ': wq<ret>' define-command terminal-singleton -params 2.. -docstring 'terminal-singleton <name> <command> [args...]' %{ @@ -17,9 +13,7 @@ define-command terminal-singleton -params 2.. -docstring 'terminal-singleton <na open-term-win() { printf "terminal -n '$name' env" printf " 'KAKOUNE_SESSION=$kak_session' 'KAKOUNE_CLIENT=$kak_client'" - printf " 'GIT_EDITOR=kak -c \"$kak_session\"' 'EDITOR=kcr edit' 'VISUAL=kcr edit'" printf " %q" "$@" - echo "" } focus-term-win() { tmux select-window -t "$name" >/dev/null 2>&1 |
