conf2/zsh/.oh-my-zsh/plugins/dotnet/dotnet.plugin.zsh

33 lines
827 B
Bash
Raw Normal View History

2020-06-11 14:41:32 +00:00
# This scripts is copied from (MIT License):
# https://github.com/dotnet/toolset/blob/master/scripts/register-completions.zsh
2020-02-08 07:57:16 +00:00
2020-06-11 14:41:32 +00:00
_dotnet_zsh_complete()
{
local completions=("$(dotnet complete "$words")")
2020-02-08 07:57:16 +00:00
2020-06-11 14:41:32 +00:00
# If the completion list is empty, just continue with filename selection
if [ -z "$completions" ]
then
_arguments '*::arguments: _normal'
return
fi
2020-02-08 07:57:16 +00:00
2020-06-11 14:41:32 +00:00
# This is not a variable assigment, don't remove spaces!
_values = "${(ps:\n:)completions}"
2020-02-08 07:57:16 +00:00
}
2020-06-11 14:41:32 +00:00
compdef _dotnet_zsh_complete dotnet
2020-02-08 07:57:16 +00:00
2020-06-11 14:41:32 +00:00
# Aliases bellow are here for backwards compatibility
# added by Shaun Tabone (https://github.com/xontab)
2020-02-08 07:57:16 +00:00
alias dn='dotnet new'
alias dr='dotnet run'
alias dt='dotnet test'
2020-06-11 14:41:32 +00:00
alias dw='dotnet watch'
alias dwr='dotnet watch run'
2020-02-08 07:57:16 +00:00
alias ds='dotnet sln'
alias da='dotnet add'
alias dp='dotnet pack'
alias dng='dotnet nuget'