lfs-scripts/scripts/chapter8/8.69-vim.sh
2023-01-12 19:41:04 +05:30

57 lines
861 B
Bash

#!/bin/bash
cd /sources
tar xf vim-9.0.0228.tar.gz
cd vim-9.0.0228
echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h
./configure --prefix=/usr
if [ $? -ne 0 ]
then
exit 1
fi
make -j5
if [ $? -ne 0 ]
then
exit 1
fi
chown -Rv tester .
su tester -c "LANG=en_US.UTF-8 make -j1 test" &> vim-test.log
make 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/vim90/doc /usr/share/doc/vim-9.0.0228
cd /sources
rm -rf vim-9.0.0228
# Configure vim
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