| Server IP : 43.141.49.119 / Your IP : 113.219.202.173 Web Server : Apache System : Linux VM-8-5-opencloudos 6.6.34-9.oc9.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jun 19 19:35:45 CST 2024 x86_64 User : www ( 1000) PHP Version : 8.1.27 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /bin/ |
Upload File : |
#!/usr/bin/sh
# Written by: John Ellson <ellson@research.att.com>
if [ "$1" = "-?" ]; then
echo "Usage: vimdot [file]" >&2
exit 0
fi
error() { echo "$0: $*" >&2; exit 1; }
# Try $EDITOR first, else try vim or vi
editor="$(which $EDITOR)" || editor="/usr/bin/vim"
[ -x "$editor" ] || editor="/usr/bin/vi"
[ -x "$editor" ] || error "EDITOR not found or not executable";
default="noname.gv"
if test -z "$1"; then
f="$default"
if ! test -f "$f"; then
if ! test -w .; then error "directory `pwd` is not writable"; fi
cat >"$f" <<EOF
digraph G {
graph [layout=dot rankdir=LR]
// This is just an example for you to use as a template.
// Edit as you like. Whenever you save a legal graph
// the layout in the graphviz window will be updated.
vim [href="http://www.vim.org/"]
dot [href="http://www.graphviz.org/"]
vimdot [href="file:///usr/bin/vimdot"]
{vim dot} -> vimdot
}
EOF
fi
else
f="$1"
fi
if ! test -w "$f"; then error "$f is not writable"; fi
# dot -Txlib watches the file $f for changes using inotify()
dot -Txlib "$f" 2>/dev/null &
# open an editor on the file $f (could be any editor; gvim &'s itself)
exec $editor "$f"