Skip to content

@rampion /bindings.screen
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
screen bindings
.screen
.vim
# 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
Something went wrong with that request. Please try again.