Commit Graph

1004 Commits

Author SHA1 Message Date
3f259d9cd8 vim: Do not include the line break in selections 2022-09-28 00:58:48 +02:00
72901dd230 ssh: Rename keys to have druckdev in the front
This groups all the druckdev related keys together.
2022-09-28 00:44:17 +02:00
827937854a ssh: Add codeberg.org
I started to mirror my dotfiles repo on codeberg.org
2022-09-28 00:34:43 +02:00
69edbd6f10 zsh:ls-show-hidden: Add -- support
All arguments following `--` should be taken as either files or
directories not flags, even if they start with a dash.
2022-09-27 01:28:10 +02:00
e5010d76b5 zsh:ls-show-hidden: Correct print format
When an argument is passed that does not exist, `ls` always prints the
directory name for the existing ones, even if there is only one
remaining directory that is listed.
2022-09-27 01:16:19 +02:00
82fc29f9c0 zsh:ls-show-hidden: Fix non_existing arg parsing
`ls` prints a warning if a non-flag argument is specified that does not
exist.

Previously ls-show-hidden assumed that all arguments that are neither a
directory nor an otherwise existing file are flags. As all flags are
passed to the ls call the warning still got printed, but this also lead
to the current working directory (i.e. `.`) being added to the
directories to process.

If `ls` expects an argument to a flag, it is always passed in the format
`--flag=arg` where the equal sign is mandatory. This makes it possible
to simply filter out all flags (and their arguments) from the other
arguments without needing to know which flags take an argument and which
don't.

Fix this behaviour by printing the same warning as `ls` does when an
argument is neither a flag, nor a directory nor an existing file. Also
only add `.` to the directories if *really* only flags were passed.
2022-09-27 01:05:42 +02:00
14f615f5e1 zsh:keys:ratio_dots: Fix preview of first word
Previously the path preview misbehaved when typing dots on the first
shell word (e.g. executing a script in a parent directory). This
happened as the `(z)` parameter expansion flag does not expand to an
array rather a scalar. Because of that, `[-1]` returns the last
character.

