diff options
| author | Mike Vink <mike1994vink@gmail.com> | 2023-05-28 21:50:35 +0200 |
|---|---|---|
| committer | Mike Vink <mike1994vink@gmail.com> | 2023-05-28 21:50:35 +0200 |
| commit | 994ab3dfa6dde9e998beb5f033bccb12866048fb (patch) | |
| tree | 0020a56f4de5299370ee5dbc3679f17acaac571d | |
| parent | b8e8e1a291eb2af25107c4e5de956132d61636ec (diff) | |
update normal mode
| -rw-r--r-- | home.nix | 3 | ||||
| -rw-r--r-- | shell-scripts/tmux-normal-mode | 25 |
2 files changed, 19 insertions, 9 deletions
@@ -73,6 +73,7 @@ # printf "cursor = %s\n" "$cursor" >>/tmp/debug.log bind -n C-s run-shell tmux-normal-mode + bind -n C-q run-shell 'tmux-normal-mode --quit' ''; }; @@ -116,6 +117,8 @@ userEmail = email; extraConfig = { worktree.guessRemote = true; + mergetool.fugitive.cmd = "vim -f -c \"Gdiff\" \"$MERGED\""; + merge.tool = "fugitive"; }; ignores = [ "/.direnv/" diff --git a/shell-scripts/tmux-normal-mode b/shell-scripts/tmux-normal-mode index 0a956e2..5f338dc 100644 --- a/shell-scripts/tmux-normal-mode +++ b/shell-scripts/tmux-normal-mode @@ -1,11 +1,18 @@ kakoune_session="$(tmux display-message -p "#{window_name}" | sed "s/kakc@//")" dispatch_name="dispatch://$(tmux display-message -p "#{pane_start_command}")" -output=$(mktemp -d /tmp/kak-tmux.XXXXXXXX)/fifo -mkfifo ${output} -( tmux capture-pane -S '-' -E '-' -J -e -p -t $TMUX_PANE | filter-ansi >${output} & ) -tmux new-window -t kaks@$kakoune_session -n "$dispatch_name" -d " - kak -c '$kakoune_session' -e \"edit -fifo ${output} -scroll '${dispatch_name}';\ - set-option buffer readonly true ;\ - set-option window filetype dispatch ;\ - hook -always -once buffer BufCloseFifo .* %{ nop %sh{ rm -r $(dirname ${output}) } }\"" -tmux swap-pane -s kaks@$kakoune_session:"$dispatch_name".0 -t : +case "${@}" in + '') + output=$(mktemp -d /tmp/kak-tmux.XXXXXXXX)/fifo + mkfifo ${output} + ( tmux capture-pane -S '-' -E '-' -J -e -p -t $TMUX_PANE | filter-ansi >${output} & ) + tmux new-window -t kaks@$kakoune_session -n "$dispatch_name" -d " + kak -c '$kakoune_session' -e \"edit -fifo ${output} -scroll '${dispatch_name}';\ + set-option buffer readonly true ;\ + set-option window filetype dispatch ;\ + hook -always -once buffer BufCloseFifo .* %{ nop %sh{ rm -r $(dirname ${output}) } }\"" + tmux swap-pane -s kaks@$kakoune_session:"$dispatch_name".0 -t : + ;; + --quit) + tmux break-pane -t kaks@$kakoune_session -a -d -n "$dispatch_name" + ;; +esac |
