Load only the `man.vim` plugin, nothing else. This should speed up the
startup a bit. It will never be as fast as `less` though, as it loads
the whole file first.
Split up local declarations into definition and declaration to get the
exit code of the command substitution.
With `err_return` the function now aborts early if `$mount_point`
couldn't be set properly.
Refactor the function to keep an array of commands with requirements
that have to be met. Those commands are then cycled over a wrap around
index instead of the inflexible switch statement.
Instead of overwriting existing aliases, reuse them.
This makes it possible to add multiple flags in multiple calls to
`add_flags` for example when a flag should only be added on certain
systems, etc..
Since both were functions already their place seems more appropriate in
functions.zsh. This also fixes the completion of both, since they did
not complete files before.
Other changes in `unbkp`:
- Use `mv` instead of `cp`
- Fix little typo (forgotten quote) and support specifying the
original name instead of only the backup.
- Do not "rename" the file if there is no change in name
(Leading to the prompt if the file should be overwritten)
On (new) systems where commands are still missing, it is often a little
surprise when commands do not work after zsh-syntax-highlighting colored
them green. That's why I do not want alias to be created when they just
wrap a command with the same name without the command existing.
There also cases like `rm` where I do not want to type out `command rm`
every time just because `trash` is not installed.
Break the loop if `$REPO_DIR` does not exist anymore because it was
deleted other ways instead of looping forever as `git worktree remove`
fails on non-existing directories.
Go back to a simpler approach, that the `fzf-history-widget` is only
called on <C-Up> and ^K in normal mode and <Up> & <Down> scroll through
the history normally.
The reason behind this change is that there were still some edge cases
in which the widget was wrongfully called when normal scrolling was
intended.
This change also makes it now possible that I can use commands in the
'surrounding' of a past command by first navigating to it with the
fzf-widget and then just using <Up> & <Down>.
Pass additional arguments to git-commit so that flags can be passed
e.g `-n` to bypass the commit hooks.
Also use the according completion for `git-commit-last-msg`.
Do not unset CHASE_GLOB under android as then globbing with absolute
paths breaks as the PWD is often in a path with subdirectories that are
owned by root and not world-readable (e.g. /data/data/).
I *believe* this is the reason for it.
In place of the in ed215a35f7 introduced
second bracket can also stand `~` or `^`.
Otherwise something like `[feature^] or [feature~2]` is not thrown out.
Merge commits should also be matched (indicated by a '-') for the case
that the base branches last commit is a merge commit and another branch
exists that checked out the newest commit that was merged.
Example log (from `glog`):
```
* abcdef Foo (HEAD -> feature)
* bcdefa Merge branch 'other-feature' into base (base)
|\
| * cdefab Bar (other-feature)
|/
* ...
...
```
with `git show-branch -a` output like:
```
! [base] Merge branch 'other-feature' into base
* [feature] Foo
! [other-feature] Bar
---
* [feature] Foo
-- [base] Merge branch 'other-feature' into base
+*+ [other-feature] Bar
```
Here we want `base` to be returned instead of `other-feature` and thus
'-' needs to be matched as well.
Fixes (in order of the patterns that were touched):
- Only match `*` that come between BOL and the branch name in brackets,
as another branch could be checked out at a commit containing a `*`
- Only throw out commits that were committed on our current branch and
not those that contain the branch name in the message (e.g. `test`).
- Only match until first bracket as the commit message could also
contain a pattern like `[.*]` that would be matched instead.