-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvim.sh
executable file
·49 lines (38 loc) · 1.05 KB
/
vim.sh
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
49
# See LICENSE for license details.
#!/bin/bash
set -euo pipefail
unpack_src() {
tar xf vim-8.2.2433.tar.gz && \
cd vim-8.2.2433
return
}
configure() {
echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h
./configure --prefix=/usr
return
}
make_install() {
mkdir -p $TODD_FAKE_ROOT_DIR/usr/share/doc
mkdir -p $TODD_FAKE_ROOT_DIR/etc
make
make DESTDIR=$TODD_FAKE_ROOT_DIR -j1 install
ln -sv vim $TODD_FAKE_ROOT_DIR/usr/bin/vi
for L in $TODD_FAKE_ROOT_DIR/usr/share/man/{,*/}man1/vim.1; do
ln -sv vim.1 $(dirname $L)/vi.1
done
ln -sv ../vim/vim82/doc $TODD_FAKE_ROOT_DIR/usr/share/doc/vim-8.2.2433
echo "\" Begin /etc/vimrc
\" Ensure defaults are set before customizing settings, not after
source \$VIMRUNTIME/defaults.vim
let skip_defaults_vim=1
set nocompatible
set backspace=2
set mouse=
syntax on
\" if (&term == "xterm") || (&term == "putty")
\" set background=dark
\" endif
\" End /etc/vimrc" > $TODD_FAKE_ROOT_DIR/etc/vimrc
return
}
unpack_src && configure && make_install