24
22

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 5 years have passed since last update.

🐟 fish-shell と fisherman の tips

Last updated at Posted at 2016-04-23

:pencil: 随時更新

はじめに

これは fisherman の issue などで聞かれたことを今後のためにまとめたものです。自分のためのものだけでなく、誰かが同じような問題にあった時にここを見て解決できればと思い公開しています。間違いなどありましたら気軽に編集リクエストを送っていただくかコメントをお願いします。

fish-shell

Name: fish-shell
GitHub: https://github.com/fish-shell/fish-shell
Gitter: https://gitter.im/fish-shell/fish-shell

fisherman

Name: fisherman
GitHub: https://github.com/fisherman/fisherman
Slack: https://fisherman-wharf.herokuapp.com/

日本語での質問がありましたら、Slack にログイン後 #japanese チャネルに質問お願いします。

v1系 から v2.0 系へのアップグレード

:information_source: How to upgrade to fisherman ≥ 2.0 from an old version ( ≤ 1.5) #241

fisherman 2.0 へのアップグレード:

curl -L git.io/fisher-up-me | fish

何をしているか確認したい場合:

curl -L git.io/fisher-up-me | fish_indent --ansi

これまで fisherman v1 系では ~/.config/fisherman というディレクトリを作成していましたがそれは v2 系になって ~/.config/fish/functions/fisher.fish というファイルを作成するようになりました。そして v2 系にすることで先程の ~/.config/fisherman~/.config/fisherman-you-can-delete-me という名前に変更されるので削除することができます。

omf から fisherman への移行方法:

:information_source: Is there any migration guide from omf to fisherman? #223

1. fisherman をインストール:

curl -Lo ~/.config/fish/functions/fisher.fish --create-dirs git.io/fisherman

2. If you happen to be also running any fisherman before 2.0 alongside omf

curl -L git.io/fisher-up-me | fish

3. omf のプラグインを _/.config/fish/fishfile に書き込んで fisher を実行

Add the plugins manually oh-my-fish/plugin-- and for themes add oh-my-fish/theme--, to install the git flow plugin and theme agnoster we will add these two lines:

~/.config/fish/fisherfile
oh-my-fish/plugin-git-flow
oh-my-fish/theme-agnoster

プラグインをインストール:

fisher

If you are using the new omf version this script will add your omf plugins to the fisherman file and then installs them, if you are using the old omf version this script will only this only installs plugins, for themes you must add oh-my-fish/theme- to the fishfile

migrate-omf-to-fisherman.sh
if test -f ~/.config/omf/bundle
  set bundle (cat ~/.config/omf/bundle)
  cd ~/.config/fish
  for plugin in $bundle
    set pluginName (echo $plugin |  sed "s/ /\n/g")

    if [ $pluginName[1] = "theme" ]
      set baseName "oh-my-fish/theme-"
    else if [ $pluginName[2] = "nvm" ]
      set baseName "fisherman/"
    else if [ $pluginName[2] = "bass" ]
      set "edc/"
    else
      set baseName "oh-my-fish/plugin-"
    end

    echo $baseName$pluginName[2] >> fishfile
  end
else
  cd ~/.config/fish
  for plugin in $OMF_CONFIG/*
    echo "$plugin" >> fishfile
  end
end
fisher

4. omf ディレクトリとファイルの削除

最新の omf を使っている場合:

omf destroy

そうでない場合:

rm -rf "$OMF_PATH" "$OMF_CONFIG"
$EDITOR ~/.config/fish/config.fish

### ERASE LINE   set -gx OMF_PATH "{{OMF_PATH}}"
### ERASE LINE   set -gx OMF_CONFIG "{{OMF_CONFIG}}"
### ERASE LINE   source $OMF_PATH/init.fish

Fisherman のプラグインの作り方

インストール:

$ fisher fishkit

プラグイン作成:

$ fishkit
❯ What's your plugin name?
❯ What's your plugin about?
❯ What's your GitHub username?
awk: can't open file /Users/sota/.cache/fisherman/.index
 source line number 4
  .editorconfig
  .gitignore
  .travis.yml
  completions/test.fish
  functions/test.fish
  LICENSE
  README.md
  test/test.fish

プラグイン表示:

fisher ls simple

例:

fisher ls simple                                                                                                                                       14:44
/Users/<user>/.config/fisherman/simple
    .editorconfig
    .gitignore
    fishfile
    functions/
        fish_prompt.fish
        fish_right_prompt.fish
    LICENSE
    README.md
    Tomorrow Night Eighties.itermcolors
24
22
11

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
24
22

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?