0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

zshのフレームワークzimfwを設定してターミナルを便利にする

0
Posted at

やる事

zshのzimfwを入れて以下の機能ができるようにします

  • Ctrl + r でコマンド履歴をあいまい検索できるように
  • コマンドの入力補完

環境

Ubuntu Gnome 25.10
標準?のUbuntuです。

シェルをzshに変更する

sudo apt install zsh
chsh -s /usr/bin/zsh

これでzshがインストールされて、デフォルトで起動するシェルがzshになります。

いま動いているシェルを確認する方法

以下のコマンドで今動いているシェルがわかります。

env | grep SHELL

zimfwをインストールする

curl -fsSL https://raw.githubusercontent.com/zimfw/install/master/install.zsh | zsh

設定ファイルに以下を追記

~/.zimrc
zmodule fzf
sudo apt install fzf bat

batパッケージを入れるとbatcatコマンドがインストールされますが、zimfwのfzfモジュールでbatコマンドを要求されるのでalias設定します。

~/.zshrc
alias bat="batcat"

ここで一旦ターミナル再起動などします。

動作確認

これらの設定で以下の機能が動くようになり便利になります。
今回はfzfのみ追加しましたが、他にも色々なモジュールがあります。

コマンドの補完

コマンドを途中まで入力すると、補完候補が出るようになる

image.png

コマンド履歴のあいまい検索

Ctrl + rでコマンド履歴を検索できるようになります。
(fzfコマンドが必要)

image.png

ファイル一覧とプレビュー

Ctrl + tでカレントディレクトリのファイル一覧と、プレビュー表示ができます。
(batコマンドが必要)

image.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?