-
Notifications
You must be signed in to change notification settings - Fork 5
/
vim
executable file
·48 lines (46 loc) · 1.12 KB
/
vim
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
46
47
48
#!/bin/bash
if [ -n "$1" ] && [ -f "$1" ] && ! [ -w "$1" ]; then
echo "$1 is not writable by you, perhaps you want to"
echo
echo " sudo $0 $*"
echo
read -p "run under sudo? [Y/n/q] " answer
case "$answer" in
y|Y|"")
exec sudo "$0" "$@"
;;
q|Q)
exit
;;
esac
fi
case "$1" in
--fast-valgrind)
export PYTHONMALLOC=malloc
prefix="valgrind --log-file=valgrind.log"
prefix+=" --suppressions=$HOME/.python.supp"
shift
;;
--valgrind)
export PYTHONMALLOC=malloc
prefix="valgrind --log-file=valgrind.log"
prefix+=" --suppressions=$HOME/.python.supp"
prefix+=" --track-origins=yes" # slow but better info
prefix+=" --malloc-fill=cc"
shift
;;
--gdb)
prefix=gdb
export DEBUGINFOD_URLS="https://debuginfod.ubuntu.com"
shift
;;
*)
prefix=
;;
esac
vimhome=$HOME/src/vim
if test -x "$vimhome/src/vim"; then
VIMRUNTIME=$vimhome/runtime exec $prefix "$vimhome/src/vim" "$@"
else
exec /usr/bin/vim "$@"
fi