mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-05 20:57:46 +08:00
Compare commits
4 Commits
fd51207701
...
2657c87f0a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2657c87f0a | ||
|
|
82856bfbd8 | ||
|
|
fb80eb8e05 | ||
|
|
1744277a68 |
5
.gitpod.Dockerfile
vendored
Normal file
5
.gitpod.Dockerfile
vendored
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
FROM gitpod/workspace-full
|
||||||
|
|
||||||
|
RUN sudo apt-get update && \
|
||||||
|
sudo apt-get install -y zsh && \
|
||||||
|
sudo rm -rf /var/lib/apt/lists/*
|
||||||
9
.gitpod.yml
Normal file
9
.gitpod.yml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
image:
|
||||||
|
file: .gitpod.Dockerfile
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- init: |
|
||||||
|
export EDITOR="command gp open -w" VISUAL="command gp open -w"
|
||||||
|
cp -f /workspace/ohmyzsh/templates/zshrc.zsh-template ~/.zshrc
|
||||||
|
ln -sf /workspace/ohmyzsh ~/.oh-my-zsh
|
||||||
|
command: exec zsh
|
||||||
@ -15,6 +15,7 @@ To learn more, visit [ohmyz.sh](https://ohmyz.sh), follow [@ohmyzsh](https://twi
|
|||||||
[](https://github.com/ohmyzsh/ohmyzsh/actions?query=workflow%3ACI)
|
[](https://github.com/ohmyzsh/ohmyzsh/actions?query=workflow%3ACI)
|
||||||
[](https://twitter.com/intent/follow?screen_name=ohmyzsh)
|
[](https://twitter.com/intent/follow?screen_name=ohmyzsh)
|
||||||
[](https://discord.gg/ohmyzsh)
|
[](https://discord.gg/ohmyzsh)
|
||||||
|
[](https://gitpod.io/#https://github.com/ohmyzsh/ohmyzsh)
|
||||||
|
|
||||||
## Getting Started
|
## Getting Started
|
||||||
|
|
||||||
|
|||||||
@ -26,6 +26,16 @@ if "$ZSH/tools/require_tool.sh" emacsclient 24 2>/dev/null ; then
|
|||||||
# create a new X frame
|
# create a new X frame
|
||||||
alias eframe='emacsclient --alternate-editor "" --create-frame'
|
alias eframe='emacsclient --alternate-editor "" --create-frame'
|
||||||
|
|
||||||
|
# Emacs ANSI Term tracking
|
||||||
|
if [[ -n "$INSIDE_EMACS" ]]; then
|
||||||
|
chpwd_emacs() { print -P "\033AnSiTc %d"; }
|
||||||
|
print -P "\033AnSiTc %d" # Track current working directory
|
||||||
|
print -P "\033AnSiTu %n" # Track username
|
||||||
|
|
||||||
|
# add chpwd hook
|
||||||
|
autoload -Uz add-zsh-hook
|
||||||
|
add-zsh-hook chpwd chpwd_emacs
|
||||||
|
fi
|
||||||
|
|
||||||
# Write to standard output the path to the file
|
# Write to standard output the path to the file
|
||||||
# opened in the current buffer.
|
# opened in the current buffer.
|
||||||
|
|||||||
@ -17,6 +17,9 @@ Then just press `SPACE` to trigger the expansion of a command you've written.
|
|||||||
If you only want to insert a space without expanding the command line, press
|
If you only want to insert a space without expanding the command line, press
|
||||||
`CTRL`+`SPACE`.
|
`CTRL`+`SPACE`.
|
||||||
|
|
||||||
|
if you would like to filter out any values from expanding set `GLOBALIAS_FILTER_VALUES` to
|
||||||
|
an array of said values. See [Filtered values](#filtered-values).
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
#### Glob expressions
|
#### Glob expressions
|
||||||
@ -37,7 +40,6 @@ $ ls folder/file.json anotherfolder/another.json
|
|||||||
$ mkdir "`date -R`"
|
$ mkdir "`date -R`"
|
||||||
# expands to
|
# expands to
|
||||||
$ mkdir Tue,\ 04\ Oct\ 2016\ 13:54:03\ +0300
|
$ mkdir Tue,\ 04\ Oct\ 2016\ 13:54:03\ +0300
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Aliases
|
#### Aliases
|
||||||
@ -60,3 +62,18 @@ $ S<space>
|
|||||||
# expands to:
|
# expands to:
|
||||||
$ sudo systemctl
|
$ sudo systemctl
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### Filtered values
|
||||||
|
|
||||||
|
```
|
||||||
|
# .zshrc
|
||||||
|
alias l='ls -lh'
|
||||||
|
alias la='ls --color=auto -lah'
|
||||||
|
GLOBALIAS_FILTER_VALUES=(l)
|
||||||
|
|
||||||
|
$ l<space>
|
||||||
|
# does not expand
|
||||||
|
$ la<space>
|
||||||
|
# expands to:
|
||||||
|
$ ls --color=auto -lah
|
||||||
|
```
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
globalias() {
|
globalias() {
|
||||||
zle _expand_alias
|
if [[ $GLOBALIAS_FILTER_VALUES[(Ie)$LBUFFER] -eq 0 ]]; then
|
||||||
zle expand-word
|
zle _expand_alias
|
||||||
|
zle expand-word
|
||||||
|
fi
|
||||||
zle self-insert
|
zle self-insert
|
||||||
}
|
}
|
||||||
zle -N globalias
|
zle -N globalias
|
||||||
|
|||||||
@ -16,8 +16,8 @@ plugins=(... systemadmin)
|
|||||||
| clr | `clear; echo Currently logged in on $TTY, as $USER in directory $PWD.` | Clears the screen and prints the current user, TTY, and directory |
|
| clr | `clear; echo Currently logged in on $TTY, as $USER in directory $PWD.` | Clears the screen and prints the current user, TTY, and directory |
|
||||||
| path | `print -l $path` | Displays PATH with each entry on a separate line |
|
| path | `print -l $path` | Displays PATH with each entry on a separate line |
|
||||||
| mkdir | `mkdir -pv` | Automatically create parent directories and display verbose output |
|
| mkdir | `mkdir -pv` | Automatically create parent directories and display verbose output |
|
||||||
| psmem | `ps -e -orss=,args= \| sort -b -k1,1n` | Display the processes using the most memory |
|
| psmem | `ps -e -orss=,args= \| sort -b -k1 -nr` | Display the processes using the most memory |
|
||||||
| psmem10 | `ps -e -orss=,args= \| sort -b -k1,1n \| head -10` | Display the top 10 processes using the most memory |
|
| psmem10 | `ps -e -orss=,args= \| sort -b -k1 -nr \| head -10` | Display the top 10 processes using the most memory |
|
||||||
| pscpu | `ps -e -o pcpu,cpu,nice,state,cputime,args \|sort -k1 -nr` | Display the top processes using the most CPU |
|
| pscpu | `ps -e -o pcpu,cpu,nice,state,cputime,args \|sort -k1 -nr` | Display the top processes using the most CPU |
|
||||||
| pscpu10 | `ps -e -o pcpu,cpu,nice,state,cputime,args \|sort -k1 -nr \| head -10` | Display the top 10 processes using the most CPU |
|
| pscpu10 | `ps -e -o pcpu,cpu,nice,state,cputime,args \|sort -k1 -nr \| head -10` | Display the top 10 processes using the most CPU |
|
||||||
| hist10 | `print -l ${(o)history%% *} \| uniq -c \| sort -nr \| head -n 10` | Display the top 10 most used commands in the history |
|
| hist10 | `print -l ${(o)history%% *} \| uniq -c \| sort -nr \| head -n 10` | Display the top 10 most used commands in the history |
|
||||||
|
|||||||
@ -25,8 +25,8 @@ alias clr='clear; echo Currently logged in on $TTY, as $USER in directory $PWD.'
|
|||||||
alias path='print -l $path'
|
alias path='print -l $path'
|
||||||
alias mkdir='mkdir -pv'
|
alias mkdir='mkdir -pv'
|
||||||
# get top process eating memory
|
# get top process eating memory
|
||||||
alias psmem='ps -e -orss=,args= | sort -b -k1,1n'
|
alias psmem='ps -e -orss=,args= | sort -b -k1 -nr'
|
||||||
alias psmem10='ps -e -orss=,args= | sort -b -k1,1n| head -10'
|
alias psmem10='ps -e -orss=,args= | sort -b -k1 -nr | head -10'
|
||||||
# get top process eating cpu if not work try excute : export LC_ALL='C'
|
# 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,1n -nr'
|
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'
|
alias pscpu10='ps -e -o pcpu,cpu,nice,state,cputime,args|sort -k1,1n -nr | head -10'
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user