5
5

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.

oh-my-zshの大量のaliasをpecoで絞り込む

Last updated at Posted at 2014-09-17

oh-my-zshで大量のaliasが作成されているのだけれども多すぎて。。。

ふとpecoでalias確認できれば使えるんじゃないかと思いやってみた。

~/.zshrc
function peco-alias(){
  TARGET_ALIAS=$(alias | peco --query "$LBUFFER")
  BUFFER=$(echo "$TARGET_ALIAS"|awk -F '=' '{print $1}')
  CURSOR=$#BUFFER
  zle clear-screen
}
zle -N peco-alias
bindkey '^@^a' peco-alias

結構、良い感じに使えそうだ。

一応、設定ファイルも貼っとく。
https://github.com/astrsk-hori/dotfiles/blob/master/.zshrc.peco

5
5
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
5
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?