-
Notifications
You must be signed in to change notification settings - Fork 1
/
e
executable file
·45 lines (42 loc) · 955 Bytes
/
e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/sh
#
# NAME
#
# e - wrapper script to connect to the gVim server
#
# SYNOPSIS
#
# e [<args>...]
#
# DEPENDENCIES
#
# gVim compiled with +clientserver
#
# SEE ALSO
#
# vimer <https://github.com/susam/vimer>
#
# Path to the gVim executable.
gvim="/usr/bin/gvim"
# Use the most recent gVim server.
gvim_server=$("$gvim" --serverlist | tail -n -1)
if [ "$*" ]
then
if [ "$gvim_server" ]
then
nohup "$gvim" --servername "$gvim_server" \
--remote "$@" >/dev/null </dev/null 2>&1
else
nohup "$gvim" "$@" >/dev/null </dev/null 2>&1
fi
else
if [ "$gvim_server" ]
then
# If there are no files to edit, we need to raise the
# gVim window manually by calling foreground().
nohup "$gvim" --servername "$gvim_server" \
--remote-expr "foreground()" >/dev/null </dev/null 2>&1
else
nohup "$gvim" >/dev/null </dev/null 2>&1
fi
fi