Work around this issue by prepending LBUFFER with a dummy word, so that
it always contains at least 2 words.
2022-09-22 15:15:07 +02:00
9a5536c5c5 zsh:keys:rationalize_dots: Add comments 2022-09-22 15:14:38 +02:00
8792518bcb zsh:keys:rationalize_dots: Add .. scenario
Handle an LBUFFER value of `..` before pressing `.` by adding `/../`.
This scenario can only occur by deleting previously added segments or
using the new `default_dot` (See previous commit 72a8cfbcb ("zsh:keys:
Add normal `.` behaviour on `Ctrl-.`")).
2022-09-22 15:09:39 +02:00
72a8cfbcb0 zsh:keys: Add normal . behaviour on Ctrl-.
Having bound `.` to `rationalize_dots` makes typing paths with multiple
`../` segments super easy. This gets cumbersome in some situations
though.

Typing a path like `../.local` is only possible by either typing
`../.<BS><BS>local` (as it is expanded to `../../` on the third dot) or
`..//.local` which is not as annoying but somehow breaks completion on
further path segments.

Bind `Ctrl-.` (i.e. `^N`) to insert a normal dot.
2022-09-22 14:39:20 +02:00
7666086dba *: Move die() into .local/bin/helpers.sh
The function `die` was redundantly implemented in various files.

Move the function into .local/bin/helpers.sh and source that where
previously implemented.

Also prepend the program's name to the message and always terminate the
message with a newline. The newline was previously needed for a small
but unnecessary hack that prevented the need of the `[ -z "$1" ]` test.
2022-09-22 14:39:20 +02:00
d7c9bda8a7 zsh:options: Enable CSH_NULL_GLOB
Error only if all patterns of a command have no matches.
2022-09-22 03:02:24 +02:00
4ccf7961b2 bin: Add trans to translate text with DeepL 2022-09-19 14:23:47 +02:00
12ef7cfa65 ignore: Add private .zprofile 2022-09-19 14:23:47 +02:00
ccea907173 zprofile: Source private variant 2022-09-19 13:39:18 +02:00
764bc6d9b7 tmux: Send 5xup when scrolling in alternate mode 2022-09-19 13:07:35 +02:00
832d1cfd0d tmux: Write prompt history to XDG_DATA 2022-09-19 13:04:29 +02:00
181971c1db zsh: Add $fzf_default_no_rg
Move the fallback for $FZF_DEFAULT_COMMAND into the variable
fzf_default_no_rg that is always set.

This way FZF_ALT_C_COMMAND can reuse it instead of spawning a new shell
and messing with PATH.
2022-09-19 13:01:30 +02:00
ed1bfc6ebf zprofile:FZF_DEFAULT_COMMAND: Cut off ./ 2022-09-19 12:57:45 +02:00
bed1ba1840 zprofile: Add -mindepth 1 to FZF_DEFAULT_COMMAND
Do not print `.`.
2022-09-19 12:56:42 +02:00
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
3963df217f git:ignore: Append trailing slash to directories
Append a trailing slash to all entries that should only match
directories.
2022-09-19 12:11:46 +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
7353a51132 rofi: Unbind Shift+Tab as it is bound by default
With a new version, Tab and Shift+Tab (ISO_Left_Tab) are bound to
kb-element-{next,prev}.
2022-09-09 02:24:55 +02:00
22ad215f62 zsh:alias: Add sizes for du -sch * | sort -h 2022-09-09 01:35:58 +02:00
a1e431d3e1 tmux: Use shell script to complete selfinsert
Use a short shell script to complete the `selfinsert` keytable by
binding all keys that have a mapping in the root table.
2022-09-08 18:36:37 +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
048933e67d tmux: Make <prefix>[hjkl] bindings repeatable
I sometimes need the `<prefix>[hjkl]` bindings over `C-[hjkl]` (e.g. vim
insert mode). Then it is nice to have them repeatable when navigating to
a pane further away.
2022-09-08 16:41:06 +02:00
eca58c09f8 tmux: Scroll only 5 lines when entering copy-mode
Only scroll 5 lines instead of a full page when entering copy-mode
through the wheel as a full page was too disorienting.

TODO: Pass `WheelUpPane` after entering copy-mode instead of redundantly
executing it's bound command.

Somehow neither of the following worked:

  send -XM WheelUpPane
  send -X WheelUpPane
2022-09-08 16:37:57 +02:00
b807497984 tmux: Mimic copy-mode -e when using the wheel
`copy-mode -e` annoyed me, as it happened sometimes that I would hold
down `C-d` to scroll down, only to close the shell and pane when
reaching the bottom.

But in principal I do like the idea of it and missed the feature when
reaching the bottom by using the scroll wheel.

Change the `WheelDownPane` in copy-mode to exit when the bottom is
reached.
2022-09-08 16:31:42 +02:00
7d58be4365 tmux: Scroll without selecting the pane 2022-09-08 15:41:53 +02:00
919e5c0a0b git:ignore: Add __pycache__ 2022-09-06 11:10:07 +02:00
bef12252ba zsh:funcs: Add finddup to find duplicate files 2022-08-31 15:02:57 +02:00
2f6d8af3f9 vim:settings: Turn on lazyredraw 2022-08-31 02:39:42 +02:00
5606967050 vim:keys: Fix <leader>dd (clear line)
`0` is necessary to move to real beginning of the line.
2022-08-30 20:39:21 +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
bcebc70082 vim:keys: Add mappings for git log 2022-08-30 19:52:23 +02:00
2027e12283 vim:autocmd: Match current word only if it exists
Check that the current word under the cursor exists (not empty) before
adding it as match.

Fix the disappearing of the welcome screen after a short time when
opening vim without file as argument.
2022-08-30 19:52:23 +02:00
947a939f67 vim: Move CycleSpellLang into keys.vim
See ba3a54fc4 ("vim: Move numbertoggle autocmd into settings.vim").
2022-08-30 19:52:23 +02:00
329a6e6eca meta:commit-msg: Allow subject to start with quote
See previous commit (d44931df8 "meta:envrc: `git fetch` in background").
2022-08-30 19:52:23 +02:00
95a1ecf984 meta:envrc: git fetch in background
Close/pipe std{in,out,err} as well as file descriptor 3 which is
apparently necessary for the subshell not to wait for the fetch to
finish.
2022-08-30 19:52:20 +02:00