aboutsummaryrefslogtreecommitdiffstats
path: root/chapter8/vim.sh
diff options
context:
space:
mode:
authorWilliam Harrington <kb0iic@berzerkula.org>2021-04-12 12:49:29 -0500
committerWilliam Harrington <kb0iic@berzerkula.org>2021-04-12 12:49:29 -0500
commit99659c30e5369c3f02e286a4a6ec6fecd77f0416 (patch)
tree12110b15571365acae602ebd9c1348463a0d4710 /chapter8/vim.sh
parent0e5288f8f3bee7276d561cde029ed492e2ea85e6 (diff)
parent13c6afd35cab1e3f4d96857d549e02cfd1e23acd (diff)
Merge branch 'chapter8'
Diffstat (limited to 'chapter8/vim.sh')
-rw-r--r--chapter8/vim.sh34
1 files changed, 34 insertions, 0 deletions
diff --git a/chapter8/vim.sh b/chapter8/vim.sh
new file mode 100644
index 0000000..6543279
--- /dev/null
+++ b/chapter8/vim.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h
+
+./configure --prefix=/usr
+
+make
+
+make -j1 install
+
+ln -sv vim /usr/bin/vi
+for L in /usr/share/man/{,*/}man1/vim.1; do
+ ln -sv vim.1 "$(dirname $L)"/vi.1
+done
+
+ln -sv ../vim/vim82/doc /usr/share/doc/vim-"${VERSION}"
+
+cat > /etc/vimrc << "EOF"
+" 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
+EOF