![]() |
VOOZH | about |
Vim (Vi improved) は vi テキストエディタを基にしたテキストエディタです。コマンドラインから使うことも、単独で動作する GUI アプリケーションとして使うこともできます。
Vim と、代わりに使用できる類似プログラム Neovim を混同すべきではありません。
X
|
Link console vim against X11 libraries to enable title and clipboard features in xterm |
acl
|
Add support for Access Control Lists |
crypt
|
Use dev-libs/libsodium for crypto support |
cscope
|
Enable cscope interface |
debug
|
Enable extra debug codepaths, like asserts and extra output. If you want to get meaningful backtraces see https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces |
gpm
|
Add support for sys-libs/gpm (Console-based mouse driver) |
lua
|
Enable Lua scripting support |
minimal
|
Install a very minimal build (disables, for example, plugins, fonts, most drivers, non-critical features) |
nls
|
Add Native Language Support (using gettext - GNU locale utilities) |
perl
|
Add optional support/bindings for the Perl language |
python
|
Add optional support/bindings for the Python language |
racket
|
Enable support for Scheme using dev-scheme/racket |
ruby
|
Add support/bindings for the Ruby language |
selinux
|
!!internal use only!! Security Enhanced Linux support, this must be set by the selinux profile or breakage will occur |
sound
|
Enable sound support |
tcl
|
Add support the Tcl language |
terminal
|
Enable terminal emulation support |
vim-pager
|
Install vimpager and vimmanpager links |
wayland
|
Enable dev-libs/wayland backend |
X Window System のサポートが不要なら、 app-editors/vim をインストールしてください。
root #emerge --ask app-editors/vimncurses ベースのインターフェースを備えた vim (/usr/bin/vim) とX Window System 用のグラフィカルインターフェースを備えた vim (/usr/bin/gvim) の両方をインストールするには、app-editors/gvim をインストールしてください。
root #emerge --ask app-editors/gvimVim はパッケージをサポートしています。これは、機能を拡張するための機構をネイティブで提供するものです。さらなる情報については、パッケージについての組み込みドキュメントをお読みください: :help packages
app-vimカテゴリには、追加のシンタックス定義や、プラグイン、その他 vim に関連するものがたくさん用意してあります。
app-vimカテゴリ内の利用可能なパッケージの概要を見るには、emerge または eix が使えます。
user $emerge --search "%@^app-vim"
user $eix -cC app-vimGentoo リポジトリで利用できない Vim プラグインもあります。現在の Vim は、プラグインをインストールする手段としてネイティブパッケージを含んでおり、Vim のためのプラグインマネージャもいくつかあります。
Vimは各ユーザー毎に設定したり、あるいはシステム全体の設定ファイルで設定をすることができます。
バージョン 9.1.0327 から、Vim freedesktop XDG Base Directory Specification を採用しています: つまり、設定ファイルを ~/.config/vim/ の下に置けるようになったので、そうすれば Vim がホームディレクトリを散らかすことはなくなるでしょう。
root や他のユーザと、同じコンフィグを共有したいですか? コンフィグをソフトリンクしてください:
root #ln -s /home/someUserName/.config/vim /root/.config/vimたくさんのカラースキームが Vim のコアパッケージとともに提供されています。それらは、ラストラインモードで colorscheme と打ち (後に空白を続けて)、+ を打つか、あるいは を 2 回打つことで一覧が表示されます。
:colorscheme blue darkblue default delek desert elflord evening industry koehler morning murphy pablo peachpuff ron shine slate torte zellner
カラースキームはVimのラストラインモードで、colorscheme(もしくはcolo)で変更できます。
:colorscheme peachpuffカラースキームは .vimrc ファイルによって永続的に適用できます。有効にするには syntax on の行も必要であることに注意してください:
~/.vimrccolorscheme peachpuff syntax on
初めの行で、デフォルトのカラースキームを設定しています。次の行でカラースキームを有効にしています。
Vim がインストールされていて、かつ Vim しかインストールされていない場合、vi コマンドは Vim を起動するはずです。他の vi ライクなエディタがインストールされている場合は、eselectを使って、vi コマンドがどのエディタを起動するか選択することができます。
Vim をシステムデフォルトエディタとして設定したい場合は、システムデフォルトエディタを設定するために text editor の記事も参考にできるでしょう。
vim 内で Gentoo 構文プラグイン (app-vim/gentoo-syntax) のサポートを有効化するには、ユーザの ~/.vimrc ファイルに次の行を追加してください:
~/.vimrcfiletype plugin on filetype indent on
コマンドラインからは:
user $vim --helpvim --help VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Nov 26 2021 11:56:27) Usage: vim [arguments] [file ..] edit specified file(s) or: vim [arguments] - read text from stdin or: vim [arguments] -t tag edit file where tag is defined or: vim [arguments] -q [errorfile] edit file with first error Arguments: -- Only file names after this -v Vi mode (like "vi") -e Ex mode (like "ex") -E Improved Ex mode -s Silent (batch) mode (only for "ex") -d Diff mode (like "vimdiff") -y Easy mode (like "evim", modeless) -R Readonly mode (like "view") -Z Restricted mode (like "rvim") -m Modifications (writing files) not allowed -M Modifications in text not allowed -b Binary mode -l Lisp mode -C Compatible with Vi: 'compatible' -N Not fully Vi compatible: 'nocompatible' -V[N][fname] Be verbose [level N] [log messages to fname] -D Debugging mode -n No swap file, use memory only -r List swap files and exit -r (with file name) Recover crashed session -L Same as -r -A Start in Arabic mode -H Start in Hebrew mode -T <terminal> Set terminal type to <terminal> --not-a-term Skip warning for input/output not being a terminal --ttyfail Exit if input or output is not a terminal -u <vimrc> Use <vimrc> instead of any .vimrc --noplugin Don't load plugin scripts -p[N] Open N tab pages (default: one for each file) -o[N] Open N windows (default: one for each file) -O[N] Like -o but split vertically + Start at end of file +<lnum> Start at line <lnum> --cmd <command> Execute <command> before loading any vimrc file -c <command> Execute <command> after loading the first file -S <session> Source file <session> after loading the first file -s <scriptin> Read Normal mode commands from file <scriptin> -w <scriptout> Append all typed commands to file <scriptout> -W <scriptout> Write all typed commands to file <scriptout> -x Edit encrypted files --startuptime <file> Write startup timing messages to <file> -i <viminfo> Use <viminfo> instead of .viminfo --clean 'nocompatible', Vim defaults, no plugins, no viminfo -h or --help Print Help (this message) and exit --version Print version information and exit
設定することで、Vim を起動するために vi コマンドを使うこともできます。
既にあるファイルを開くか、新しいファイルを作成するには、名前を指定してください:
user $vim <ファイル名>Vim には 30 分程度で読み終わるチュートリアルが組み込まれています。vimtutor コマンドを使ってチュートリアルを開始できます。
user $vimtutorVimをワンライナー(変更を施すために、使い捨てのスクリプトやコマンドラインで使われるコマンド)として使うことが可能です。
例えば、次のコマンドは#をfile.txtファイルの各行の先頭に追加します。
user $vim -c ":%s/^/#/g" -c ":x" file.txt何が起こっているかというと、Vimが(-cオプションによって)与えられたコマンドを解釈しています。初めのコマンドはVimの(sedのものと非常に似ている)置換コマンドで、次のコマンドはVimに保存とエディタの終了を命じています。
ファイルのエンコードを UTF-8 に変更するには、(ラストラインモードで) 次のコマンドを実行してください。
:e ++enc=utf8前に示した小技の通り、同じようにコマンドラインからこれを行うことも可能です。
user $vim -c ":wq! ++enc=utf8" file.txt事前に使い方を学習せずに vim に入ってしまった人にとって、終了する方法は明らかではないかもしれません。
を何回か押した後、、、 を押してください。保存せずに終了するには、 を何回か押した後、、、、 です。
いくつか開いているファイルがある場合は、 を何回か押した後、、、、 を押してください。保存せずに終了するには、 を何回か押した後、、、、、 です。
もし上の方法でどうにもならず、どうしてもという場合は、(別のターミナルから) killall vim を実行するような方法が最終手段として考えられます。これはユーザのすべての vim セッションを保存せずに終了させることに注意してください。このようなコマンドを root として実行した場合、システム上のすべてのユーザのすべての vim セッションを終了させるでしょう。
Vim バッファに次のテキストを貼り付けようとしたとします:
some: yaml: - data - structured in: - this - shape that: - VIM - may not: like
Vim はこれに自動タブを行うように解釈して、貼り付けたいテキストを壊してしまうかもしれません:
some: yaml: - data - structured in: - this - shape that: - VIM - may not: like
これを正しい方法で行うには、次のコマンドを実行してください: Vim のペーストモードを有効化するために :set paste。ペーストが完了したら、元の設定に戻るために :set nopaste を使用することができます。
user $vim foobarE1187: Failed to source defaults.vim Press ENTER or type command to continue
8.2.4328 の安定化解除によって解消したようです。
sphinx2-buildをsphinx-buildに変更し、./makedist.shを実行してください。./dist/vimpourleshumains/内のPDFを読んでください。