😄
[Linux]: zshを初期設定用ウィザードのメモ
[Linux]: zshを初期設定用ウィザードのメモ
zshを初回起動すると以下のような設定ウィザードが起動するので意味などを調べたメモ
設定ウィザード
This is the Z Shell configuration function for new users,
zsh-newuser-install.
You are seeing this message because you have no zsh startup files
(the files .zshenv, .zprofile, .zshrc, .zlogin in the directory
~). This function can help you with a few settings that should
make your use of the shell easier.
You can:
(q) Quit and do nothing. The function will be run again next time.
(0) Exit, creating the file ~/.zshrc containing just a comment.
That will prevent this function being run again.
(1) Continue to the main menu.
--- Type one of the keys in parentheses ---
日本語訳
これは新規ユーザー向けのZ Shellの設定機能、
zsh-newuser-installです。
zshの起動ファイル(ホームディレクトリ内の
.zshenv, .zprofile, .zshrc, .zloginファイル)が
存在しないため、このメッセージが表示されています。
この機能は、シェルの使用をより簡単にするための
いくつかの設定をサポートします。
次のオプションがあります:
(q) 終了して何もしない。この機能は次回再度実行されます。
(0) 終了して、コメントのみを含む~/.zshrcファイルを作成する。
これにより、この機能は再度実行されなくなります。
(1) メインメニューに進む。
--- 括弧内のキーのいずれかを入力してください ---
意味
q
その文章の通り終了し、次に起動した時また立ち上がる
0
ホームディレクトリに空の.zshrcファイルを作成する
1
対話による設定を行う
1を選択
Please pick one of the following options:
(1) Configure settings for history, i.e. command lines remembered
and saved by the shell. (Recommended.)
(2) Configure the new completion system. (Recommended.)
(3) Configure how keys behave when editing command lines. (Recommended.)
(4) Pick some of the more common shell options. These are simple "on"
or "off" switches controlling the shell's features.
(0) Exit, creating a blank ~/.zshrc file.
(a) Abort all settings and start from scratch. Note this will overwrite
any settings from zsh-newuser-install already in the startup file.
It will not alter any of your other settings, however.
(q) Quit and do nothing else. The function will be run again next time.
--- Type one of the keys in parentheses ---
日本語訳
(1) 履歴の設定、つまりシェルが記憶・保存するコマンドラインの設定。(推奨)
(2) 新しい補完システムの設定。(推奨)
(3) コマンドライン編集時のキーの動作設定。(推奨)
(4) よく使われるシェルオプションの設定。これらはシェルの機能を制御する
シンプルな「オン」または「オフ」のスイッチです。
(0) 終了して、空の~/.zshrcファイルを作成する。
(a) すべての設定を中止して最初からやり直す。これにより、
zsh-newuser-installによって起動ファイルに既に設定されている
設定は上書きされますが、その他の設定は変更されません。
(q) 終了して何もしない。この機能は次回再度実行されます。
--- 括弧内のキーの一つを入力してください ---
1を選択
1, 2, 3をそれぞれ選択すると入力するエディターライクなインターフェースが表示されるので、それぞれ入力する
History configuration
=====================
# (1) Number of lines of history kept within the shell.
HISTSIZE=1000 (not yet saved)
# (2) File where history is saved.
HISTFILE=~/.histfile (not yet saved)
# (3) Number of lines of history to save to $HISTFILE.
SAVEHIST=1000 (not yet saved)
# (0) Remember edits and return to main menu (does not save file yet)
# (q) Abandon edits and return to main menu
--- Type one of the keys in parentheses ---
履歴設定
=====================
# (1) シェル内で保持する履歴の行数
HISTSIZE=1000 (未保存)
# (2) 履歴が保存されるファイル
HISTFILE=~/.histfile (未保存)
# (3) $HISTFILEに保存する履歴の行数
SAVEHIST=1000 (未保存)
# (0) 編集を記憶してメインメニューに戻る(ファイルはまだ保存されません)
# (q) 編集を破棄してメインメニューに戻る
--- 括弧内のキーの一つを入力してください ---
0選択
The new completion system (compsys) allows you to complete
commands, arguments and special shell syntax such as variables. It provides
completions for a wide range of commonly used commands in most cases simply
by typing the TAB key. Documentation is in the zshcompsys manual page.
If it is not turned on, only a few simple completions such as filenames
are available but the time to start the shell is slightly shorter.
You can:
(1) Turn on completion with the default options.
(2) Run the configuration tool (compinstall). You can also run
this from the command line with the following commands:
autoload -Uz compinstall
compinstall
if you don't want to configure completion now.
(0) Don't turn on completion.
--- Type one of the keys in parentheses ---
日本語訳
新しい補完システム(compsys)では、コマンド、引数、変数などの
特別なシェル構文を補完できます。多くの場合、TABキーを押すだけで
よく使われるコマンドの幅広い補完を提供します。
ドキュメントはzshcompsysマニュアルページにあります。
このシステムが有効でない場合、ファイル名などの簡単な補完のみが
利用可能ですが、シェルの起動時間は若干短くなります。
次のオプションがあります:
(1) デフォルトオプションで補完を有効にする。
(2) 設定ツール(compinstall)を実行する。以下のコマンドで
コマンドラインからも実行できます:
autoload -Uz compinstall
compinstall
今は補完を設定したくない場合に使用してください。
(0) 補完を有効にしない。
--- 括弧内のキーの一つを入力してください ---
2選択
I haven't found any existing completion definitions.
If you have some already defined by compinstall, edit the name of the
file where these can be found. Note that this will only work if they
are exactly the form in which compinstall inserted them. If you leave
the line as it is, or empty, I won't search.
file> /home/test/.zshrc
Starting a new completion configuration from scratch.
This will be written to the new file /home/test/.zshrc.
Note that you will be given a chance to save the new setup
somewhere else at the end.
--- Hit newline to continue or `q' to exit without saving ---
日本語訳
既存の補完定義が見つかりませんでした。
compinstallによって既に定義されている場合は、それらが見つかる
ファイル名を編集してください。これは、compinstallが挿入した
正確な形式の場合にのみ機能することに注意してください。
行をそのままにするか、空にした場合、検索しません。
file> /home/test/.zshrc
新しい補完設定を最初から開始します。
これは新しいファイル /home/test/.zshrc に書き込まれます。
最後に新しい設定を別の場所に保存する機会が与えられます。
--- 続行するにはEnterキーを押すか、保存せずに終了するには`q`を押してください ---
Enterを連続で押すと次のようなインターフェースに移動する
compinstallのメインメニュー
好みの設定をいくつか選択して0を入力すると保存
compinstall: main menu
Note that hitting `q' in menus does not abort the set of changes from
lower level menus. However, quitting at top level will ensure that nothing
at all is actually written out.
1. Completers: choose completion behaviour for tasks such as
approximation, spell-checking, expansion.
2. Matching control: set behaviour for case-insensitive matching,
extended (partial-word) matching and substring matching.
3. Styles for changing the way completions are displayed and inserted.
4. Styles for particular completions.
c. Change context (plus more information on contexts).
q. Return without saving.
0. Save and exit.
--- Hit choice ---
日本語訳
*** compinstall: メインメニュー ***
メニューで`q`を押しても、下位レベルのメニューからの変更セットは
中止されないことに注意してください。ただし、トップレベルで終了すると、
実際には何も書き出されないことが保証されます。
1. 補完器:近似、スペルチェック、展開などのタスクの補完動作を選択。
2. マッチング制御:大文字小文字を区別しないマッチング、
拡張(部分語)マッチング、部分文字列マッチングの動作を設定。
3. 補完の表示と挿入方法を変更するスタイル。
4. 特定の補完のスタイル。
c. コンテキストの変更(コンテキストの詳細情報も含む)。
q. 保存せずに戻る。
0. 保存して終了。
--- 選択してください ---
対話が煩わしい場合は、自分で調べて追記していく方が楽だと思いました。
Discussion