12
13

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

oh-my-zshを使って, コマンドのオプション補完を追加

Last updated at Posted at 2013-01-07

oh-my-zsh

まず, oh-my-zshをダウンロードする.

$ git clone https://github.com/robbyrussell/oh-my-zsh.git
オプション補完を追加できるコマンドの一覧 (編集時点)
$ ls ./oh-my-zsh/plugins/**/_* | gawk -F/ '{print $NF}'
_adb
_autopep8
_bazel
_boot2docker
_bower
_bundler
_capistrano
_cargo
_celery
_codeclimate
_coffee
_cpanm
_dnote
_docker-compose
_docker-machine
_docker
_extract
_fab
_fd
_flutter
_frontend-search.sh
_gas
_gatsby
_gb
_geeknote
_gem
_git
_hub
_asadmin
_gradle
_httpie
_ipfs
_jira
_kitchen
_knife
_artisan
_lein
_port
_meteor
_mix
_nanoc
_nomad
_nvm
_security
_pass
_pep8
_pip
_pod
_powder
_powify
_pylint
_rails
_react-native
_rebar
_redis-cli
_repo
_ripgrep
_ros
_rust
_rustup
_salt
_sbt
_scala
_scd
_scw
_sfdx
_spring
_supervisorctl
_supervisord
_swift
_task
_terminitor
_terraform
_thor
_tmux-cssh
_tmuxinator
_tugboat
_ufw
_vagrant
_vault
_wake
_wd.sh
_xcselv
_yarn
_zeus
_n-kill

設定

上の中から, 例えば, docker, terraform, pipのオプション補完を追加する場合は,
以下のように$fpathを追加する.
(ただし, $fpathcompinitより前に書く. )

~/.zshrc
# fpathの追加
for cmd in docker terraform pip ; do
    fpath=(/path/to/oh-my-zsh/plugins/$cmd $fpath)
done

# 補完を有効化
autoload -Uz compinit
compinit -u

~/.zshrcの再読み込み後, これらのコマンドでオプション補完が有効になる.

12
13
2

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
12
13

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?