Skip to content

Commit 1ea213c

Browse files
committed
Make shell alias expansion the default behaviour
Adjusted the documentation on how to opt out of the alias expansion feature.
1 parent acadd6d commit 1ea213c

File tree

2 files changed

+19
-8
lines changed

2 files changed

+19
-8
lines changed

README.md

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ This zsh plugin gives you jq superpowers!
1818
This plugin requires [fzf](https://github.com/junegunn/fzf) to be available
1919
on your PATH.
2020

21-
The project consists of two components:
21+
The project consists of the following components:
22+
2223
- a `jq-repl` command
2324
- a `jq-paths` command
24-
- a `jq.plugin.zsh` providing line-editor feature using `jq-repl`
25-
25+
- a `jq.plugin.zsh` providing line-editor feature utilizing `jq-repl`
2626

2727
### [zplug](https://github.com/zplug/zplug)
2828

@@ -77,8 +77,19 @@ During interactive querying, the following shortcuts can be used:
7777

7878
## Troubleshooting
7979

80-
### Pressing alt-j creates a `` symbol in iTerm2
80+
### MacOS: Pressing alt-j creates a `` symbol in iTerm2
81+
82+
- `Cmd + ,` to enter preferences
83+
- Go to Profiles
84+
- select your profile from the pane on the left hand side
85+
- go to the keys tab
86+
- Set Left Option (⌥ ) Key to `Esc+`
87+
88+
### Disable expanding shell aliases
8189

82-
Cmd + , to enter preferences
83-
Go to Profiles, select your profile from the pane on the left hand side, then go to the keys tab.
84-
Set Left Option (⌥) Key to Esc+
90+
The plugin automatically expands shell aliases in a command before passing it
91+
to `jq-repl`. To disable, put the following line into your `.zshrc`:
92+
93+
```
94+
JQ_ZSH_PLUGIN_EXPAND_ALIASES=0
95+
```

jq.plugin.zsh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
if [[ -o zle ]]; then
22

33
__get_query() {
4-
if [ "${JQ_ZSH_PLUGIN_EXPAND_ALIASES:-0}" -eq 1 ]; then
4+
if [ "${JQ_ZSH_PLUGIN_EXPAND_ALIASES:-1}" -eq 1 ]; then
55
unset 'functions[_jq-plugin-expand]'
66
functions[_jq-plugin-expand]=${LBUFFER}
77
(($+functions[_jq-plugin-expand])) && COMMAND=${functions[_jq-plugin-expand]#$'\t'}

0 commit comments

Comments
 (0)