我还没有找到办法,但是使用xclip
脚本至少可以使复制粘贴编辑粘贴循环更快。它粘贴到一个临时文件中,并使用Vim编辑它:
#!/bin/bash
# Dependencies: xclip, gvim
# Create an "ephemeral" file, that disappears with this process
tmpfile=$(mktemp /tmp/vim-edit-clipboard.XXXXXX)
exec 3>"$tmpfile"
rm $tmpfile
# It's unlinked, but can be referred to by other processes using /proc
ephemeral_path=/proc/$$/fd/3
# Paste to the file
xclip -selection clipboard -o > $ephemeral_path
# Edit it. Make Vim respect the presence or lack of EOL at EOF
gvim --nofork -c 'set nofixeol' $ephemeral_path
# Then copy it to the clipboard, removing the newline at the end
xclip -selection clipboard < $ephemeral_path
你可能会想键盘快捷方式分配给该脚本,这样你就可以像做一些事情CtrlA,CtrlC,SuperC
:s/\$wdw /^wce/
。^ [:wq