Commit Graph

896 Commits

Author SHA1 Message Date
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
6f0b433fdf vim:keys: Add <leader>dd to clear line
I sometimes have the situation that I want to create empty lines but
they contain either whitespace from keeping the indentation and/or the
comment string (`o` on a comment line). My current workflow is to either
delete it and recreate it properly (e.g. from the 'other side' i.e. a
non-comment line) or clear it with `cc`. Both ways are a bit awkward.

Add a mapping that clears a line but stays in normal mode.

Also remove the `<leader>d` mapping that deletes and puts the content
into the system clipboard as I rarely use this one.
2022-08-30 14:57:52 +02:00
c0892a8bdb vim:keys: Map <leader>bt to buffer ctags 2022-08-30 14:33:41 +02:00
7a081c0bd9 vim:keys: Map <leader>* to :Rg search of cword 2022-08-30 14:32:54 +02:00
4af065f1fd vim:plugs: Redefine :Rg to include hidden files 2022-08-30 14:31:37 +02:00
165b0ee7af zsh:alias: Add glog --branches --remotes 2022-08-28 01:12:51 +02:00
ba3a54fc44 vim: Move numbertoggle autocmd into settings.vim
Step by step I want to restructure the vim files. The approach to
cleanly divide the config by topics works in zsh pretty well, but is too
vague in vim for my liking.

Especially (the very small) functions and autocommands that have the
purpose of setting options or mapping keys or the interplay of multiple
categories together, make it difficult to decide in which file the
snippets should lay.
2022-08-28 01:06:55 +02:00
b56eaa0eb2 vim:keys: Map <leader>gb to git blame 2022-08-28 00:11:16 +02:00
ede49ac9f7 vim:keys: Map <leader>gf to git status files 2022-08-28 00:11:15 +02:00
5ab97d6111 vim:keys: Map <leader>gg only with fugitive 2022-08-28 00:10:55 +02:00
4d43566a68 vim:coc: Use pyright 2022-08-26 08:38:07 +02:00
fb90ae3142 vim:keys: Xmap <leader>ga to git add selection
As `GitGutterStageHunk` adds only the selected lines and not the full
hunk, remove the `h` for hunk from the mapping.
2022-08-26 08:37:11 +02:00
9ce1cd236b vim: Remove german umlaut mappings
As I started to type on the international US layout I don't need any
extra bindings for special characters in vim.

Move the update of `spellfile` into xdg.vim, as it was the only
remaining body of `NewSpellLang()` and fits thematically.
2022-08-25 04:27:51 +02:00
794293aa81 vim: Wrap autocmds in augroups
To prevent the piling up of autocommands when reloading the vimrc, wrap
all autocommands in groups.
2022-08-25 04:22:19 +02:00
64353b4ffa vim:funcs: Call timer_start instead of executing
Fix a small but stupid bug that the result of `timer_start` (i.e. the
timer ID) was evaluated as Ex command. This would lead to a jump to the
top of the file, every time the vimrc was reloaded (i.e. when a .vim is
saved).

Use `call` instead of `execute`, to fix this.
2022-08-25 04:20:13 +02:00
80b533d089 vim: Highlight non-ASCII characters 2022-08-25 03:35:27 +02:00
4415ff4653 vim: Fix broken highlight of trailing whitespaces
Apply the following:

1. Switch to `matchadd` as `match` can only be used for **one**
   highlight
2. Use an autocommand group for better behaviour when reloading the
   vimrc.
3. Use just one pattern as it seems to work always. (Apparently `\%#` is
   not matched in normal mode)
