1
0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2025-12-12 15:34:50 +08:00

Compare commits

...

3 Commits

Author SHA1 Message Date
Harry
0bcecf2f63
dotnet: use official dotnet completion (#8518) 2020-02-15 19:19:57 +01:00
Roman
aa4146a9a4
git: add alias for git stash --include-untracked (#8617) 2020-02-15 18:28:02 +01:00
Manuel Silva
72168aec3d
cloudapp: fix copy-paste mistake in README (#8629) 2020-02-15 18:26:20 +01:00
5 changed files with 21 additions and 106 deletions

View File

@ -5,7 +5,7 @@
To use it, add `cloudapp` to the plugins array of your `~/.zshrc` file: To use it, add `cloudapp` to the plugins array of your `~/.zshrc` file:
``` ```
plugins=(... dash) plugins=(... cloudapp)
``` ```
## Requirements ## Requirements

View File

@ -20,4 +20,4 @@ plugins=(... dotnet)
| ds | dotnet sln | Modify Visual Studio solution files. | | ds | dotnet sln | Modify Visual Studio solution files. |
| da | dotnet add | Add a package or reference to a .NET project. | | da | dotnet add | Add a package or reference to a .NET project. |
| dp | dotnet pack | Create a NuGet package. | | dp | dotnet pack | Create a NuGet package. |
| dng | dotnet nuget | Provides additional NuGet commands. | | dng | dotnet nuget | Provides additional NuGet commands. |

View File

@ -1,114 +1,27 @@
# --------------------------------------------------------------------- # # This scripts is copied from (MIT License):
# Aliases and Completions for .NET Core (https://dotnet.microsoft.com/) # # https://github.com/dotnet/toolset/blob/master/scripts/register-completions.zsh
# Author: Shaun Tabone (https://github.com/xontab) #
# --------------------------------------------------------------------- #
# Helper function to cache and load completions _dotnet_zsh_complete()
local cache_base_path="${ZSH_CACHE_DIR}/dotnet_" {
_dotnet_cache_completion() { local completions=("$(dotnet complete "$words")")
local cache="${cache_base_path}$(echo $1)_completion"
if [[ ! -f $cache ]]; then
$2 $cache
fi
[[ -f $cache ]] && cat $cache # If the completion list is empty, just continue with filename selection
if [ -z "$completions" ]
then
_arguments '*::arguments: _normal'
return
fi
# This is not a variable assigment, don't remove spaces!
_values = "${(ps:\n:)completions}"
} }
_dotnet_cache_completion_cleanup() { compdef _dotnet_zsh_complete dotnet
local cache="${cache_base_path}$(echo $1)_completion"
rm -f $cache
}
# --------------------------------------------------------------------- # # Aliases bellow are here for backwards compatibility
# dotnet new # # added by Shaun Tabone (https://github.com/xontab)
# ALIAS: dn #
# --------------------------------------------------------------------- #
_dotnet_new_completion() {
if [ $commands[dotnet] ]; then
dotnet new -l | tail -n +21 | sed 's/ \+/:/g' | cut -d : -f 2 >$1
fi
}
_dotnet_new_completion_cached() {
_dotnet_cache_completion 'new' _dotnet_new_completion
}
_dotnet_cache_completion_cleanup 'new'
alias dn='dotnet new' alias dn='dotnet new'
# --------------------------------------------------------------------- #
# dotnet #
# --------------------------------------------------------------------- #
_dotnet() {
if [ $CURRENT -eq 2 ]; then
_arguments \
'--diagnostics[Enable diagnostic output.]' \
'--help[Show command line help.]' \
'--info[Display .NET Core information.]' \
'--list-runtimes[Display the installed runtimes.]' \
'--list-sdks[Display the installed SDKs.]' \
'--version[Display .NET Core SDK version in use.]'
_values \
'add[Add a package or reference to a .NET project.]' \
'build[Build a .NET project.]' \
'build-server[Interact with servers started by a build.]' \
'clean[Clean build outputs of a .NET project.]' \
'help[Show command line help.]' \
'list[List project references of a .NET project.]' \
'msbuild[Run Microsoft Build Engine (MSBuild) commands.]' \
'new[Create a new .NET project or file.]' \
'nuget[Provides additional NuGet commands.]' \
'pack[Create a NuGet package.]' \
'publish[Publish a .NET project for deployment.]' \
'remove[Remove a package or reference from a .NET project.]' \
'restore[Restore dependencies specified in a .NET project.]' \
'run[Build and run a .NET project output.]' \
'sln[Modify Visual Studio solution files.]' \
'store[Store the specified assemblies in the runtime package store.]' \
'test[Run unit tests using the test runner specified in a .NET project.]' \
'tool[Install or manage tools that extend the .NET experience.]' \
'vstest[Run Microsoft Test Engine (VSTest) commands.]' \
'dev-certs[Create and manage development certificates.]' \
'fsi[Start F# Interactive / execute F# scripts.]' \
'sql-cache[SQL Server cache command-line tools.]' \
'user-secrets[Manage development user secrets.]' \
'watch[Start a file watcher that runs a command when files change.]'
return
fi
if [ $CURRENT -eq 3 ]; then
case ${words[2]} in
"new")
compadd -X ".NET Installed Templates" $(_dotnet_new_completion_cached)
return
;;
"sln")
_values \
'add[Add one or more projects to a solution file.]' \
'list[List all projects in a solution file.]' \
'remove[Remove one or more projects from a solution file.]'
return
;;
"nuget")
_values \
'delete[Deletes a package from the server.]' \
'locals[Clears or lists local NuGet resources such as http requests cache, packages folder, plugin operations cache or machine-wide global packages folder.]' \
'push[Pushes a package to the server and publishes it.]'
return
;;
esac
fi
_arguments '*::arguments: _normal'
}
compdef _dotnet dotnet
# --------------------------------------------------------------------- #
# Other Aliases #
# --------------------------------------------------------------------- #
alias dr='dotnet run' alias dr='dotnet run'
alias dt='dotnet test' alias dt='dotnet test'
alias dw='dotnet watch' alias dw='dotnet watch'

View File

@ -154,6 +154,7 @@ plugins=(... git)
| gstl | git stash list | | gstl | git stash list |
| gstp | git stash pop | | gstp | git stash pop |
| gsts | git stash show --text | | gsts | git stash show --text |
| gstu | git stash --include-untracked |
| gstall | git stash --all | | gstall | git stash --all |
| gsu | git submodule update | | gsu | git submodule update |
| gsw | git switch | | gsw | git switch |

View File

@ -236,6 +236,7 @@ alias gstd='git stash drop'
alias gstl='git stash list' alias gstl='git stash list'
alias gstp='git stash pop' alias gstp='git stash pop'
alias gsts='git stash show --text' alias gsts='git stash show --text'
alias gstu='git stash --include-untracked'
alias gstall='git stash --all' alias gstall='git stash --all'
alias gsu='git submodule update' alias gsu='git submodule update'
alias gsw='git switch' alias gsw='git switch'