Browse Source

Add xcxx(), to use command to transform clipboard (xvxx style)

Alois Mahdal 5 years ago
parent
commit
6ba46c6d14
1 changed files with 12 additions and 0 deletions
  1. 12
    0
      dotfiles/bash/main.bashrc

+ 12
- 0
dotfiles/bash/main.bashrc View File

401
     xop o | vipe | xop ii
401
     xop o | vipe | xop ii
402
 }
402
 }
403
 
403
 
404
+xcxx() {
405
+    #
406
+    # Filter text in primary clipboard using command $@ and save it to C-C clipboard
407
+    #
408
+    # Similar to xvvx() but instead of interactive editing, provided filter
409
+    # command is run.
410
+    #
411
+    local cmd=("$@")
412
+    xop o | "${cmd[@]}" | xop ii
413
+    return "${PIPESTATUS[1]}"
414
+}
415
+
404
 vx() {
416
 vx() {
405
     #
417
     #
406
     # Edit stdin and save it to primary clipboard
418
     # Edit stdin and save it to primary clipboard