Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 30 lines (22 sloc) 0.888 kb
#!/bin/bash
[ `vim --serverlist | grep CLICKY` ] || (lxterminal -e 'env VIMRUNTIME=/0/1/vim/runtime/ vim --servername CLICKY'; sleep 1)
file=$2
if [ -d "$1/.git" ]
then
# git-show commit hashes.
# TODO: If the previous git show caused a pager to open, we oughta quit it.
if git --git-dir="$1/.git" rev-parse --verify --quiet "$2"
then
vim --servername CLICKY --remote-send ":cd $1<CR>:!git show $2<CR>"
exit
fi
# For diffs (TODO: check that the files don't exist with a/ or b/ first?)
file=${file#a/}
file=${file#b/}
fi
# There's got to be a nice way of absolutising a file name.
[ `expr substr "$file" 1 1` = / ] || file=$1/$file
# Edit the file
vim --servername CLICKY --remote-send ":e ${file%%:*}<CR>"
# Jump to the right line if a line is present.
[ "${file#*:}" ] && vim --servername CLICKY --remote-send ":${file#*:}<CR><CR>"
Jump to Line
Something went wrong with that request. Please try again.