summaryrefslogtreecommitdiffstats
path: root/zsh/oh-my-zsh/plugins/globalias/README.md
diff options
context:
space:
mode:
authorLibravatarLibravatar Biswakalyan Bhuyan <biswa@surgot.in> 2022-10-03 21:42:20 +0530
committerLibravatarLibravatar Biswakalyan Bhuyan <biswa@surgot.in> 2022-10-03 21:42:20 +0530
commitaf120ab348f2e1a5a39dec035ed9dcf84189a64e (patch)
tree2a3aadd7ce1b7b771dfe3fe7c983569726c8d7ed /zsh/oh-my-zsh/plugins/globalias/README.md
downloaddotfiles-af120ab348f2e1a5a39dec035ed9dcf84189a64e.tar.gz
dotfiles-af120ab348f2e1a5a39dec035ed9dcf84189a64e.tar.bz2
dotfiles-af120ab348f2e1a5a39dec035ed9dcf84189a64e.zip
dotfiles
Diffstat (limited to 'zsh/oh-my-zsh/plugins/globalias/README.md')
-rw-r--r--zsh/oh-my-zsh/plugins/globalias/README.md79
1 files changed, 79 insertions, 0 deletions
diff --git a/zsh/oh-my-zsh/plugins/globalias/README.md b/zsh/oh-my-zsh/plugins/globalias/README.md
new file mode 100644
index 0000000..cd7fc3c
--- /dev/null
+++ b/zsh/oh-my-zsh/plugins/globalias/README.md
@@ -0,0 +1,79 @@
+# Globalias plugin
+
+Expands all glob expressions, subcommands and aliases (including global).
+
+Idea from: https://blog.patshead.com/2012/11/automatically-expaning-zsh-global-aliases---simplified.html.
+
+## Usage
+
+Add `globalias` to the plugins array in your zshrc file:
+
+```zsh
+plugins=(... globalias)
+```
+
+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
+`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
+
+#### Glob expressions
+
+```
+$ touch {1..10}<space>
+# expands to
+$ touch 1 2 3 4 5 6 7 8 9 10
+
+$ ls **/*.json<space>
+# expands to
+$ ls folder/file.json anotherfolder/another.json
+```
+
+#### Subcommands
+
+```
+$ mkdir "`date -R`"
+# expands to
+$ mkdir Tue,\ 04\ Oct\ 2016\ 13:54:03\ +0300
+```
+
+#### Aliases
+
+```
+# .zshrc:
+alias -g G="| grep --color=auto -P"
+alias l='ls --color=auto -lah'
+
+$ l<space>G<space>
+# expands to
+$ ls --color=auto -lah | grep --color=auto -P
+```
+
+```
+# .zsrc:
+alias S="sudo systemctl"
+
+$ S<space>
+# expands to:
+$ 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
+```