Skip to content

Instantly share code, notes, and snippets.

@rampion
Created July 2, 2009 07:51
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save rampion/139318 to your computer and use it in GitHub Desktop.
screen bindings
# bind CTRL-A e to edit a space-delimited path in vim
bind e source .screen/vim-path.screen
# bind CTRL-A K to view a manpage for a term starting at the cursor
bind K source .screen/man-word.screen
# man-word.screen
# prevent messages from slowing this down
msgminwait 0
# copy word starting at cursor
copy
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 'xargs man || read'
# feed that window the copied word
paste '.'
# should display as 'stuff "^M^D"' in vim
# be sure to enter '^M' as 'CTRL-V ENTER' and '^D' as 'CTRL-V CTRL-D'
stuff " "
# turn message waiting back on
msgminwait 1
# vi: ft=screen
au BufRead,BufNewFile *.screen set filetype=screen
# vim-path.screen
# prevent messages from slowing this down
msgminwait 0
# copy whitespace delimited path under cursor
copy
stuff "Bw Ebe "
# open a new window that waits for a path to run vim on
screen -t vim /bin/sh -c 'read TO_EDIT ; vim $TO_EDIT'
# feed that window the copied path
paste '.'
# should display as 'stuff "^M^D"' in vim
# be sure to enter '^M' as 'CTRL-V ENTER' and '^D' as 'CTRL-V CTRL-D'
stuff " "
# turn message waiting back on
msgminwait 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment