Commit Graph

35 Commits

Author SHA1 Message Date
fa8a6b10fa zsh:alias:git: Add diff --staged and rebase -i 2022-03-31 00:53:26 +02:00
74e72c18c6 zsh:alias: Sort git aliases + Add comment 2022-03-31 00:51:35 +02:00
020a132c13 zsh:alias: Alias gp to git push
As I mostly fetch and then merge or rebase instead of pulling `git push`
can have the shorter variant of its alias.
2022-02-20 23:52:13 +01:00
0ed5e711bf zsh:alias: Add gf for git fetch 2022-02-17 16:54:28 +01:00
2dcece04f3 zsh:alias: Add further git aliases 2022-01-20 16:02:24 +01:00
85b4c48db6 zsh:alias: Add flags to qmv 2021-09-24 01:48:03 +02:00
043f3a4faa zsh:alias: Disable globbing for zmv 2021-09-08 13:45:20 +02:00
62a5eca95d zsh:alias: Alias rm to trash 2021-09-08 13:42:27 +02:00
f2f09be50b zsh:alias: Add coreutils aliases under OSX 2021-07-23 13:06:11 +02:00
acf1f6b691 zsh:alias:add_flags: Keep existing aliases
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..
2021-07-23 12:57:03 +02:00
64ca1b72f9 zsh: Move {,un}bkp from aliases to functions
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)
2021-07-23 12:10:31 +02:00
8d4f2c7ce9 zsh:nameddirs: Pull out of aliases into own file 2021-07-22 15:44:14 +02:00
11f7c14fd4 zsh:alias: Add external commands depending block 2021-07-22 15:34:26 +02:00
fc2d811856 zsh:alias: Improve handling of unknown commands
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.
2021-07-22 15:25:46 +02:00
fddbb1117d zsh:alias:clipboard: Check for commands existence 2021-07-22 15:24:32 +02:00
f10896b686 zsh:alias: Add no1 & noO to redirect output 2021-07-22 15:19:44 +02:00
48160456a8 zsh:alias: Remove qrdecode as there is qr() 2021-07-22 14:50:51 +02:00
d0aee7e638 zsh:alias:git-base-branch: Fix small pattern error
In place of the in ed215a35f7 introduced
second bracket can also stand `~` or `^`.
Otherwise something like `[feature^] or [feature~2]` is not thrown out.
2021-05-16 00:04:46 +02:00
c1955dd5f5 zsh:alias:git-base-branch: Match merge commits too
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.
2021-05-15 23:17:36 +02:00
ed215a35f7 zsh:alias:git-base-branch: Make regexs more robust
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.
2021-05-15 22:52:33 +02:00
f58c5fdb27 zsh:alias: Combine both regexs in git-base-branch 2021-05-15 22:17:45 +02:00
32416deedd zsh:alias: Add git-ancestor and git-base-branch 2021-05-15 22:12:50 +02:00
7090f55653 zsh:alias: Add -j flag per default to make 2021-05-04 10:43:19 +02:00
74e7cdef30 zsh:alias: Check for MACOS in clipboard aliases
Also check for the existence of perl before baking it into the alias.
2021-04-04 10:53:41 +02:00
965e725bc2 zsh:alias: Use nvim in vimdiff alias 2021-01-27 02:10:24 +01:00
d0cd6ffef0 zsh: Move man wrapper into function for completion 2021-01-04 16:34:16 +01:00
2b64781000 zsh:alias: Use nvim's Man function instead of pipe
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.
2020-12-28 03:01:35 +01:00
a9e2e5b847 vim:alias: Vim related aliases + ^Z, fg workflow 2020-12-19 03:01:46 +01:00
5b5fc5eefa zsh:alias: Remove Ubuntu update alias 2020-12-19 02:58:55 +01:00
5cf0f7fdf2 zsh: More XDG! 2020-12-19 02:57:45 +01:00
d7a126a41f zsh:alias: More git aliases 2020-12-18 23:35:32 +01:00
druckdev
6cac0dc53a git: Show patch of the changes in commit message
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.
2020-11-23 01:27:51 +01:00
druckdev
cd95201d21 zsh:alias:lsblk: Only output useful stuff 2020-11-15 02:00:15 +01:00
druckdev
0e5dd20db4 zsh:alias:gpg: Fix zsh-sy-h related freeze 2020-11-12 22:51:16 +01:00
druckdev
bf46c5f687 zsh: Divide zshrc into zshrc.d
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
2020-11-10 02:58:22 +01:00