Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
Help us understand the problem. What is going on with this article?

fishshell で Enter 押したときに ls と git status を表示する

More than 3 years have passed since last update.

http://qiita.com/yuyuchu3333/items/e9af05670c95e2cc5b4d
こちらの fish 版です。

以下の conf では CTRL-j に割り当てています。

fish.conf
function do_enter
  set -l query (commandline)

  if test -n $query
    echo
    eval $query
    commandline ''
  else
    echo
    ls
    if test (git rev-parse --is-inside-work-tree 2> /dev/null)
      echo
      echo -e "\e[0;33m--- git status ---\e[0m"
      git status -sb
    end
  end
  commandline -f repaint
end

function fish_user_key_bindings
  bind \cj do_enter
end

fish の version は 2.3.1 です。

fishshell は不慣れなのでもっといい書き方があるかもしれません。
不具合も含んでいるかもしれません。

marcy_o
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away