Installing Vim-6.2

Estimated build time:           0.4 SBU
Estimated required disk space:  34 MB

Alternatives to Vim

If you prefer another editor -- like Emacs, Joe, or Nano -- to Vim, have a look at http://www.linuxfromscratch.org/blfs/view/stable/postlfs/editors.html for suggested installation instructions.

Contents of Vim

(Last checked against version 6.2.)

The Vim package contains a configurable text editor built to enable efficient text editing.

Installed programs: efm_filter.pl, efm_perl.pl, ex (link to vim), less.sh, mve.awk, pltags.pl, ref, rview (link to vim), rvim (link to vim), shtags.pl, tcltags, vi (link to vim), view (link to vim), vim, vim132, vim2html.pl, vimdiff (link to vim), vimm, vimspell.sh, vimtutor and xxd

Vim Installation Dependencies

(Last checked against version 6.0.)

Bash: sh
Binutils: as, ld, strip
Coreutils: cat, chmod, cp, echo, expr, ln, mkdir, mv, rm, touch, tr,
             uname, wc, whoami
Diffutils: cmp, diff
Find: find
GCC: cc1, collect2, cpp, gcc
Grep: egrep, grep
Make: make
Net-tools: hostname
Sed: sed

Installation of Vim

Change the default locations of the vimrc and gvimrc files to /etc.

echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h
echo '#define SYS_GVIMRC_FILE "/etc/gvimrc"' >> src/feature.h

Now prepare Vim for compilation:

./configure --prefix=/usr

Compile the package:

make

And install the package:

make install

Vim can run in old-fashioned vi mode by creating a symlink, which may be created with the following command:

ln -s vim /usr/bin/vi

If you plan to install the X Window system on your LFS system, you might want to re-compile Vim after you have installed X. Vim comes with a nice GUI version of the editor which requires X and a few other libraries to be installed. For more information read the Vim documentation.

Configuring Vim

By default, vim runs in vi compatible mode. Some people might like this, but we have a high preference to run vim in vim mode (else we wouldn't have included vim in this book, but the original vi). Create the /root/.vimrc by running the following:

cat > /root/.vimrc << "EOF"
" Begin /root/.vimrc

set nocompatible
set bs=2

" End /root/.vimrc
EOF