Commit Graph

552 Commits

Author SHA1 Message Date
46605c7a84 zsh:funcs:nvim-man: Use man if option is passed
If an option without arguments like `--version` is passed, `nvim-man`
should use `command man` as well.
2022-02-03 18:30:38 +01:00
e55652fd44 zsh:funcs:nvim-man: Move page existence check call
Check for the existence of the page only if `nvim` would be executed.
2022-02-03 18:30:36 +01:00
1be26adfc9 zsh:funcs:nvim-man: Use minimal config + scrolloff
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.
2022-02-03 18:29:37 +01:00
9817ef3f63 zsh:autoload:crypt-*: Rename to crypt-{open,close}
Rename `crypt-{,u}mount` to `crypt-{open,close}` as in these functions a
lot more happens than just {,un}mounting.
2022-02-01 01:18:15 +01:00
eac6953150 zsh:autoload:crypt-*mount: Get basename natively
Use zsh's builtin history expansion modifiers `:t` to get the basename
of the block device.
2022-02-01 01:15:42 +01:00
7f52c7a4cb git,zsh:autoload: Move git-track into own function
Move `git-track` into its own autoloadable function.
This way it is
better maintainable as in one-liner format and brings the possibility of
having more complexity (e.g. for better portability).
By that it is also now executable as `git-track` as well as `git track`
as before.
2022-01-31 12:50:54 +01:00
271f5bcf25 zsh:funcs:crypt-*mount: Set pipe_fail
Set `pipe_fail` so that if for example the `grep` fails while getting
`$mount_point`, the function returns early.
2022-01-30 00:37:13 +01:00
4c9bb36d33 zsh:funcs:crypt-umount: Fix $mount_point
Get `$mount_point` before unmounting making it then disappear naturally.
2022-01-30 00:34:50 +01:00
4623688fa8 zsh:funcs:crypt-umount: Fix typo
Remove the basename of `$mount_point` as this is the actual symlink name
in `~/mounts/`.
2022-01-30 00:33:39 +01:00
e9c4d7f608 vim:funcs:crypt-*mount: Split local declarations
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.
2022-01-30 00:09:08 +01:00
546b37681f zsh:funcs:crypt-*mount: Create mountpoint symlink 2022-01-30 00:08:09 +01:00
c2c0d4fc04 zsh:funcs:crypt-*mount: Test for block special 2022-01-30 00:04:22 +01:00
94d4a32a43 zsh:funcs:crypt-*mount: Use err_return option 2022-01-30 00:04:22 +01:00
f37afc9400 zsh:funcs:crypt-umount: Define $name variable 2022-01-30 00:04:22 +01:00
cb7263e77d *: Update plugins and other submodules 2022-01-29 22:42:33 +01:00
0e1712b4c0 zsh:autoload: Move git functions into git/ 2022-01-28 16:35:56 +01:00
fb92842d0a zsh:autoload: Include all subdirs in autoload/
Make it possible to organize autoloadable functions.
2022-01-27 14:43:57 +01:00
2dcece04f3 zsh:alias: Add further git aliases 2022-01-20 16:02:24 +01:00
851674efeb zsh:autoload:glog: Fix syntax w/ bash login shell
When bash is set as standard shell, fzf passes the commands to it and
bash throws a syntax error because of the missing semicolon.
2022-01-14 15:02:50 +01:00
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
8c7c37d65b zsh:zprofile: Attach to tmux only when it exists 2021-09-08 13:39:10 +02:00
03835c5d8d zsh:zprofile: Attach to tmux when connected by ssh 2021-07-27 15:33:44 +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
ca5edbe538 zsh:glog: Remove --all flag
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.
2021-07-23 12:06:58 +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
93ff4e7da2 zsh:glog: Add --all flag
Pretend as if all the refs in refs/, along with HEAD, are listed on the
command line.
2021-07-15 15:58:43 +02:00
938489dd4b zsh: Add git-rebase-add-stash completion 2021-07-15 02:46:16 +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
b1d396babd *: Use /usr/bin/env in shebangs for bash & zsh
To increase the portability (OSX for example has zsh under `/bin/zsh`).
2021-07-14 13:48:21 +02:00
0dfff846c2 zsh:fzf-tab: Remove color preview symbol 2021-07-10 01:47:45 +02:00