Commit Graph

552 Commits

Author SHA1 Message Date
1dab31ecda zsh:keys: Reuse the default fallback for FZF_ALT_C
Instead of implementing it twice, simulate a shell without ripgrep to
get the fallback of FZF_DEFAULT_COMMAND and modify it for use with
directories.
2022-09-19 12:52:00 +02:00
85b95dce37 zsh:keys: Set FZF_{CTRL_T,ALT_C}_COMMAND
Do not ignore hidden files.
2022-09-19 12:45:26 +02:00
bc16774f1d zprofile:FZF_DEFAULT_COMMAND: Follow symlinks 2022-09-19 12:36:42 +02:00
0ffd542d0b zprofile: Cleanup comments to FZF_DEFAULT_COMMAND 2022-09-19 12:23:16 +02:00
5cf9aa2905 zprofile: Prune __pycache__ in FZF_DEFAULT_COMMAND 2022-09-19 12:16:31 +02:00
83ae0c1642 zprofile: Refactor FZF_DEFAULT_COMMAND fallback
Group all names that are pruned in parentheses, but remove the unneeded
parentheses around `-type f -print` by removing the `-a`.
2022-09-19 12:05:52 +02:00
ec292c0dd1 zsh:alias:vimdiff: Do not set listchars
As this is done by my vimrc already.
2022-09-19 11:55:01 +02:00
d9673498cb zsh:alias: Add -p to mkdir 2022-09-18 19:43:41 +02:00
dc72de809b zsh:alias: Remove mkdir=mkcd
I changed my mind. This gets really annoying.
2022-09-18 19:41:46 +02:00
553a2679cf zsh:alias: Turn tmsu into a smarter function
Instead of simply pointing the database to XDG_DATA_HOME, write a
wrapper function that searches for `.tmsu/db` in all parent directories
and fallbacks to XDG_DATA_HOME if not found.

Also create XDG_DATA_HOME/tmsu if necessary.
2022-09-18 19:37:30 +02:00
2177031c68 zsh:history: Increase file size limit 2022-09-10 00:35:03 +02:00
22ad215f62 zsh:alias: Add sizes for du -sch * | sort -h 2022-09-09 01:35:58 +02:00
515dbf1117 vim:nvim-man: Source vimrc and fix weird input
Remove `NORC` as settings like `smartcase` or my color scheme are things
I do not want to miss and the startup time delta feels negligible.

Fix a weird issue with presumably the line breaks and tabs in the
command string that would make vim send key inputs when starting through
`nvim-man`. This would lead to tmux switching panes and tmux-resurrect
failing to recover panes with vim opened like this.
2022-09-08 17:41:41 +02:00
bef12252ba zsh:funcs: Add finddup to find duplicate files 2022-08-31 15:02:57 +02:00
0ad0ccb0c8 git: Make commit-last-msg available as alias
Move `git-commit-last-msg` into an autoloadable function. This way it
can also be executed as external script and thus in a git alias. This
makes it additionally possible to call it in vim over fugitive's `:Git`.
2022-08-30 19:52:24 +02:00
165b0ee7af zsh:alias: Add glog --branches --remotes 2022-08-28 01:12:51 +02:00
a38ac0e738 zsh:funcs:mkcd: Prevent recursion with command
Call the external command `mkdir` to prevent recursion through the alias
added in 7834a6bee2 ("zsh:alias: Alias `mkdir` to `mkcd`").
2022-07-14 17:19:30 +02:00
7834a6bee2 zsh:alias: Alias mkdir to mkcd 2022-07-14 14:24:58 +02:00
e931f20a7e zsh:funcs:mkcd: Support - and -- arguments 2022-07-13 17:49:45 +02:00
ee1ec50322 zsh:funcs:mkcd: Improve argument parsing
Do not switch into a directory, if multiple were created. Support flags
given at the end of the commandline (e.g. `mkdir foo/bar -p`)
2022-07-13 17:28:40 +02:00
d4ee271740 zsh:alias:qmv: Use destination-only edit format
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.
2022-07-13 12:14:39 +02:00
43d87467d2 git:checkout-worktree: Pass all arguments
Pass all given arguments to `git worktree add`. This makes it possible
to directly create a new branch with `-b` for example. As the arguments
are not used anywhere else, this should not introduce any parsing
issues.
2022-07-12 21:00:12 +02:00
0ccca77457 zsh:settings: Set HIST_REDUCE_BLANKS
Remove superfluous blanks from each command line being added to the
history list.
2022-07-12 21:00:11 +02:00
ffaef0fd54 *: More XDG environment variables and configs
More configurations of programs that do not follow the XDG Base
directory Standard correctly.
2022-07-12 21:00:11 +02:00
7b40b3ea98 zsh:alias: Exclude .git & tags when grepping
Those are more or less never a place that I want to include when
grepping recursively or through a glob.
2022-07-12 21:00:10 +02:00
65fc5efdec git:submodule-rm: Update to current .git structure
Update the function to use the current `.git/modules/` structure, by
only using the basename of the path.

