Vim-7.4

Introduction to Vim

The Vim package, which is an abbreviation for VI IMproved, contains a vi clone with extra features as compared to the original vi.

The default LFS instructions install vim as a part of the base system. If you would prefer to link vim against X, you should recompile vim to enable GUI mode. There is no need for special instructions since X support is automatically detected.

This package is known to build and work properly using an LFS-7.7 platform.

Package Information

Vim Dependencies

Recommended

Optional

GPM-1.20.7, Lua-5.3.0, Python-2.7.9, Ruby-2.2.0, Tcl-8.6.3, and LessTif

User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/vim

Installation of Vim

[Note]

Note

If you recompile Vim to link against X and your X libraries are not on the root partition, you will no longer have an editor for use in emergencies. You may choose to install an additional editor, not link Vim against X, or move the current vim executable to the /bin directory under a different name such as vi.

Install Vim by running the following commands:

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

sed -i 's/luaL_optlong/(long)luaL_optinteger/' src/if_lua.c   &&

./configure --prefix=/usr --with-features=huge                &&
make

To test the results, issue: make test. The vim test suite outputs a lot of binary data to the screen, which can cause issues with the settings of the current terminal. This can be resolved by redirecting the output to a log file. Even if one of the tests fails to produce the file test.out in src/testdir, the remaining tests will still be executed. If all goes well,the final message in the log file will be ALL DONE. Note: Some color tests expect to be executed under the xterm terminal emulator.

Now, as the root user:

make install

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-7.4, making it consistent with the location of documentation for other packages:

ln -snfv ../vim/vim74/doc /usr/share/doc/vim-7.4

If you wish to update the runtime files, issue the following command (requires rsync-3.1.1):

rsync -avzcP --delete --exclude="/dos/" --exclude="/spell/" \
    ftp.nluug.nl::Vim/runtime/ ./runtime/

To install the runtime files and regenerate the tags file, as the root user issue:

make -C src installruntime &&
vim -c ":helptags /usr/share/doc/vim-7.4" -c ":q"

Command Explanations

sed -i ... src/if_lua.c: This sed fixes compilation with lua 5.3.

--with-features=huge: This switch enables all the additional features available in Vim, including support for multibyte characters.

--enable-gui=no: This will prevent compilation of the GUI. Vim will still link against X, so that some features such as the client-server model or the x11-selection (clipboard) are still available.

--without-x: If you prefer not to link Vim against X, use this switch.

--enable-perlinterp, --enable-pythoninterp, --enable-tclinterp, --enable-rubyinterp: These options include the Perl, Python, Tcl, or Ruby interpreters that allow using other application code in vim scripts.

Configuring Vim

Config Files

/etc/vimrc and ~/.vimrc

Desktop File

If desired, create a menu entry for graphical vim, gvim.desktop, as the root user

cat > /usr/share/applications/gvim.desktop << "EOF"
[Desktop Entry]
Name=GVim Text Editor
Comment=Edit text files
Comment[pt_BR]=Edite arquivos de texto
TryExec=gvim
Exec=gvim -f %F
Terminal=false
Type=Application
Icon=gvim.png
Categories=Utility;TextEditor;
StartupNotify=true
MimeType=text/plain;
EOF

Configuration Information

Vim has an integrated spell checker which you can enable it if you issue the following in a vim window:

:setlocal spell spelllang=ru

This setting will enable spell checking for the Russian language for the current session.

By default, Vim only installs spell files for the English language. If a spell file is not available for a language, then Vim will call the $VIMRUNTIME/plugin/spellfile.vim plugin and will try to obtain the *.spl and optionally *.sug from the vim ftp server, by using the $VIMRUNTIME/plugin/netrwPlugin.vim plugin.

Alternatively you can manually download the *.spl and *.sug files from: ftp://ftp.vim.org/pub/vim/runtime/spell/ and save them to ~/.vim/spell or in /usr/share/vim/vim74/spell/.

To find out what's new in Vim-7.4 issue the following command:

:help version-7.4

For additional information on setting up Vim configuration files, see The vimrc Files and http://vim.wikia.com/wiki/Example_vimrc.

Contents

A list of the reinstalled files, along with their short descriptions can be found in the LFS Vim Installation Instructions

Installed Programs: gview, gvim, gvimdiff, rgview, and rgvim
Installed Libraries: None
Installed Directory: /usr/share/vim

Short Descriptions

gview

starts gvim in read-only mode.

gvim

is the editor that runs under X and includes a GUI.

gvimdiff

edits two or three versions of a file with gvim and shows the differences.

rgview

is a restricted version of gview.

rgvim

is a restricted version of gvim.

Last updated on 2015-02-26 23:16:43 -0500