Vim-9.2.0954

#### Beyond Linux® From Scratch (systemd Edition) - Version r13.0-1357

### Chapter 6. Text Editors

- Prev

  Nano-9.2

- Next

  Shells

- Up
- Home

# Vim-9.2.0954

## 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.

### Note

The version of vim changes daily. To get the latest version, go to https://github.com/vim/vim/releases.

### Note

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

### Package Information

- Download (HTTP): https://github.com/vim/vim/archive/v9.2.0954/vim-9.2.0954.tar.gz

- Download MD5 sum: 3cf4136d4f83d45636f313b7103c75c5

- Download size: 19 MB

- Estimated disk space required: 159 MB (add 83 MB for tests)

- Estimated build time: 0.3 SBU (with parallelism=4; add 3.4 SBU for tests)

### Vim Dependencies

#### Recommended

a graphical environment and GTK-3.24.52

#### Optional

cURL-8.21.0 (or Wget-1.25.0, required by some tests), GPM-1.20.7, libcanberra-0.30, Lua-5.4.8, Ruby-4.0.6, rsync-3.5.0, and libsodium

## Installation of Vim

### Note

If you recompile Vim to link against X and your X libraries are not on the root partition, you will no longer have vim 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:

### Note

If you intend to run the tests and have not installed Xorg in /usr, append LDFLAGS='-L$XORG_PREFIX/lib' to the configure line below.

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

    ./configure --prefix=/usr        \
                --with-features=huge \
                --enable-gui=gtk3    \
                --with-tlib=ncursesw &&
    make

### Note

If the global configuration file `/etc/vimrc` references the `VIMRUNTIME` environment variable, some tests may complain about being unable to find the corresponding directory and wait for user input. If this is the case, this file should be saved and removed before running the tests. Or if bubblewrap-0.11.2 is installed, it's also possible to create a lightweight container environment where this file is hidden and run the tests in the container.

To test the results, issue: make -j1 test. Test failures, if any, will produce the file `test.log` in `src/testdir`. The remaining tests will still be executed. Two tests, Test_client_server_stopinsert() and Test_popup_setbuf(), are known to fail on some systems. Some tests labelled as “flaky” may fail occasionally and can be ignored. Several tests are known to fail if the output is redirected to a file, and also if they are run in a 'screen' session.

### Note

If running the tests with bubblewrap-0.11.2 and `/etc/vimrc` hidden, use bwrap --dev-bind / / --dev-bind /dev/null /etc/vimrc make -j1 test.

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

    ln -snfv ../vim/vim92/doc /usr/share/doc/vim-9.2.0954

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

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

And then install the updated runtime files and regenerate the `tags` file, as the `root` user issue:

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

## Command Explanations

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

`--with-tlib=ncursesw`: This switch forces Vim to link against the `libncursesw` library.

`--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-luainterp`, `--enable-perlinterp`, `--enable-python3interp=dynamic`, `--enable-tclinterp --with-tclsh=tclsh`, `--enable-rubyinterp`: These options include the Lua, Perl, Python3, Tcl, or Ruby interpreters that allow using other application code in vim scripts. All the `--enable-*` options can accept `=dynamic` to dynamically load the interpreter when needed. This is required for Python 3 to prevent segmentation faults. For tcl, it is necessary to indicate the name of the tclsh executable, since configure only searches versioned names with old versions.

## Configuring Vim

### Config Files

`/etc/vimrc` and `~/.vimrc`

### Configuration Information

Vim has an integrated spell checker which you can enable by issuing 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: https://github.com/vim/vim/tree/master/runtime/spell and save them to `~/.vim/spell` or in `/usr/share/vim/vim92/spell/`.

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

    :help version-9.2.0954

For additional information on setting up Vim configuration files, see The vimrc Files and https://vim.fandom.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, gvimtutor, 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
gvimtutor | teaches the basic keys and commands of gvim
rgview | is a restricted version of gview
rgvim | is a restricted version of gvim

- Prev

  Nano-9.2

- Next

  Shells

- Up
- Home