From 8ff33f448ead9dcfe87395a81302bb57d4124d7d Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Wed, 1 Jul 2026 21:06:18 +0530 Subject: Add conflict marker object --- autoload/cursor.kak | 3 +-- autoload/git.kak | 11 +++++++++-- autoload/refactor/javascript.kak | 6 +++--- 3 files changed, 13 insertions(+), 7 deletions(-) (limited to 'autoload') diff --git a/autoload/cursor.kak b/autoload/cursor.kak index 6a2e23f..2874c45 100644 --- a/autoload/cursor.kak +++ b/autoload/cursor.kak @@ -8,8 +8,7 @@ hook global ModeChange .*:insert:.* %{ try %{ unset-face window PrimaryCursorEol } } -# set-option global idle_timeout 100 - +# Highlight cursor word # hook global NormalIdle .* %{ # eval -draft %{ try %{ # exec ,w \A\w+\z diff --git a/autoload/git.kak b/autoload/git.kak index 775cf0d..1b58a6e 100644 --- a/autoload/git.kak +++ b/autoload/git.kak @@ -7,8 +7,6 @@ define-command gitui -params .. %{ } declare-user-mode git -declare-user-mode git-r -declare-user-mode git-d map global user g ': enter-user-mode git' -docstring 'Git mode' map global git s ': gitui' -docstring 'Git tui' map global git A ': git add %val{buffile}' -docstring 'Add file' @@ -16,10 +14,16 @@ map global git m ': git-line-blame' -docstring 'Blame selection lines' map global git M ': git-file-blame' -docstring 'Blame buffer file' map global git l ': git-link' -docstring 'Open remote link to selection in file' +# diff +declare-user-mode git-d map global git d ': enter-user-mode git-d' -docstring 'Diff mode' map global git-d d ': git-open-diff' -docstring 'Open staged files' map global git-d c ': git-open-commit' -docstring 'Open files changed in last commit' +map global git-d x ': git-grep-conflict-markers' -docstring 'Find conflicts' +define-command git-grep-conflict-markers %{ grep <<<< } +# rebase +declare-user-mode git-r map global git r ': enter-user-mode git-r' -docstring 'Git re(base/set) mode' map global git-r f ': git reset HEAD^1 -- %val{buffile}' -docstring 'Split file out of last commit' @@ -28,6 +32,9 @@ map global git n ': git next-hunk' -docstring 'Next hunk' map global git p ': git prev-hunk' -docstring 'Previous hunk' map global git h ': git-toggle-diff' -docstring 'Toggle hunk indicators' +# Objects +map global object m %{c^[=]{4\,}[^\n]*\n,^[=]{4\,}[^\n]*\n} -docstring 'conflict markers' + set-option global git_diff_add_char "+" set-option global git_diff_del_char "-" set-option global git_diff_mod_char "~" diff --git a/autoload/refactor/javascript.kak b/autoload/refactor/javascript.kak index 514b883..7b60b2f 100644 --- a/autoload/refactor/javascript.kak +++ b/autoload/refactor/javascript.kak @@ -2,11 +2,11 @@ hook global BufSetOption filetype=(?:javascript|typescript|jsx|tsx) %{ map global refactor o ': js-test-toggle-it-state' -docstring 'Toggle it/it.only' } -# TODO: Doesnt work right. Switch to treesitter code mods +# TODO: Use treesitter code mods? define-command js-test-toggle-it-state %{ try %{ - execute-keys 'Zimxsit\(cit.only(z' + execute-keys -draft 'imxsit\(cit.only(' } catch %{ - execute-keys 'Zimxsit\.only\(cit(z' + execute-keys -draft 'imxsit\.only\(cit(' } } -- cgit v1.3.1