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
mainly to change "command correction prompts" to "spelling correction
prompt for commands" and make it clear that this is related to spelling
(and to the `SPROMPT` below that).
Using `bindkey` is the preferred zsh way to do it.
As far as I checked, also `set -o emacs` defines a less complete set of
key bindings compared to `bindkey -e`.
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
* create digest of scripts in a `functions` directory that don't start
with `_` (completion functions) and that don't have a `.` (function
names cannot have that character)
* zrecompile any `.zsh` or `.zsh-theme` file that is not in a `*test*`
directory (see 2a9a003), and that is a plain file with more than 1K of
size.
instead of the fixed logic that was zrecompiling syntax-highlighting and
history-substring-search modules' scripts.
Closes#260
so we have more vertical space for the actual log entries, instead of
having each one separated by a line just with graph lines. Also, this is
the default layout already, see `git log --graph --oneline` for example.
GNU colours are used by the completion module for all `OSTYPE`s, for
colouring the files in the menu. We had lost that for BSD after previous
changes to this module.
First choice is `init.zsh`, the script we use, introduced by Prezto.
Next choices are based on which are the most common init scripts in the
zsh-users repositories:
* `zsh-autosuggestions`, `zsh-history-substring-search` and
`zsh-syntax-highlighting` have `${zmodule}.zsh`
* `zsh-completions` has `${zmodule}.plugin.zsh`
Latter format apparently was introduced by Oh-My-Zsh.
Leaving `${zmodule}.zsh-theme` and `${zmodule}.sh` as the last options.
This will present the menu in case of ambiguous matches, and also expand
by any separator, not just `[._-]`.
Based on the configuration suggested at
https://superuser.com/a/815317/637926Closes#212
To achieve this, we have to make sure that the following is not set:
* `zstyle ':completion:*:default' list-prompt '...'`
otherwise long completion lists will be paginated (without prompting).
The list is considered too long when it's greater than `${LISTMAX}`,
which has a value of 100 by default.
Also remove options being set (or unset) that are already the default,
namely:
* `AUTO_MENU <D>`
* `AUTO_LIST (-9) <D>`
* `MENU_COMPLETE (-Y)`
And remove the space character from the beginning of the messages.
Fixes#136. Closes#248
as there's actually no "brief" format originally in git (by "originally"
I mean the ones listed for `--format=<format>` in `man git-log`).
Also, we already fit in `glG` all the information that `glb` had.
So add `glO`, that is a one-line variant of `glG`.
Now we get nice symmetrical formats in `glg`/`glG` and in `glo`/`glO`.
Rename `gpS` (mnemonic "pretty-signature") and `glS` ("log-signature")
to `gcv` ("commit-verify") and `glv` ("log-verify") respectivelly,
so `v` is used to verify signatures, and `s`/`S` is used to sign.
Remove `git-commit-lost` and `git-stash-dropped`, as this could be
probably joined into one function that shows all lost commits, including
lost stashes, and also because there seems to be many different ways to
do this, as discussed in https://stackoverflow.com/q/89332/2654518.
An answer worth noting is https://stackoverflow.com/a/6455586/2654518.
If someone is using this, let's discuss on a new solution...
Remove Oh-My-Zsh compatibility from `git-branch-current`, and delete
`git_current_branch`. This compatibility was already partially broken at
c1b02c0, when we also updated the gitster prompt theme. Now this
function fails when in 'detached HEAD' state (is was returning the
commit hash in this state), which is what we would expect from the use
we make of it.
Closes#244
“unrar-free returns the error code 1 when run without arguments, thus
failing the presence check.” as reported at sorin-ionescu/prezto#1383
Reformat code and use one-liners instead of if/then/fi. And we don’t
need to separate local definitions from assignments anymore starting
from zsh 5.2.
since we don't need that. We're using the newer '%F{red}color%f' code
instead.
Also use `PS1` instead of `PROMPT`, as suggested at `man zshcontrib`,
under "Writing Themes”.
Refactor code.
that prompts if upstream remote branch(es) should be deleted too. As
with `git branch`, the function supports multiple branches as params,
and also the `-r`/`--remotes` param. Update `gbx` and `gbX` to use this
function.
Also update `git-stash-clear-interactive` to have multiple tests instead
of multiple nested `if`/`then`/`fi`. (Simpler syntax, IMHO)
and to have a help and a preview too.
Inspired by #192, and by having (few but) good prompt themes to serve as
starting points for the users to customize or implement their own.
Also removed the colors functions, since we don't need that. We're using
the newer '%F{red}color%f' code instead. (Actually all our themes are)
Closes#245
This complements the changes done in the last commit, and also fixes the
`glg` output, and removes the now unnecessary `--date=relative`
parameter from `glG`.
Although I insisted on the `--long-option` format on 8669a4f, I think
`rm -rf` is pretty common and recognizable, so revert to that.
Add missing aliases to README.md, and improve description of existing
ones. The main improvement is trying to be more concise, so instead of
repeating "records changes to the repository" multiple times, simply say
"commits", for example. Also try to use words that match the alias
letters, so for "gcs" say "shows" instead of "displays", for example.
as there are multiple solutions to list the lost commits and stashes,
but I could not find reliable ones. See
https://stackoverflow.com/q/89332/2654518.
Well, the current `git-commit-lost` and `git-stash-dropped`
implementations don't accurately work at least on the repositories I'm
working with.
The `git-hub` functions where removed at dcc3265, but aliases and docs
remained. Remove these.
Remove line break from `_git_log_oneline_format`, so it really occupies
one line. And change date format in `glG` output from committer date
(`%cd`) to relative author date (`%ar`) to conform with other formats.
Refactor remaining functions. Most of the changes refer to using the
already existing git error messages and return codes, instead of having
code that creates that. (Error messages for 'not in a git repository'
where not even consistent among functions, and there's were I started
this...)
The most drastic changes can be seen in `git-root`, then in `git-dir`
and `git-stash-clear-interactive`.
since we already have a function (`coalesce`) defined and both can now
get zcompiled into the same digest file.
Also, nest the `git-action` function to the scope where it's used.
and `RPS1`, instead of `PROMPT` and `RPROMPT`, as suggested by the zsh
manual at `man zshcontrib`, under "Writing Themes":
> By convention, themes use `PS1`, `PS2`, `RPS1`, etc., rather than the
longer `PROMPT` and `RPROMPT`.
instead of a big single `functions.zwc` file containing functions from
all the `functions` subdirectories.
This solution here better suits the functions autoloading mechanism in
zsh, as documented in
http://zsh.sourceforge.net/Doc/Release/Functions.html#index-autoloading-functions
Given `~/.zim/modules/foo/functions` is in the `fpath`, autoload looks
for functions in the following files, picking the **newest one** in this
order:
* `~/.zim/modules/foo/functions.zwc`, which should contain all
functions in the directory named `functions`
* `~/.zim/modules/foo/functions/function.zwc`
* `~/.zim/modules/foo/functions/function`
With this approach, we're also having individual entries back in `fpath`
for the `functions` subdirectory of each enabled module (as was the case
before commit 55df5a4).
This is also probably closest to the original plan at #86. The current
code was not compiling "*all* files in a folder into a single digest",
but instead compiling *all* files in *all* the functions folders into a
single digest, which was a bad idea. This commit fixes this.
Fixes#231. Fixes#232. Closes#234.
Closes#239
Since some terminal colour schemes have a too dark blue color that does
not go well with a black background. And since some people actually use
such colour schemes! :- )
Fixes#225
Since some terminal colour schemes have a too dark blue color that does
not go well with a black background. And since some people actually use
such colour schemes! :- )
Fixes#228
They were only being applied to BSD. Also, GNU uses `LS_COLORS`, and BSD
only uses `LSCOLORS`. Keeping these consistent, with same color scheme,
in both GNU and BSD.
Simplify arithmetic command expression without using `${var}`
substitution, but `var` instead. The second construct does not fail if
`var` is not defined, but defaults its value to `0` in that case.