【发布时间】:2009-07-13 16:59:47
【问题描述】:
我不确定以下Rampion's code 的确切用途。 它显然应该在光标位置执行命令。
# 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
命令的目的是什么?
【问题讨论】:
标签: gnu-screen