1
1

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 1 year has passed since last update.

zsh: ファイルをリロードするウィジェットを作っておくと便利

Last updated at Posted at 2023-10-19

~/.zshrcに下記の設定を書いておくと C-x ../reloadというファイルがリロードされる。

_reload-file() {
    local file='./reload'
    if [ ! -e $file ]; then
        zle -M "No such file: ${file}"
        return
    fi
    . "$file"
}
zle -N _reload-file
bindkey '^X.' _reload-file

補完関数やウィジェットを自作しているとき、これを使えば現在行を保ったままファイルをリロードできるので便利。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?