< Previous | Contents | Next >
6.71.1. Installation of Vim
First, change the default location of the vimrc configuration file to /etc:
echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h
echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h
Prepare Vim for compilation:
./configure --prefix=/usr
./configure --prefix=/usr
Compile the package:
make
make
To prepare the tests, ensure that the nobody user can write to the sources tree:
chown -Rv nobody .
chown -Rv nobody .
Now run the tests as the nobody user:
su nobody -s /bin/bash -c "LANG=en_US.UTF-8 make -j1 test" &> vim-test.log
su nobody -s /bin/bash -c "LANG=en_US.UTF-8 make -j1 test" &> vim-test.log
The test suite outputs a lot of binary data to the screen. This can cause issues with the settings of the current terminal. The problem can be avoided by redirecting the output to a log file as shown above. A successful test will result in the words "ALL DONE" in the log file at completion.
Install the package:
make install
make install
Many users are used to using vi instead of vim. To allow execution of vim when users habitually enter vi, create a symlink for both the binary and the man page in the provided languages:
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 /usr/bin/vi
for L in /usr/share/man/{,*/}man1/vim.1; do ln -sv vim.1 $(dirname $L)/vi.1
done
By default, Vim's documentation is installed in /usr/share/vim. The following symlink allows the documentation to be accessed via /usr/share/doc/vim-8.1.1846, making it consistent with the location of documentation for other packages:
ln -sv ../vim/vim81/doc /usr/share/doc/vim-8.1.1846
ln -sv ../vim/vim81/doc /usr/share/doc/vim-8.1.1846
If an X Window System is going to be installed on the LFS system, it may be necessary to recompile Vim after installing
X. Vim comes with a GUI version of the editor that requires X and some additional libraries to be installed. For more information on this process, refer to the Vim documentation and the Vim installation page in the BLFS book at http:// www.linuxfromscratch.org/blfs/view/9.0/postlfs/vim.html.