I am not sure when this was changed and too lazy right now to find it
out.
2022-07-12 21:00:10 +02:00
be6e5df3ea zsh:funcs:suffix: Do not quote extra
Since 5258b5ed4217 ("zsh:funcs:suffix: Support quotes), all special are
escaped anyway (including whitespace), making it unnecessary to quote
the names extra.
2022-07-12 21:00:04 +02:00
818ebdc144 zsh:funcs:suffix: Support quotes
Quotes need to be escaped, otherwise `(Q)` will not work on potential
uneven number of quotes.
2022-07-12 21:00:04 +02:00
bf1eadbb79 zsh:funcs:suffix: Fix multiple suffixes
While trying to handle whitespace in the suffixes the support for
passing multiple suffixes broke.

This should now support multiple suffixes as well as included
whitespaces.
2022-07-12 21:00:03 +02:00
efa7054b82 zsh:funcs: Add suffix
Find files that end with one of multiple given suffixes.

Usage:
suffix sfx... [-- path...]

`sfx` is given to `find` in the form `-name "*$sfx"`.
`path` is given as starting point to `find`, defaulting to `.`.
2022-07-12 21:00:03 +02:00
fd575d3784 zsh:funcs:spellcheck: Fix indentation
I forgot to reindent part of the function after moving the

    if (( $+commands[shellcheck] ))

check into the function. Before it was wrapping the function definition.
2022-07-12 21:00:03 +02:00
b61429a176 zsh:funcs:pgrep: Format + rephrase comment 2022-07-12 21:00:03 +02:00
40416ebd9c *: Move third-party plugins into .local/share/
Move all submodules that were under .config/ into .local/share/ (alias
XDG_DATA_HOME). I got convinced that they feel out of place in .config/.

Instead of updating the paths from which they are sourced (e.g.
`TMUX_PLUGIN_MANAGER_PATH` or `packpath`), keep a symlink in the old
location that points to the new one. This has the benefit that
everything related to one program remains mostly accessible from the
same place instead of spreading everything out.

I am still unsure if I really like the new location as I affiliate user
**data** more with something that has to be backed up as it is
non-recreatable. And moving them out of .config/ had the reasoning that
they are not my config files but rather data from the internet that
could be retrieved when deleting. But using XDG_CACHE_HOME seems
unreasonable as well.
We'll see.

Move the fzf-repo from ./local/bin/ to .local/share/.

Update all relative symlinks' (e.g. fzf) targets.
2022-07-12 21:00:01 +02:00
127cce45a1 zsh:p10k: Add vim modeline 2022-07-12 21:00:01 +02:00
09ef4d4d93 git: Replace git-signoff with rebase --signoff
Replace my custom git-signoff script with the native `--signoff` flag
for `git rebase`.
2022-07-12 21:00:00 +02:00
1fbdc60b6b glog: Disable --quit-if-one-screen in $LESS
Make glog always open the output of `git show` in a **real** pager by
disabling `--quit-if-one-screen`.
2022-07-12 21:00:00 +02:00
3512199fce git:spull: Rename to ssync
As I rarely use git-pull(1) and instead fetch and act manually, I'd
rather have it to just sync the submodules.
2022-07-12 20:59:59 +02:00
c22fcf5fce git,zsh:autoload: Move spull 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-spull` as well as `git spull`
as before.
2022-07-12 20:59:59 +02:00
0146956dd4 git:core.pager:,less: Use long flag variants 2022-07-12 20:59:59 +02:00
d5350276dc less: Add --quit-if-one-screen
Before v530 `less` would need the -X flag as well for -F to be useful.
With v530 it does not enter alternate mode if the content fits in one
screen.
2022-07-12 20:59:59 +02:00
932c2eee35 git:checkout-worktree: Format description comment 2022-06-23 23:59:01 +02:00
b96d32996b *: Wrap lines at 80 columns where appropriate
Wrap lines at 80 columns where appropriate and I had the energy to think
about how/where to wrap.

There are still lines longer than that, which I plan to wrap in the
future. But that is enough for now.
2022-06-23 23:59:00 +02:00
9a018d6835 zsh:funcs:shellcheck: Fall back to web service
Add a shellcheck wrapper that falls back to the web service if
shellcheck is not installed.
2022-06-23 23:58:59 +02:00
6458a45461 zsh:keys: Bind ^W to backward-kill-word
For deleting a word while in the shell, I find it easier/faster to use
emacs bindings or Ctrl-Backspace and backward-kill-word instead of the
vi version.

In tmux, Ctrl-H (same esacape sequnce as Ctrl-Backspace) is used for
switching panes since f11b7fa56545 ("vim,tmux:plugs: Add
`vim-tmux-navigator`"), so I need to use Ctrl-W.

As that is bound to vi-backword-kill-word, rebind it to use the emacs
version.
2022-06-23 23:58:58 +02:00
ce4b8fa3dd zsh: Only source *.zsh files
Only source `*.zsh` files to prevent confusion or errors on startup.

Rename all files in 90-external-plugins accordingly.
2022-06-23 23:58:49 +02:00
a912530f6f zsh:p10k: Modify context segment format template
Display only `user` when not in a remote shell and `user@hostname` when
connected.

Display the content in bold when running with privileges (no SSH & SSH).
2022-06-23 23:58:49 +02:00
33f9a34895 zsh:p10k: Move bg-jobs, exec-time & status to end
Have those three always the furthest right in the `RPROMPT`. Also
reorder them to be in this order (up -> down : left -> right):

    - background_jobs
    - command_execution_time
    - status
2022-06-23 23:58:48 +02:00
8107bc6ec0 zsh:funcs: Get rid of double comment prefixes ## 2022-06-23 23:58:41 +02:00
8cd490ea0a zsh: Move 'change directory into repo root' logic
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.
2022-06-23 23:58:39 +02:00
e97ade48e2 zsh:alias: Add py for python3 2022-06-23 23:58:38 +02:00