“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`.
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.
This reverts commit 6022fe46c5.
Current code only works in a GNU with coreutils installed for `ls`, and
only with a `grep` that supports colors (not a Busybox one, for example)
Fixes#230
and refactor code, inlining auxiliary functions inside
`prompt_eriner_main`.
Theme colors are now customizable with parameters. Also, it works better
with light backgrounds by using `%Sstandout%s` for the segments which
were originally using black as foreground color (intended for dark
backgrounds).
The help explains the parameters, and the preview shows one color
variation.
Fixes#169. Closes#226.
The following was introduced in zsh 5.0:
> %F, %K, %f, %k allow colouring of prompts both using ANSI colour names
and values supported by individual terminal emulators.
making this submodule obsolete.
See http://zsh.sourceforge.net/releases.htmlCloses#224
Now that we have a general digest file that can contain all the
functions from all active modules, we can add functions to any of them
without the need to update the `fpath`.
and GNU uses LS_COLORS and GREP_COLORS. So change logic to only set
these environment variables for each OSTYPE.
Also original code was setting the `ls` alias with `-G` instead of
`--color=auto` if in a GNU without `dircolors`. Fix that too.
Simplify arithmetic command expression without using `${var}`, but
`var` instead. The second construct does not fail if `var` is not
defined, but defaults its value to `0` in that case.
Closes#225
and delete the meta module altogether.
Also refactor `tools/zim_issue` to use `tools/zim_info`, use local
variables, and print the output directly without the need of the
intermediate `issue_md` array.
Closes#218
Consider the `zcompdump_file` variable, that could be defined in
`.zimrc`, when cleaning the cache.
A custom zcompdump_file would not be cleaned from the cache without this
correction.
Also remove *.zwc.old files from cache, as zrecompile also generates
these.
Closes#218
in our custom themes.
With zsh starting at version 5.4, when using the `prompt_opts` array,
`nopromptsp` will be set unless the array contains a `sp`. This was
introduced in zsh at
43e55a9bcd (diff-bb10d67e7a8561b66a53a805f3c77a40R233)Fixes#209
While normally it's a good thing that zsh doesn't auto-expand on spaces,
in this case we want to split on spaces into distinct words, that way
the values are passed to `prompt` in multiple params.
Fixes#178
And fix init.zhs to export ZIM_HOME. The zmanage script invokes a new
shell for the sub commands, and those would fail as there would be no
value for ZIM_HOME.
Closes#203
This change allow arbitrary Zim location path by setting a new
environment variable, ZIM_HOME. If the user does not set it, Zim falls
back to the old "${ZDOTDIR:-${HOME}}/.zim" location.
Closes#203
instead of `remote update`. Both behave the same way, fetching from all
configured remotes. The `fetch --all` is shorter, and probably more
familiar. See https://stackoverflow.com/a/17512004/2654518
Also change `;` to `&&`, so merge is only called after fetch succeeded.
Closes#196
truncating at character 60. First 10 chars are used for `*`, commit
hash and spaces.
The 50 char limit is based on
http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
Also changed aliases to use the `--long-option` format when available,
so aliases are clearer for those unfamiliar with the options.
Closes#196
Environment variables set in `.zshenv` should not be overwritten.
However, it is sourced before Zim loads, making Zim overwrite the
settings.
Fixes#175. Closes#179
breaking the current prompt after `prompt -p`. Actually liquidprompt is
pretty invasive in the way it is implemented, defining extra
`prompt_on`, `prompt_off` and `prompt_OFF` functions to switch it after
it is executed.
Fixes#112, Closes#165
that was only being used in the `git` and `git-info` modules to check
the output of `git rev-parse --is-inside-work-tree`. The code depending
on this function was already changed.
Closes#163
The function is currently only being used for checking the result of
`git rev-parse --is-inside-work-tree`. Checking for the return code of
the command is enough.
from `git` module. Actually, the function is a little bit of
over-engineering and it's currently only being used for checking the
result of `git rev-parse --is-inside-work-tree`, even in the `git`
module code.
Checking for the return code of `git rev-parse --is-inside-work-tree` is
enough. Also refactored other portions of the code where return codes
are being checked.
Fixes#161, Closes#162
`url-quote-magic` automatically escapes characters that fit a URI scheme
as you type. From what I can tell from the commit history, this was
mistakenly placed in `else` branch of the nested conditional instead of
at the end of the outermost conditional.
Closes#160
The contents of git_info are subject to expansion by the shell. Avoid
putting raw ref names in the prompt to protect the user from arbitrary
code execution via specially crafted ref names (e.g., a ref named
'$(IFS=_;cmd=sudo_rm_-rf_/;$cmd)' would execute 'sudo rm -rf /' when the
prompt is drawn). Instead, put the ref names in new global variables and
reference these variables from git_info.
See:
- https://github.com/njhartwell/pw3nage
- 8976500cbbFixes#158, Closes#159
This uses the verbose mode to be able to display indexed, unindexed and
untracked files indicators. This is the last theme left to be migrated
to git-info, and the first one to use its verbose mode.
Originally, the theme also supported svn via vcs_info. The svn support
is lost in this rewrite. Maybe if a new svn-info module is introduced to
Zim...
Closes#157
so it behaves alike the non-verbose mode. For example, in the "merge"
special action context, files are being reported as both indexed and
unindexed by `git diff-index` and `git diff-files` commands in
non-verbose mode. That was not the case with the regular expressions
used in the verbose mode.
As previous migrations of themes to git-info, this does not use its
verbose mode, so a repo with just untracked files is not considered
dirty.
It uses the newly-introduced `diverged` context and `coalesce` function
from git-info.
Closes#152
that will be used by the minimal theme, and could be used for future
themes too. Prezto had this, but we diminished its necessity by
simplifying how git-info works.
`prompt.showinfo` for enabling or disabling it globally or per
repository. It can be globally disabled by not loading the `git-info`
module at all, and prompts currently will not break (and in the future
should still not break) if the module is not loaded.
This removes one git call that is used to check for the
`prompt.showinfo` configuration value.
that, when defined, will be set if branch is both ahead and behind of
remote. If not defined, the `ahead` and `behind` contexts will still be
set, as how they worked previously.
Based on my rewrite of the Agnoster theme, uses simpler segment drawing
functions and only relies on local variables. Uses git-info module in
non-verbose mode, so a repo with only untracked files will not count as
dirty (but dirty state is computed faster). Also took the freedom of
adding an extra space character after the 'r' for the Ranger segment,
and after the dirty indicator for the Git segment. Everything else looks
and behaves exactly the same as the original prompt.