Use the `destination-only` edit format when renaming files with `qmv`.
`dual-column` mode got on my nerves as I tend to forget with side is
source and which is destination. On top, the `swap` option breaks as
soon as I change the length of a filename.
`single-column` mode is useless for me, as I tend to make changes in
visual block mode.
Add an alias that switches directories into the repository root, instead
of having the normal `cd` command behave like that.
Sadly this is not possible (AFAIK) with a git alias as that will always
spawn a subshell.
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.
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.
Just setting neovim as the `MANPAGER` practically results in a pipe.
The problem with this is that `man` puts hard line breaks into the text
depending on the current window width. When the width changes afterwards
the input naturally doesn't change.
When using neovim's `Man` function this is resolved.
The changes are only shown in the editor and do not land in the final
commit message.
For that setting the git-commit-last-msg function and the commit-msg
hook had to be updated.
The function is now a standalone function instead of anonymous and
uses every line until the first comment in COMMIT_EDITMSG discarding the
new information too.
The hook breaks now when checking line lengths when the changes start
since for some weird reason they are passed together with the rest of
the message instead of being deleted like the comments.
Move every file from plugins into zshrc.d as well as all bigger blobs in
the zshrc into their own files there.
Some stuff is still in there that I am not all too sure where it
belongs. TODO: Move.
Because all external plugins are now sourced over a symlink I had to
create a fork of fzf-tab for now that supports that.
See: https://github.com/Aloxaf/fzf-tab/pull/153