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)
This annoys me in more cases than I thought. For example when checking
out a commit in the past in detached head mode and I want to see the
past commits before the current one.
Especially because there is no flag that can disable it again.
The flag has to be passed manually to `glog` now.
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>.
By adding a shebang to the scripts they can be executed directly without
an interactive shell. The shebang also makes vims modeline that only set
the filetype obsolete.
Push current branch to branch of same name.
This is useful for new branches as I almost always push those with:
```
git push -u origin "$(git branch --show-current)"
```
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`.
I have no idea how I have not noticed this yet, as apparently every time
I wrote a commit message that contains a body and not just a subject I
got an error message complaining that the first word does not exist as a
command. (With the exception of when it actually is, but then executing
arbitrary code)