2 # close all gvim by remote -_-
6 VIM
="/usr/local/bin/vim"
10 LISTALL
=`$VIM --serverlist`
16 $ECHO -n "force kill:[${CL_RED}$server${CL_END}] "
17 $VIM --servername $server --remote-send "<ESC>:qa!<CR>"
18 $VIM --serverlist |
/bin
/grep -qw $server
19 if [ "$?" = "0" ]; then
20 $ECHO "${CL_RED}fail${CL_END} !!"
23 $ECHO "${CL_GREEN}success${CL_END}"
31 if [ "$LISTALL" = "" ]; then
32 $ECHO "all have killed before ${CL_RED}-_-${CL_END}"
36 if [ "$SINGLE" = "" ]; then
37 # LIST=`/bin/echo $LISTALL | tr "a-z" "A-Z"`
38 $ECHO -n "${CL_RED}will kill all exist gvim, [y/n] "
41 if [ "$iskall" = "y" ]; then
47 SINGLE
=`$ECHO $SINGLE | tr "a-z" "A-Z"`
48 $ECHO $LISTALL |
/bin
/grep -qw $SINGLE
49 if [ "$?" = "0" ]; then
50 $ECHO "will close your specialed:$SINGLE"
53 $ECHO "your input:[${CL_RED}$SINGLE${CL_END}] do not exists yet"
57 #$ECHO -e "LIST\n$LIST\n"
62 server
=`$ECHO $server | tr "a-z" "A-Z"` #can remote it
63 $ECHO -n "kill: $server "
64 $VIM --servername $server --remote-send "<ESC>:qa<CR>"
65 $VIM --serverlist |
/bin
/grep -qw $server
66 if [ "$?" = "0" ]; then
67 $ECHO "${CL_RED}fail${CL_END}"
68 $ECHO -n "DO YOU WANT KILL IT FORCE:${CL_RED}[$server]${CL_END} [y/n] "
70 if [ "$FORCE" = "y" ]; then
74 $ECHO "${CL_GREEN}success${CL_END}"