2022-08-25 03:33:11 +02:00
73aa0e9752 vim:keys: Use RFC 3339 when converting unix times
Use a format conforming to RFC 3339 instead of following the systems
locale.
2022-08-25 01:14:39 +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
bc7a539186 vim:keys: Add <leader>utc to convert unix time
Add `<leader>utc` to convert unix timestamps into a human readable
format.
2022-07-14 14:25:00 +02:00
83d991cb53 vim:keys: Map <leader>gg to `:G 2022-07-14 14:24:59 +02:00
17fd0409a4 tmux: Make { and } repeatable 2022-07-14 14:24:59 +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
43bf8801f9 git:interactive.diffFilter: Disable diff-so-fancy
Disable diff-so-fancy as `interactive.diffFilter` for now, as it is
incompatible with git version `v2.37`.[1]

[1] - https://github.com/so-fancy/diff-so-fancy/issues/437
2022-07-12 21:00:12 +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
e949ffefef git: Set interactive.singleKey
In interactive commands, allow the user to provide one-letter input with
a single key (i.e., without hitting enter). Currently this is used by
the --patch mode of git-add(1), git-checkout(1), git-restore(1),
git-commit(1), git-reset(1), and git-stash(1). Note that this setting is
silently ignored if portable keystroke input is not available; requires
the Perl module Term::ReadKey.[1]

[1] - git-config(1)
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
46565c2d6b vim:keys: Nvim does not replace has('clipboard')
Neovim does not make `has('clipboard')` obsolete. It only simplifies
clipboard support but `has('clipboard')` will still return `0` if no
supported clipboard program is installed.

See `:help clipboard`

    Nvim has no direct connection to the system clipboard. Instead it
    depends on a |provider| which transparently uses shell commands to
    communicate with the system clipboard or any other clipboard
    "backend".

and `:help clipboard-tool`

    The presence of a working clipboard tool implicitly enables the '+'
    and '*' registers. Nvim looks for these clipboard tools, in order of
    priority:

      - |g:clipboard|
      - pbcopy, pbpaste (macOS)
      - wl-copy, wl-paste (if $WAYLAND_DISPLAY is set)
      - xclip (if $DISPLAY is set)
      - xsel (if $DISPLAY is set)
      - lemonade (for SSH) https://github.com/pocke/lemonade
      - doitclient (for SSH)
        http://www.chiark.greenend.org.uk/~sgtatham/doit/
      - win32yank (Windows)
      - termux (via termux-clipboard-set, termux-clipboard-set)
      - tmux (if $TMUX is set)
2022-07-12 21:00:11 +02:00
2ac0e01766 python: Handle non-existing history file
Create a dummy entry in the history file if it does not exist yet or is
empty. Otherwise `~/.python_history` would be used by site.py.
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
a8f6973968 tmux: Use pane-border as indicator for {copy,sync}
In tmux version 3.2 all style options were changed to string
options, making them support formats.[^1]

From that version on, use the pane-borders as indicator for the
{copy,sync}-mode instead of the prefix_highlight plugin.

Keep the pure style fallback, as Ubuntu 20.4 for example still only
ships with version 3.0a.

[^1]: https://github.com/tmux/tmux/commit/f03b61131b34079
2022-07-12 21:00:10 +02:00
747ffd01e3 tmux:prefix_highlight: Invert fg,bg + red for sync
- Invert the prefix_highlight colors so that it is less obtrusive.
 - Use `brightred` for the background of the sync-mode indicator.

This way the prefix, copy-mode and sync-mode indicators are visually
differentiable.
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
0faf19ad3d git:alias: Add git-submodule-rm for function
Just add a git alias to the already existing zsh function to make it
easier to call it.
2022-07-12 21:00:09 +02:00
18625091ed tmux: Add a 'resize mode' similar to my i3 config
Add a 'resize mode' that behaves similar to the one in my i3 config.
When pressing the binding `<prefix>r`, a new key-table is selected that
allows resizing with `hjkl` as well as choosing the different layouts
directly over the number row.
2022-07-12 21:00:09 +02:00
e0fdd45e6c tmux: Add binding to synchronize panes
Synchronize the panes in the current window with `<prefix>S`.
2022-07-12 21:00:09 +02:00
d9ea048411 tmux: Also display indicator for copy-mode 2022-07-12 21:00:09 +02:00
e609efc385 tmux: Also display indicator for synchronize-panes
Also display an indicator when synchronize-panes is turned on in the
status bar, not only for the prefix.
2022-07-12 21:00:08 +02:00