Commit Graph

81 Commits

Author SHA1 Message Date
fe8a656dfe zsh:keys:cmd-on-enter: Refactor for real cmd cycle
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.
2021-12-29 18:58:45 +01:00
b6d2299444 zsh:keys:cmd-on-enter: Remove zle message print
It did nothing.
2021-12-29 17:33:33 +01:00
9f99ceafd4 zsh:keys:cmd-on-enter: Use ll instead of ls 2021-12-29 17:28:41 +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
1c36ae8cac zsh:funcs: Add create_venv 2021-07-27 03:54:10 +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
6ba872c9c7 zsh:completion: Remove empty comment 2021-07-23 12:36:55 +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
77b2d63341 zsh:autosuggestions: Use own fork for now
See https://github.com/zsh-users/zsh-autosuggestions/pull/621

Set experimental values to the new configuration options.
2021-07-22 15:48:36 +02:00
8d4f2c7ce9 zsh:nameddirs: Pull out of aliases into own file 2021-07-22 15:44:14 +02:00
15c0252fda zsh:funcs: Create trash wrapper only if exists 2021-07-22 15:38: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
0b28f89e1d zsh: Reorder zshrc.d that autoload is first
This way the functions are already autoloaded and in alias.zsh and
others can be checked for existence.
2021-07-22 14:24:34 +02:00
79be1cfc71 zsh:git-checkout-worktree: Break if dir is deleted
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.
2021-07-15 16:01:38 +02:00
2d65f187f4 zsh: Fix forgotten ZSH_CONF use
`$ZSH_CONF` was removed in af49c39ba3.
2021-07-15 02:44:04 +02:00
111c851055 zsh:funcs: Add git-rebase-add-stash 2021-07-15 01:20:35 +02:00
8890a4b604 zsh:keys: Remove fzf-hist functionality
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>.
2021-07-14 14:35:20 +02:00
0dfff846c2 zsh:fzf-tab: Remove color preview symbol 2021-07-10 01:47:45 +02:00
e0ade3c140 zsh:fzf-tab: Set bindings for switching groups 2021-07-10 01:46:01 +02:00
f2c84fe82c vim:zsh-autosuggestions: Set suggestions strategy 2021-07-09 23:53:50 +02:00
4606f9ad80 zsh:git-commit-last-msg(): Support additional args
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`.
2021-07-07 11:50:52 +02:00
53ae5a067e zsh:funcs:crypt-mount: cd into mount-point 2021-07-07 11:47:54 +02:00
5ab5a49793 zsh:stderred.theme: Use escape-sequences w/o tput 2021-06-01 22:36:59 +02:00
6856c2d27e zsh:options: Do not unset CASE_GLOB on android
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.
2021-06-01 21:39:49 +02:00
db6303aa51 zsh:funcs:g-ch-worktree: Restart on issues
Restart the subshell until every issue is resolved and the worktree is
removed.
2021-05-31 23:17:47 +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
00da37623a zsh:funcs:git-checkout-worktree: Remove -p flag
As under OSX the -p flag does not exist, it seems safer to just use
`mktemp -d` and create the worktree under that directory.
This just has the disadvantage of one more dir to display in the `PWD`.
2021-05-15 04:06:14 +02:00
492c29c096 git:functions: Remove old unused nemo wrapper 2021-05-10 17:30:46 +02:00
4053920f53 git:completion: Fix command not found error
_git has to be loaded before other functions can use its completion
functions.

Hint to this found at: https://unix.stackexchange.com/a/269818
2021-05-10 17:28:22 +02:00
b82a9d2221 git:completion: Add git-checkout-worktree 2021-05-10 17:27:54 +02:00
1d8f21b565 zsh:functions: Add git-checkout-worktree 2021-05-10 16:12:23 +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
d52afbfa3c zsh:completion: Add completion for glog 2021-03-11 01:26:59 +01:00
17ef6a23e5 zsh:functions:nvim-man: Use portable flag for man
The macos version of man does not have the long versions of the flags.
2021-03-10 13:35:33 +01:00
48dc9ca561 zsh:keys:cmd-on-enter: Add reset on other command
If a command is normally executed CMD_ON_ENTER is reseted to `ls`.
Otherwise problems can occur when for example switching the directory to
a non-repo when CMD_ON_ENTER contains `gs`.
2021-03-09 15:47:09 +01:00
93225e2d66 zsh:keys:cmd-on-enter: Cycle between ls & gs too 2021-03-08 01:10:09 +01:00
754adc9cf7 zsh:fzf-tab: Limit dir previews to a depth of 3
Otherwise this is way to performance heavy in large directories.
2021-02-17 02:56:08 +01:00
965e725bc2 zsh:alias: Use nvim in vimdiff alias 2021-01-27 02:10:24 +01:00