Diff
1diff --git a/plugins/globalias/README.md b/plugins/globalias/README.md
2new file mode 100644
3index 0000000000000000000000000000000000000000..ba9888ccb9a6098dd2d0c698c09e2a3525efb801
4--- /dev/null
5+++ b/plugins/globalias/README.md
6@@ -0,0 +1,62 @@
7+# Globalias plugin
8+
9+Expands all glob expressions, subcommands and aliases (including global).
10+
11+Idea from: http://blog.patshead.com/2012/11/automatically-expaning-zsh-global-aliases---simplified.html.
12+
13+## Usage
14+
15+Add `globalias` to the plugins array in your zshrc file:
16+
17+```zsh
18+plugins=(... globalias)
19+```
20+
21+Then just press `SPACE` to trigger the expansion of a command you've written.
22+
23+If you only want to insert a space without expanding the command line, press
24+`CTRL`+`SPACE`.
25+
26+## Examples
27+
28+#### Glob expressions
29+
30+```
31+$ touch {1..10}<space>
32+# expands to
33+$ touch 1 2 3 4 5 6 7 8 9 10
34+
35+$ ls **/*.json<space>
36+# expands to
37+$ ls folder/file.json anotherfolder/another.json
38+```
39+
40+#### Subcommands
41+
42+```
43+$ mkdir "`date -R`"
44+# expands to
45+$ mkdir Tue,\ 04\ Oct\ 2016\ 13:54:03\ +0300
46+
47+```
48+
49+#### Aliases
50+
51+```
52+# .zshrc:
53+alias -g G="| grep --color=auto -P"
54+alias l='ls --color=auto -lah'
55+
56+$ l<space>G<space>
57+# expands to
58+$ ls --color=auto -lah | grep --color=auto -P
59+```
60+
61+```
62+# .zsrc:
63+alias S="sudo systemctl"
64+
65+$ S<space>
66+# expands to:
67+$ sudo systemctl
68+```
69diff --git a/plugins/globalias/globalias.plugin.zsh b/plugins/globalias/globalias.plugin.zsh
70new file mode 100644
71index 0000000000000000000000000000000000000000..9602a96061560d3833836f73d7901857aaed108f
72--- /dev/null
73+++ b/plugins/globalias/globalias.plugin.zsh
74@@ -0,0 +1,17 @@
75+globalias() {
76+ zle _expand_alias
77+ zle expand-word
78+ zle self-insert
79+}
80+zle -N globalias
81+
82+# space expands all aliases, including global
83+bindkey -M emacs " " globalias
84+bindkey -M viins " " globalias
85+
86+# control-space to make a normal space
87+bindkey -M emacs "^ " magic-space
88+bindkey -M viins "^ " magic-space
89+
90+# normal space during searches
91+bindkey -M isearch " " magic-space