]> Sergey Matveev's repositories - dotfiles.git/commitdiff
Let's try command's output selector
authorSergey Matveev <stargrave@stargrave.org>
Tue, 10 May 2022 16:26:52 +0000 (19:26 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Tue, 10 May 2022 16:26:52 +0000 (19:26 +0300)
tmux/.tmux.conf
tmux/.tmux/rc/select-command-output [new file with mode: 0644]
zsh/.zsh/rc/015prompt.zsh

index 4d2d2383a66f2408b3776d4a3624363c638d237b..64ba0b59039ae7d60379158d3c04cb783cce392a 100644 (file)
@@ -71,3 +71,5 @@ bind-key o display-menu \
     git-files g "display-popup -E -w 100% \"~/.tmux/bin/fzf.zsh git-files '#{pane_current_path}'\"" \
     git-branches b "display-popup -E -w 100% \"~/.tmux/bin/fzf.zsh git-branches '#{pane_current_path}'\"" \
     git-commits c "display-popup -E -w 100% \"~/.tmux/bin/fzf.zsh git-commits '#{pane_current_path}'\""
+
+source-file ~/.tmux/rc/select-command-output
diff --git a/tmux/.tmux/rc/select-command-output b/tmux/.tmux/rc/select-command-output
new file mode 100644 (file)
index 0000000..14534aa
--- /dev/null
@@ -0,0 +1,30 @@
+bind-key H {
+    copy-mode
+    send -X clear-selection
+    send -X start-of-line
+    send -X start-of-line
+    send -X cursor-up
+    send -X start-of-line
+    send -X start-of-line
+
+    if -F "#{m:*%\u00A0*,#{copy_cursor_line}}" {
+        send -X search-forward-text "%\u00A0"
+        send -X stop-selection
+        send -X -N 2 cursor-right
+        send -X begin-selection
+        send -X end-of-line
+        send -X end-of-line
+        if "#{m:*%\u00A0?*,#{copy_cursor_line}}" {
+            send -X cursor-left
+        }
+    } {
+        send -X end-of-line
+        send -X end-of-line
+        send -X begin-selection
+        send -X search-backward-text "%\u00A0"
+        send -X end-of-line
+        send -X end-of-line
+        send -X cursor-right
+        send -X stop-selection
+    }
+}
index 95fcae9a84c21077235add007d4d412fdd0b7c83..9a6219ac2396cdc9e7160f3c8e3e4f5c62fb8185 100644 (file)
@@ -9,7 +9,7 @@ PROMPT+="%(1j.%j.)%b"
 PROMPT+='%U${vcs_info_msg_0_}%u'
 PROMPT+="%(?.. %S%?%s)"
 PROMPT+='%(1S. %B${SECONDS}%b.)'
-PROMPT+='%B%F{magenta}%#%f%b '
+PROMPT+='%B%F{magenta}%#%f%b '
 
 function zle-line-init zle-keymap-select {
     local ccolour=red