LoginSignup
2
3

More than 5 years have passed since last update.

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

Posted at

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 は不慣れなのでもっといい書き方があるかもしれません。
不具合も含んでいるかもしれません。

2
3
1

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
2
3