Stick with the following style:
* Header 1 with the module name is in `lowercase`.
* Other headers are in `Sentence case`. Common header names that should
be consistently used are `Aliases`, `Contributing`, `Functions`,
`Settings`, and `Zsh options`.
* The names `Zim` and `Zsh` always appear capitalized, even in the
middle of sentences.
* Prefer
print 'code indented with 4 spaces'
instead of
```zsh
print 'code fenced by lines with three back-ticks'
print 'unless you want syntax highlighting'
```
Prefer `setopt NO_FOO` instead of `unsetopt FOO`, as former is easier to
document in the README.
Stick with the following style for the README:
* Header 1 with the module name is in `lowercase`.
* Other headers are in `Sentence case`. Common header names that should
be consistently used are `Aliases`, `Contributing`, `Functions`,
`Settings`, and `Zsh options`.
as they are not required (not even recommended) to be set along with
`SHARE_HISTORY`. See zshoptions(1) on `SHARE_HISTORY`:
> This option ... also causes your typed commands to be appended to the
> history file (the latter is like specifying `INC_APPEND_HISTORY`,
> which should be turned off if this option is in effect). The history
> lines are also output with timestamps ala `EXTENDED_HISTORY` ...
Also update copy in comments and in the README. Stick with the following
style for the README:
* Header 1 with the module name is in `lowercase`.
* Other headers are in `Sentence case`. Common header names that should
be consistently used are `Aliases`, `Functions`, `Settings`, and
`Zsh options`.
* The names `Zim` and `Zsh` always appear capitalized, even in the
middle of sentences.
Closes#313
namely, the `gfu` alias, the `git-branch-delete-interactive` function,
and a couple of commands that are shadowed.
Command `gm` was reported in #59, and `grc` was reported in #139.
Current code will create an archive in the current directory with:
% archive ../test.tar.gz test.*
or will complain that the following archive doesn't exist in the current
directory (given it actually exists in the parent one):
% unarchive ../test.tar.gz
Fix that and allow archives in any directory.
Other changes:
* Use `<required_param>` instead of `[required_param]` in the usage text
* Don't explictly check if archive exists in `unarchive`, but let the
respective tool fail with its own message
Closes#312
My fault, I removed them in commit 78611457, but they are necessary.
Without them, we are getting the following error when one of the
terminfo[] values is empty:
init.zsh:14: bad set of key/value pairs for associative array
Fixes#310
In double quotes, array elements are put into separate words when
using `"${(@)array}"` or `"${array[@]}"`. See zshexpn(1).
Also according to the Zsh documentation, these forms preserve empty
elements of the array.
instead of aliasing `ls` to `ls -G`.
CLICOLOR is detected not only by `ls`, but by `tree` too (starting with
version 1.8.0). See http://mama.indstate.edu/users/ice/tree/changes.html
It's probably more widely used by other tools too.
not just one directory.
Also use shorter versions of the `tar` parameters, since we were using a
mixture of the short and long ones among `archive` and `unarchive`.
About not using `$` inside `(( ))`, this is what the the section
ARITHMETIC EVALUATION in zshmisc(1) says:
> Named parameters and subscripted arrays can be referenced by name
> within an arithmetic expression without using the parameter expansion
> syntax.
And according to http://www.bash2zsh.com/zsh_refcard/refcard.pdf:
> `var` (does not require `$` in front unless some substitution e.g.
> `${#var}` is needed, `$` is error if `var` is to be modified)
Closes#308
Add missing local variable set.
Replace `>/dev/null 2>&1` by `&>/dev/null`.
Check return value of zstyle (if zero), instead of resulting string
value (if non-empty).
I think this change results in the _expected_ behavior. Users can always
override this by overriding the zstyle, as that is a benefit of using
zstyles.
Ref: https://www.zsh.org/mla/users/2015/msg00467.html
and `which _ssh_hosts`
Fixes#46. Closes#294.
based on https://stackoverflow.com/a/48509425/2654518, which is based on
http://rabexc.org/posts/pitfalls-of-ssh-agents
Current code has a few issues: depends on `SSH_AUTH_SOCK` and
`SSH_AGENT_PID` env variables, which might not be available in every
shell session; and tries to create a new socket for agent-forwarding by
checking `SSH_AUTH_SOCKET` instead of `SSH_AUTH_SOCK`.
Also, it's safer to create the env file with 066 mode and in the user
home directory.
About not using `$` inside `(( ))`, this is what the the section
ARITHMETIC EVALUATION in zshmisc(1) says:
> Named parameters and subscripted arrays can be referenced by name
> within an arithmetic expression without using the parameter expansion
> syntax.
And according to http://www.bash2zsh.com/zsh_refcard/refcard.pdf:
> `var` (does not require `$` in front unless some substitution e.g.
> `${#var}` is needed, `$` is error if `var` is to be modified)
Closes#292
Just binding ^[[A/^[[B does not work for some terminals, while not
binding them breaks zle widgets on other terminals. That's how crazy it
can get :- (
Fixes#293. Fixes#295.
See https://github.com/zsh-users/zsh-history-substring-search/issues/70
and comment by @molovo:
I was already binding keys _after_ `zle-line-init`, but I'm pulling
keycodes out of the `terminfo` module, which reports up
(`$terminfo[kcuu1]`) as `^[0A` instead of `^[[A`. Binding `^[[A`
manually mean up/down works with history-substring-search both
before and after `zle-line-init`, but if I bind `$terminfo[kcuu1]`
(`^[0a`), up/down only works *before* `zle-line-init`.
Closes#286
and they were mistakenly inside the Colours scope. Move them out of
there.
Still using the same `(( ${+commands[dircolors]} ))` test because it
works well with MacOS with coreutils installed without the `g` prefix,
for example.
This reverts commit 2f0243e533.
Completion module does not depend on utility module anymore to set the
zstyle list-colors. Making modules independent from each other as much
as possible is a good thing.
As used in other modules. Also easier to document in the comments and
README.
Replace table by bulleted list so it's possible to use `|` in the text
without breaking the Markdown rendering.
Same for the `lx` alias.
Also update the README.md. Replace table by bulleted list so it's
possible to use `|` in the text without breaking the Markdown rendering
(as it did for the table).
For short single commands, prefer a one-liner `for` with the zsh syntax:
```
for x (foo bar) print ${x}
```
Otherwise just place `; do` on the same line as the POSIX `for ... in`:
```
for x in foo bar; do
print ${x}
done
```
Closes#268
and use `-F` to check if the feature was not already loaded before.
Use terminfo elements for Backspace and Delete. Sort by terminfo element
keys.
Also simplify code, removing unnecessary double quotes, and replacing
if-then-fi with one command by one-liners.
as `expand-or-complete-with-redisplay` was added to fix an issue
reported with zsh 5.2 when completing with <Tab><Tab><Ctrl-C>. See #85.
Fixes#134. Closes#256
that use the git-branch-delete-interactive function.
Thanks to @Mikachu for helping with the completion function
implementation over the #zsh chat.
Closes#265