Vim の概要
Vim は VI Improved の略です。 オリジナルの
vi
に対してさまざまな機能拡張を行い、これを提供します。
LFS によるインストール手順では、ベースシステムを構成するものとして vim をインストールしています。 X アプリケーション上にて vim を動作させたい場合は、vim を再コンパイルして GUI モードを利用できるようにする必要があります。
インストール手順は特に変わることはありません。 X
サポートは自動的に検出されます。
注記
LFS や依存パッケージが本ブックに示す最新安定バージョンでなかった場合には、BLFS
開発版においては、パッケージのビルドや処理実行が適切に行われないことがあります。
パッケージ情報
Vim の依存パッケージ
推奨
グラフィック環境, GTK+-3.24.38, rsync-3.2.7
任意
GPM-1.20.7, Lua-5.4.6, Ruby-3.2.2
Vim のインストール
注記
X にリンクした Vim を再ビルドするにあたり、X
ライブラリをルートパーティション以外にインストールしていた場合、緊急時にこのエディターを利用できなくなります。
このことに対処するには、他のエディターをインストールするか、Vim を X
にリンクさせないようにするか、あるいは現在ある vim を /bin に移動させて vi
などの別名にして利用するなどの方法を取る必要があります。
以下のコマンドを実行して Vim をビルドします。
注記
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
注記
グローバルな設定である /etc/vimrc において
VIMRUNTIME
環境変数が設定されている場合、テストによっては、対応するディレクトリが見つけられなくなり、ユーザー入力を促すために停止することがあります。
このようなことが発生した場合は、このファイルを保存しておき、いったん削除した上でテストを実施してください。 Or if
bubblewrap-0.8.0 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, or bwrap
--dev-bind / / --dev-bind /dev/null /etc/vimrc make -j1
test if running the tests with bubblewrap-0.8.0 and /etc/vimrc hidden. 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 log will report
ALL DONE. Some tests labelled as
「flaky」 may
fail occasionally and can be ignored. The tests are known to fail
if the output is redirected to a file, and also if they are run in
a 'screen' session.
注記
Some color tests expect to be executed under the xterm terminal emulator.
root ユーザーになって以下を実行します。
make install
デフォルトでは、Vim のドキュメントは /usr/share/vim
にインストールされます。 以下のように /usr/share/doc/vim-9.0.2103
に対してシンボリックリンクを張っておくと、他のパッケージのドキュメントと同じようにドキュメントを管理することができます。
ln -snfv ../vim/vim90/doc /usr/share/doc/vim-9.0.2103
ランタイムファイルを更新したい場合は以下を実行します。 (実行には rsync-3.2.7
が必要です。)
rsync -avzcP --exclude="/dos/" --exclude="/spell/" \
ftp.nluug.nl::Vim/runtime/ ./runtime/
ランタイムファイルをインストールし tags
ファイルを再生成するには、root ユーザーになって以下を実行します。
make -C src installruntime &&
vim -c ":helptags /usr/share/doc/vim-9.0.2103" -c ":q"
コマンド説明
--with-features=huge:
このスイッチは Vim における追加機能を実現します。
マルチバイトサポートが含まれます。
--with-tlib=ncursesw: This
switch forces Vim to link against the libncursesw library.
--enable-gui=no: このパラメーターは GUI
をコンパイルしないようにします。 このようにしても Vim は
X にリンクされます。 したがってクライアントサーバーモデルや
x11-selection (クリップボード) などの機能は利用することができます。
--without-x: Vim を X
にリンクしない場合はこのパラメーターを指定します。
--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.
Vim の設定
設定ファイル
/etc/vimrc, ~/.vimrc
設定情報
Vim には優れたスペルチェッカーがあります。 vim
ウィンドウ内にて以下を実行すれば、この機能を有効にできます。
:setlocal spell spelllang=ru
この設定は、ロシア語に対するスペルチェックを可能とするものです。
デフォルトで Vim
がインストールするスペルファイルは英語のみです。 特定の言語に対してスペルファイルがなかった場合 Vim はプラグイン $VIMRUNTIME/plugin/spellfile.vim を呼び出し、vim の
FTP サーバーから *.spl や *.sug を取得します。 この際にはプラグイン $VIMRUNTIME/plugin/netrwPlugin.vim も利用されます。
*.spl や *.sug というファイルは ftp://ftp.vim.org/pub/vim/runtime/spell/
から手動でダウンロードすることもできます。 これらのファイルは ~/.vim/spell に書き加えるか、/usr/share/vim/vim90/spell/ ディレクトリに保存して利用します。
Vim-9.0.2103
の最新情報については、以下のコマンドを実行して確認することができます。
:help version-9.0.2103
Vim の設定ファイルについての詳細は vimrc ファイル や https://vim.fandom.com/wiki/Example_vimrc
を参照してください。
パッケージ構成
A list of the reinstalled files, along with their short
descriptions can be found in the LFS
Vim Installation Instructions.
インストールプログラム: gview, gvim, gvimdiff, gvimtutor, rgview,
rgvim
インストールライブラリ: なし
インストールディレクトリ: /usr/share/vim
概略説明
|
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
|