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?

More than 3 years have passed since last update.

fish環境でクソ便利なpecoを導入する

Posted at

はじめに

この記事は自分用に書いているので読んでもわかりにくいかもしれない。

あくまでも備忘録代わりで書かせてもらう。

この記事では、fish環境でpecoを導入する方法を記述する。

pecoとは

過去に入力したコマンドなどを閲覧・検索・使用できるコマンド
字面がもう便利

環境

Ubuntu 20.04 LTS

多分Ubuntuなら動く

必要なもの

fish

peco

oh-my-fish(peco導入時に使用)

導入

まずはfishの導入からです。(すでにfish導入済みの方はpecoの導入へ)
インストール
``` sudo apt-add-repository ppa:fish-shell/release-3; sudo apt update; sudo apt install fish; ```
デフォルトシェルにするためにgeditでshellのリストに追記する
``` sudo gedit /etc/shell; または sudo gedit /etc/shells; (私は後者だった) ```
gedit内
  # /etc/shells: valid login shells
  /bin/sh
  /bin/bash
  /usr/bin/bash
  /bin/rbash
  /usr/bin/rbash
  /bin/dash
  /usr/bin/dash
  /usr/bin/fish  <<<追加!!
デフォルトシェルに変更するコマンド
``` chsh -s /usr/bin/fish; ```
これでfishの導入は終わりです
続いてpecoの導入です。
pecoを入れるにはoh-my-fishが必要なので入れます
``` curl -L http://get.oh-my.fish | fish ```
その後、pecoを入れます。
``` omf install peco ```
しかしこのままではCtrl+Rでの呼び出しが出来ないままです。
なのでconfigファイルに記述します。
``` gedit .condig/fish/congig.fish ```
gedit内
``` #peco function fish_user_key_bindings bind \cr peco_select_history end ```
これでpecoの導入が完了です。
試しにCtrl+Rを押してみます。
``` clear cd .. cd sudo apt update sudo apt upgrade sudo apt-get update sudo apt-get upgrade sudo apt-add-repository ppa:fish-shell/release-3; sudo apt update; sudo apt install fish; sudo gedit /etc/shells; chsh -s /usr/bin/fish; curl -L http://get.oh-my.fish | fish omf install peco gedit .condig/fish/congig.fish QUERY>
<h5>最後の行にQUERYとありますが、ここでコマンドの検索が出来ます(部分一致)</h5>
<h5>↓↑キーで選んで実行できます。</h5>

<h2>あとがき</h2>

<p>まじで使いやすい</p>

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?