我不确定以下Rampion's code的确切用途。 它应该显然在光标位置执行命令。无法理解.screenrc中的代码
# man-word.screen
# prevent messages from slowing this down
msgminwait 0
# copy word starting at cursor
copy # I am not sure why we need this
stuff " e "
# open a new window that waits for a word to run man on
# (and uses 'read' to pause on error)
screen -t man /bin/sh -c 'cat | xargs man || read' # option -c seems to mean execute
# feed that window the copied word
# be sure to enter '^M' as 'CTRL-V ENTER' and '^D' as 'CTRL-V CTRL-D' (in vim)
paste '.'
# should display as 'stuff "^M^D"'
stuff " "
# turn message waiting back on
msgminwait 1
# vi: ft=screen
该代码是根据绑定^g
使得
bindkey -m ^f source /Users/masi/bin/screen/edit-file-under-cursor.screen
作为
bind f source /Users/masi/bin/screen/edit-file-under-cursor.screen
我运行代码作为我的光标是相同是在下面的行的开头
vim ~/.zshrc
我得到一个新的缓冲,使得
alt text http://files.getdropbox.com/u/175564/screen-rampion.png
什么命令的目的是什么?
@rampion:谢谢你的回答! – 2009-07-13 19:22:22
你的意思是说,如果你始终在Screen的复制模式下使用命令,你不需要命令'copy'? ---我一直只在屏幕的复制模式下使用这些命令。 *在屏幕的复制模式之外使用这些命令的主要好处是什么?* --- *你怎么做到的?* – 2009-07-13 19:32:51
好吧,光标并不总是在复制模式之外的txt结尾。在vim中,当使用readline等时,光标可以指向各种文本。所以我选择让我的命令能够直接在这些情况下工作,而不必先切换到复制模式。 – rampion 2009-07-13 20:14:02