mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-12 15:34:50 +08:00
Compare commits
4 Commits
22cf7159ec
...
83aa984d1a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
83aa984d1a | ||
|
|
f362b69df6 | ||
|
|
d88fbe625f | ||
|
|
1c300d3a76 |
@ -199,3 +199,12 @@ function git_current_user_name() {
|
||||
function git_current_user_email() {
|
||||
command git config user.email 2>/dev/null
|
||||
}
|
||||
|
||||
# Output the name of the root directory of the git repository
|
||||
# Usage example: $(git_repo_name)
|
||||
function git_repo_name() {
|
||||
local repo_path
|
||||
if repo_path="$(git rev-parse --show-toplevel 2>/dev/null)" && [[ -n "$repo_path" ]]; then
|
||||
echo ${repo_path:t}
|
||||
fi
|
||||
}
|
||||
|
||||
@ -50,6 +50,7 @@ alias mv='mv -i'
|
||||
|
||||
# zsh is able to auto-do some kungfoo
|
||||
# depends on the SUFFIX :)
|
||||
autoload -Uz is-at-least
|
||||
if is-at-least 4.2.0; then
|
||||
# open browser on urls
|
||||
if [[ -n "$BROWSER" ]]; then
|
||||
|
||||
@ -10,12 +10,14 @@ plugins=(... dotnet)
|
||||
|
||||
## Aliases
|
||||
|
||||
| Alias | Command | Description |
|
||||
|-------|--------------|-------------------------------------------------------------------|
|
||||
| dn | dotnet new | Create a new .NET project or file. |
|
||||
| dr | dotnet run | Build and run a .NET project output. |
|
||||
| dt | dotnet test | Run unit tests using the test runner specified in a .NET project. |
|
||||
| ds | dotnet sln | Modify Visual Studio solution files. |
|
||||
| da | dotnet add | Add a package or reference to a .NET project. |
|
||||
| dp | dotnet pack | Create a NuGet package. |
|
||||
| dng | dotnet nuget | Provides additional NuGet commands. |
|
||||
| Alias | Command | Description |
|
||||
|-------|------------------|-------------------------------------------------------------------|
|
||||
| dn | dotnet new | Create a new .NET project or file. |
|
||||
| dr | dotnet run | Build and run a .NET project output. |
|
||||
| dt | dotnet test | Run unit tests using the test runner specified in a .NET project. |
|
||||
| dw | dotnet watch | Watch for source file changes and restart the dotnet command. |
|
||||
| dwr | dotnet watch run | Watch for source file changes and restart the `run` command. |
|
||||
| ds | dotnet sln | Modify Visual Studio solution files. |
|
||||
| da | dotnet add | Add a package or reference to a .NET project. |
|
||||
| dp | dotnet pack | Create a NuGet package. |
|
||||
| dng | dotnet nuget | Provides additional NuGet commands. |
|
||||
@ -111,6 +111,8 @@ compdef _dotnet dotnet
|
||||
# --------------------------------------------------------------------- #
|
||||
alias dr='dotnet run'
|
||||
alias dt='dotnet test'
|
||||
alias dw='dotnet watch'
|
||||
alias dwr='dotnet watch run'
|
||||
alias ds='dotnet sln'
|
||||
alias da='dotnet add'
|
||||
alias dp='dotnet pack'
|
||||
|
||||
@ -28,8 +28,8 @@ alias mkdir='mkdir -pv'
|
||||
alias psmem='ps -e -orss=,args= | sort -b -k1,1n'
|
||||
alias psmem10='ps -e -orss=,args= | sort -b -k1,1n| head -10'
|
||||
# get top process eating cpu if not work try excute : export LC_ALL='C'
|
||||
alias pscpu='ps -e -o pcpu,cpu,nice,state,cputime,args|sort -k1 -nr'
|
||||
alias pscpu10='ps -e -o pcpu,cpu,nice,state,cputime,args|sort -k1 -nr | head -10'
|
||||
alias pscpu='ps -e -o pcpu,cpu,nice,state,cputime,args|sort -k1,1n -nr'
|
||||
alias pscpu10='ps -e -o pcpu,cpu,nice,state,cputime,args|sort -k1,1n -nr | head -10'
|
||||
# top10 of the history
|
||||
alias hist10='print -l ${(o)history%% *} | uniq -c | sort -nr | head -n 10'
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user