public
Last active

screen bindings

  • Download Gist
.screen/bindings.screen
1 2 3 4 5
# 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
.screen/man-word.screen
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
# 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
.screen/vim-path.screen
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
# 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
.vim/ftdetect/screen.vim
VimL
1
au BufRead,BufNewFile *.screen set filetype=screen

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.