mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-10-16 11:40:46 +00:00
Compare commits
11 commits
0c3aaeee79
...
6b7f8ff028
Author | SHA1 | Date | |
---|---|---|---|
|
6b7f8ff028 | ||
|
9bcafe1c27 | ||
|
3151c9c1a3 | ||
|
ac325a7cab | ||
|
ec7d01faf8 | ||
|
8c13f021bf | ||
|
e3e80b98b5 | ||
|
a84bc2dadd | ||
|
33ac2ee30f | ||
|
f709cd4548 | ||
|
8bc7960180 |
16 changed files with 89 additions and 37 deletions
2
.github/dependencies.yml
vendored
2
.github/dependencies.yml
vendored
|
@ -28,7 +28,7 @@ dependencies:
|
|||
plugins/wd:
|
||||
repo: mfaerevaag/wd
|
||||
branch: master
|
||||
version: tag:v0.7.1
|
||||
version: tag:v0.9.0
|
||||
precopy: |
|
||||
set -e
|
||||
rm -r test
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
certifi==2024.8.30
|
||||
charset-normalizer==3.3.2
|
||||
idna==3.8
|
||||
idna==3.9
|
||||
PyYAML==6.0.2
|
||||
requests==2.32.3
|
||||
semver==3.0.2
|
||||
urllib3==2.2.2
|
||||
urllib3==2.2.3
|
||||
|
|
|
@ -57,6 +57,16 @@ function takeurl() {
|
|||
cd "$thedir"
|
||||
}
|
||||
|
||||
function takezip() {
|
||||
local data thedir
|
||||
data="$(mktemp)"
|
||||
curl -L "$1" > "$data"
|
||||
unzip "$data" -d "./"
|
||||
thedir="$(unzip -l "$data" | awk 'NR==4 {print $4}' | sed 's/\/.*//')"
|
||||
rm "$data"
|
||||
cd "$thedir"
|
||||
}
|
||||
|
||||
function takegit() {
|
||||
git clone "$1"
|
||||
cd "$(basename ${1%%.git})"
|
||||
|
@ -65,6 +75,8 @@ function takegit() {
|
|||
function take() {
|
||||
if [[ $1 =~ ^(https?|ftp).*\.(tar\.(gz|bz2|xz)|tgz)$ ]]; then
|
||||
takeurl "$1"
|
||||
elif [[ $1 =~ ^(https?|ftp).*\.(zip)$ ]]; then
|
||||
takezip "$1"
|
||||
elif [[ $1 =~ ^([A-Za-z0-9]\+@|https?|git|ssh|ftps?|rsync).*\.git/?$ ]]; then
|
||||
takegit "$1"
|
||||
else
|
||||
|
|
|
@ -227,7 +227,7 @@ function _omz_git_prompt_status() {
|
|||
prefix_constant_map=(
|
||||
'\?\? ' 'UNTRACKED'
|
||||
'A ' 'ADDED'
|
||||
'M ' 'ADDED'
|
||||
'M ' 'MODIFIED'
|
||||
'MM ' 'MODIFIED'
|
||||
' M ' 'MODIFIED'
|
||||
'AM ' 'MODIFIED'
|
||||
|
|
|
@ -38,6 +38,7 @@ One can configure a few things:
|
|||
- `bgnotify_bell` enabled or disables the terminal bell (default true)
|
||||
- `bgnotify_threshold` sets the notification threshold time (default 6 seconds)
|
||||
- `function bgnotify_formatted` lets you change the notification. You can for instance customize the message and pass in an icon.
|
||||
- `bgnotify_extraargs` appends extra args to notifier (e.g. `-e` for notify-send to create a transient notification)
|
||||
|
||||
Use these by adding a function definition before the your call to source. Example:
|
||||
|
||||
|
|
|
@ -117,15 +117,15 @@ function bgnotify {
|
|||
local icon="$3"
|
||||
if (( ${+commands[terminal-notifier]} )); then # macOS
|
||||
local term_id=$(bgnotify_programid)
|
||||
terminal-notifier -message "$message" -title "$title" ${=icon:+-appIcon "$icon"} ${=term_id:+-activate "$term_id"} &>/dev/null
|
||||
terminal-notifier -message "$message" -title "$title" ${=icon:+-appIcon "$icon"} ${=term_id:+-activate "$term_id"} ${=bgnotify_extraargs:-} &>/dev/null
|
||||
elif (( ${+commands[growlnotify]} )); then # macOS growl
|
||||
growlnotify -m "$title" "$message"
|
||||
growlnotify -m "$title" "$message" ${=bgnotify_extraargs:-}
|
||||
elif (( ${+commands[notify-send]} )); then
|
||||
notify-send "$title" "$message" ${=icon:+--icon "$icon"}
|
||||
notify-send "$title" "$message" ${=icon:+--icon "$icon"} ${=bgnotify_extraargs:-}
|
||||
elif (( ${+commands[kdialog]} )); then # KDE
|
||||
kdialog --title "$title" --passivepopup "$message" 5
|
||||
kdialog --title "$title" --passivepopup "$message" 5 ${=bgnotify_extraargs:-}
|
||||
elif (( ${+commands[notifu]} )); then # cygwin
|
||||
notifu /m "$message" /p "$title" ${=icon:+/i "$icon"}
|
||||
notifu /m "$message" /p "$title" ${=icon:+/i "$icon"} ${=bgnotify_extraargs:-}
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
27
plugins/flatpak/README.md
Normal file
27
plugins/flatpak/README.md
Normal file
|
@ -0,0 +1,27 @@
|
|||
# Flatpak Plugin
|
||||
|
||||
This plugin adds some aliases and functions for Flatpak package manager using the `flatpak` command.
|
||||
|
||||
```zsh
|
||||
plugins=(... flatpak)
|
||||
```
|
||||
|
||||
## Aliases
|
||||
|
||||
| Alias | Command | Description |
|
||||
| :------- | :--------------------------- | :------------------------------------------------ |
|
||||
| flatin | `flatpak install` | Installs an application or runtime |
|
||||
| flatup | `flatpak update` | Update an installed application or runtime |
|
||||
| flatun | `flatpak uninstall` | Uninstall an installed application or runtime |
|
||||
| flatls | `flatpak list` | List installed apps and/or runtimes |
|
||||
| flatpin | `flatpak pin` | Pin a runtime to prevent automatic removal |
|
||||
| flatinf | `flatpak info` | Show info for installed app or runtime |
|
||||
| flathis | `flatpak history` | Show history |
|
||||
| flatrep | `flatpak repair` | Repair flatpak installation |
|
||||
| flatcfg | `flatpak config` | Configure flatpak |
|
||||
| flatbak | `flatpak create-usb` | Put applications or runtimes onto removable media |
|
||||
| flatmask | `flatpak mask` | Mask out updates and automatic installation |
|
||||
| flatfind | `flatpak search` | Search for remote apps/runtimes |
|
||||
| flatrun | `flatpak run` | Run an application |
|
||||
| flatps | `flatpak ps` | Enumerate running applications |
|
||||
| flatkill | `flatpak kill` | Stop a running application |
|
26
plugins/flatpak/flatpak.plugin.zsh
Normal file
26
plugins/flatpak/flatpak.plugin.zsh
Normal file
|
@ -0,0 +1,26 @@
|
|||
#
|
||||
# Flatpak
|
||||
#
|
||||
|
||||
# Manage installed applications and runtimes
|
||||
alias flatin='flatpak install'
|
||||
alias flatup='flatpak update'
|
||||
alias flatun='flatpak uninstall'
|
||||
alias flatls='flatpak list'
|
||||
|
||||
alias flatpin='flatpak pin'
|
||||
alias flatinf='flatpak info'
|
||||
alias flatrep='flatpak repair'
|
||||
alias flathis='flatpak history'
|
||||
alias flatcfg='flatpak config'
|
||||
alias flatbak='flatpak create-usb'
|
||||
|
||||
alias flatmask='flatpak mask'
|
||||
|
||||
# Find applications and runtimes
|
||||
alias flatfind='flatpak search'
|
||||
|
||||
# Manage running applications
|
||||
alias flatrun='flatpak run'
|
||||
alias flatps='flatpak ps'
|
||||
alias flatkill='flatpak kill'
|
|
@ -73,6 +73,7 @@ plugins=(... git)
|
|||
| `gcans!` | `git commit --verbose --all --signoff --no-edit --amend` |
|
||||
| `gcann!` | `git commit --verbose --all --date=now --no-edit --amend` |
|
||||
| `gc!` | `git commit --verbose --amend` |
|
||||
| `gcn` | `git commit --verbose --no-edit` |
|
||||
| `gcn!` | `git commit --verbose --no-edit --amend` |
|
||||
| `gcs` | `git commit -S` |
|
||||
| `gcss` | `git commit -S -s` |
|
||||
|
|
|
@ -197,6 +197,7 @@ alias gcan!='git commit --verbose --all --no-edit --amend'
|
|||
alias gcans!='git commit --verbose --all --signoff --no-edit --amend'
|
||||
alias gcann!='git commit --verbose --all --date=now --no-edit --amend'
|
||||
alias gc!='git commit --verbose --amend'
|
||||
alias gcn='git commit --verbose --no-edit'
|
||||
alias gcn!='git commit --verbose --no-edit --amend'
|
||||
alias gcf='git config --list'
|
||||
alias gdct='git describe --tags $(git rev-list --tags --max-count=1)'
|
||||
|
|
|
@ -19,7 +19,7 @@ Usage is simple... just take your json data and pipe it into the appropriate jso
|
|||
|
||||
### Supports NDJSON (Newline Delimited JSON)
|
||||
|
||||
The plugin also supports [NDJSON](http://ndjson.org/) input, which means all functions
|
||||
The plugin also supports [NDJSON](https://github.com/ndjson/ndjson-spec) input, which means all functions
|
||||
have an alternative function that reads and processes the input line by line. These
|
||||
functions have the same name except using `ndjson` instead of `json`:
|
||||
|
||||
|
|
|
@ -13,7 +13,6 @@ plugins=(... python)
|
|||
| Command | Description |
|
||||
| ---------------- | -------------------------------------------------------------------------------------- |
|
||||
| `py` | Runs `python3`. Only set if `py` is not installed. |
|
||||
| `ipython` | Runs the appropriate `ipython` version according to the activated virtualenv |
|
||||
| `pyfind` | Finds .py files recursively in the current directory |
|
||||
| `pyclean [dirs]` | Deletes byte-code and cache files from a list of directories or the current one |
|
||||
| `pygrep <text>` | Looks for `text` in `*.py` files in the current directory, recursively |
|
||||
|
|
|
@ -43,9 +43,6 @@ function pyuserpaths() {
|
|||
# Grep among .py files
|
||||
alias pygrep='grep -nr --include="*.py"'
|
||||
|
||||
# Run proper IPython regarding current virtualenv (if any)
|
||||
alias ipython='python3 -c "import sys; del sys.path[0]; import IPython; sys.exit(IPython.start_ipython())"'
|
||||
|
||||
# Share local directory as a HTTP server
|
||||
alias pyserver="python3 -m http.server"
|
||||
|
||||
|
|
|
@ -115,9 +115,11 @@ wd() {
|
|||
|
||||
3. Install manpage (optional):
|
||||
|
||||
Move manpage into an appropriate directory, then trigger `mandb` to discover it
|
||||
|
||||
```zsh
|
||||
sudo cp ~/.local/wd/wd.1 /usr/share/man/man1/wd.1
|
||||
sudo chmod 644 /usr/share/man/man1/wd.1
|
||||
sudo install -m 644 ~/.local/wd/wd.1 /usr/share/man/man1/wd.1
|
||||
sudo mandb /usr/share/man/man1
|
||||
```
|
||||
|
||||
**Note:** when pulling and updating `wd`, you'll need to repeat step 3 should the manpage change
|
||||
|
@ -139,10 +141,11 @@ rm -f ~/.zcompdump; compinit
|
|||
|
||||
## Browse
|
||||
|
||||
If you want to make use of the `fzf`-powered browse feature to fuzzy search through all your warp points, set up a keybind in your `.zshrc`:
|
||||
`wd` comes with an `fzf`-powered browse feature to fuzzy search through all your warp points. It's available through the `wd browse` command. For quick access you can set up an alias or keybind in your `.zshrc`:
|
||||
|
||||
```zsh
|
||||
bindkey ${FZF_WD_BINDKEY:-'^B'} fuzzy_wd_widget
|
||||
# ctrl-b to open the fzf browser
|
||||
bindkey ${FZF_WD_BINDKEY:-'^B'} wd_browse_widget
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
@ -255,12 +258,6 @@ wd --version
|
|||
wd --config ./file <command>
|
||||
```
|
||||
|
||||
* Force `exit` with return code after running. This is not default, as it will *exit your terminal*, though required for testing/debugging.
|
||||
|
||||
```zsh
|
||||
wd --debug <command>
|
||||
```
|
||||
|
||||
* Silence all output:
|
||||
|
||||
```zsh
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/bin/zsh
|
||||
#!/usr/bin/env zsh
|
||||
|
||||
# WARP DIRECTORY
|
||||
# ==============
|
||||
|
@ -18,4 +18,3 @@ zle -N wd_browse_widget
|
|||
zle -N wd_restore_buffer
|
||||
autoload -Uz add-zle-hook-widget
|
||||
add-zle-hook-widget line-init wd_restore_buffer
|
||||
bindkey ${FZF_WD_BINDKEY:-'^B'} wd_browse_widget
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/bin/zsh
|
||||
#!/usr/bin/env zsh
|
||||
|
||||
# WARP DIRECTORY
|
||||
# ==============
|
||||
|
@ -8,7 +8,7 @@
|
|||
# @github.com/mfaerevaag/wd
|
||||
|
||||
# version
|
||||
readonly WD_VERSION=0.7.0
|
||||
readonly WD_VERSION=0.9.0
|
||||
|
||||
# colors
|
||||
readonly WD_BLUE="\033[96m"
|
||||
|
@ -90,7 +90,6 @@ Commands:
|
|||
clean Remove points warping to nonexistent directories (will prompt unless --force is used)
|
||||
|
||||
-v | --version Print version
|
||||
-d | --debug Exit after execution with exit codes (for testing)
|
||||
-c | --config Specify config file (default ~/.warprc)
|
||||
-q | --quiet Suppress all output
|
||||
-f | --force Allows overwriting without warning (for add & clean)
|
||||
|
@ -426,7 +425,6 @@ wd_export_static_named_directories() {
|
|||
WD_CONFIG=${WD_CONFIG:-$HOME/.warprc}
|
||||
local WD_QUIET=0
|
||||
local WD_EXIT_CODE=0
|
||||
local WD_DEBUG=0
|
||||
|
||||
# Parse 'meta' options first to avoid the need to have them before
|
||||
# other commands. The `-D` flag consumes recognized options so that
|
||||
|
@ -436,7 +434,6 @@ zparseopts -D -E \
|
|||
c:=wd_alt_config -config:=wd_alt_config \
|
||||
q=wd_quiet_mode -quiet=wd_quiet_mode \
|
||||
v=wd_print_version -version=wd_print_version \
|
||||
d=wd_debug_mode -debug=wd_debug_mode \
|
||||
f=wd_force_mode -force=wd_force_mode
|
||||
|
||||
if [[ ! -z $wd_print_version ]]
|
||||
|
@ -583,9 +580,4 @@ unset args
|
|||
unset points
|
||||
unset val &> /dev/null # fixes issue #1
|
||||
|
||||
if [[ -n $wd_debug_mode ]]
|
||||
then
|
||||
exit $WD_EXIT_CODE
|
||||
else
|
||||
unset wd_debug_mode
|
||||
fi
|
||||
return $WD_EXIT_CODE
|
||||
|
|
Loading…
Reference in a new issue