Commit Graph

1622 Commits

Author SHA1 Message Date
e56ac18401 zathura: Add transparency to highlighting colors
I believe this changed with an update. Was there a global transparency
setting before? (I have these changes lying around already a bit, so
the breaking change is from the past and not so recent).
2024-11-04 09:55:24 +01:00
5fa05e94a3 vim:ftdetect: Detect Bochs config files 2024-11-04 08:17:35 +01:00
c674235adf fzf: Faster preview scrolling by mouse wheel
Don't know yet if want this for normal scrolling too.
2024-11-03 17:26:57 +01:00
d88ae4d808 vim:ftdetect: Detect *.nasm as asm files 2024-11-03 16:58:35 +01:00
64758245f6 vim:plugs: Add tabular
To align text.
2024-11-03 16:54:58 +01:00
d82ad9e8b9 glog: Color the key mappings overview
TODO: Use variables for colors and make customizable
2024-11-01 02:56:15 +01:00
7709ece0f8 glog: Add --highlight-line 2024-11-01 02:42:24 +01:00
9c099416a9 glog: Explicitly set my general fzf bindings
`glog` is the most standalone tool out of my dotfiles and I know of at
least one person that uses it that way. Because of this I want to also
explicitly map all other bindings that I have in my zprofile to improve
the experience.
2024-11-01 02:36:15 +01:00
9802309f12 glog: Display key bindings in sticky header 2024-11-01 02:23:34 +01:00
8be1c63c18 glog: Fix coloring when scrolling
Due to the formatting placeholders sitting on the previous line, the
coloring of the topmost line disappeared when scrolling (as the escape
sequence scrolled away). This had the background that I wanted the code
that sets up the format string to be very readable and if possible very
close to the actual output. And since the colors have all different
lengths I decided to place them on the previous line to have them out of
the way.

Fix this by placing the placeholders on the same output line while still
maintaining a readable format string (code). This is done by joining the
array without placing newlines so that it can now have multiple elements
for one output line and formatting those as wished.
2024-11-01 01:55:03 +01:00
ed4dac6f82 glog: Make changing previews persistent
Switch to using the `change-preview()` action that was introduced in
0.29.0 (which was actually not yet released for a year when this feature
was first written). The old `preview()` is a one-off action while
`change-preview()` changes the `--preview` option.

This had the downside that when changing to a different preview and
moving to the next commit one would had to repeat the change. This was
especially annoying when looking through the history of a file that was
renamed. With the commit that renamed the file all previous commits
broke in the `files_only` preview as the path didn't exist yet (A
possible but probably pretty hard TODO to fix).

TODO: glog: Fix files_only preview for renamed files or give prompt to
      change the paths
2024-11-01 01:30:43 +01:00
4f25801402 vim:au: Rename functions from CamelCase to snake_case
Make them also script-local as I don't need them outside.
2024-11-01 00:57:58 +01:00
92cc304bbb vim:au: Improve performance of cword/selection highlight
- Combine one `exists` call with an implicit `get` into a `get` with an
  empty default
- Do not stop any timer in the `Highlight*` functions as this done
  already by `ClearHighlights`
- Get rid of the check for existence of `w:*_timer_id` since I believe
  that there is no way of it being unset in the current state. The
  `_Highlight*` functions are only called via the timer so there should
  always be the variable. I could also not reproduce the description in
  the comment - this might have been true in a previous revision.
- Make sure that the visual selection itself is not matched. This
  actually increased the performance a lot while also looking like
  normally (there were some subtle differences between the highlight by
  visual mode and `CursorColumn`)
2024-11-01 00:47:19 +01:00
859337e9c0 vim:au: Defer selection highlighting by 100ms too
This makes moving the cursor in visual mode more responsive.
2024-10-31 23:20:44 +01:00
3cdb9d6902 vim:au: Stop timer too when clearing cword highlight
When deleting the cword match, any running timer should stop too so that
the highlighting does not restart. This had led to some weird flickering
bug.
2024-10-31 23:18:32 +01:00
1ffd31d585 zsh:keys: Use (A) flag instead of hack to split LBUFFER
This way better solution using the `(A)` flag was given to me in the
zsh-users mailing list back in 2022 but I forgot to apply it.

See zshexpn(1):

> Convert the substitution into an array expression, even if it
> otherwise would be scalar.

Thanks Mikael!

Link: https://www.zsh.org/mla/users/2022/msg00668.html
2024-10-30 16:19:58 +01:00
d87d2cfee5 vim:NrrwRgn: Don't let splits take full width
The default setting of `g:loaded_nrrw_rgn` is `topleft` which opens the
split at the very top/far left and makes the window have full
width/height. This is very annoying when narrowing multiple splits.
2024-10-30 15:53:28 +01:00
c7aae00e65 glog: Use core.pager also for Enter action 2024-10-30 15:53:28 +01:00
2a4812a740 vim:ftplug:qf: Disable spell checking 2024-10-30 13:12:53 +01:00
bdd25e579b vim:plugs: Add NrrwRgn (narrow region)
> This plugin is inspired by the Narrowing feature of Emacs and means to
> focus on a selected region while making the rest inaccessible. You
> simply select the region, call :NR and the selected part will open in
> a new split window while the rest of the buffer will be protected.
> Once you are finished, simply write the narrowed window (:w) and all
> the changes will be moved back to the original buffer.

I want this to be able to diff two portions of a file without the need
of creating temporary files. (And the ability to automatically bring
back changes sounds nice too.)

Link: https://github.com/chrisbra/NrrwRgn
2024-10-30 13:12:35 +01:00
19fc37299a git:https-and-ssh: Make POSIX-shell compliant
Don't know why this had two shebangs and how I never noticed.
Apparently I only launched the script through the autoloaded
function in zsh.
2024-10-30 10:52:01 +01:00
4d32370ba2 glog: Use git's core.pager
This way diff-so-fancy can easily be replaced/customized.
2024-10-30 10:52:00 +01:00
0cf0bdf82a zprofile: Clear LESS before setting
I just checked on an open shell and noticed that LESS contained what I
meant to put in thrice. Don't know if that has something to do with
tmux, but apparently the zprofile is sourced multiple times? - good to
know.
2024-10-30 10:52:00 +01:00
c608700199 vim:aucmd: Highlight selection on linewise v-mode
I assumed that the selection will always be one character long when the
ModeChanged event is triggered. This is not the case when entering
linewise visual mode.

Fixes: b0688da69e ("vim:aucmd: Do not highlight selection on
       ModeChanged")
TODO: There are more ways of triggering ModeChanged to visual mode with
      a selection of more than one character (e.g. `[count]v`).
2024-10-28 21:16:29 +01:00
c011f2ed6a vim:setts: Don't auto-open folds when searching
This makes it a lot easier to restrict the search (besides searching in
visual selection, which is quite limited). The cursor will still land on
the closed fold but only once, independent of the number of hits inside
of the fold.
2024-10-28 16:59:03 +01:00
4d93db3947 vim: Keep only one timer for checktime
Every time the file was sourced, a new timer was created.
2024-10-27 19:11:12 +01:00
12e14673bd vim:aucmd:TODO: CursorMoved != SelectionChanged
There are operations that change the visual selection without moving the
cursor (e.g. `viw` when on the last character). These do not trigger
CursorMoved so the highlighting also does not change.

TODO: <COMMIT>
2024-10-27 19:11:12 +01:00
714a6cd120 vim:aucmd: Specify what highlight to clear
There shouldn't be highlights of the other kind (cword <-> visual)
around.
2024-10-27 19:11:12 +01:00
b0688da69e vim:aucmd: Do not highlight selection on ModeChanged
Do not call HighlightVisualSel when the mode changes to visual mode, as
then the selection is still only one character long, which I rarely want
to highlight. If I do I can still move the cursor forth and back once.

TODO: Are there situation where ModeChanged is triggered and the
      selection is immediately longer than one char without triggering
      CursorMoved?
2024-10-27 19:11:12 +01:00
2a1346e74e vim:aucmd: Abort cword highlighting earlier
When we're still on the same word, the highlighting can be just kept as
is without starting a new timer.
2024-10-27 19:11:07 +01:00
fe429942a1 mime: Set firefox as default browser 2024-10-22 19:37:45 +02:00
d2f685cc8b *: Adjust pictures folder outside user-dirs.dirs
I have these changes since ages ago but never committed them apparently.

Fixes: 1e3aa5108e ("xdg-user-dirs: Move media folders into `~/media/`")
2024-10-22 19:21:46 +02:00
686a69fedf zprofile: Add Go and Perl related dirs to PATH 2024-10-22 19:15:59 +02:00
92077b75bc zprofile: Set TERMINAL=st
This is used by xdg-open and similar.
2024-10-22 19:15:06 +02:00
2056bf2bea mime: Add mimeapps.list
Is used by xdg-open(1) and such to look up default applications for a
mimetype of a given file.

Link: https://wiki.archlinux.org/title/XDG_MIME_Applications
2024-10-22 19:02:04 +02:00
4ec1e81873 feh: Use theme configuration file instead of alias 2024-10-22 19:01:45 +02:00
e85f13def7 zsh:alias:feh: Add --start-at flag
I found this in feh's .desktop file and liked the idea:

With `--start-at` feh will load all files from the directory of the
given file and start the filelist at the given one.

This of course breaks easily if I want to pass more flags before the
file argument, but is easily fixed by first specifying the argument to
`--start-at` and continuing with the rest. I also rarely use any flag
besides the one already defined in the alias.
2024-10-22 18:46:14 +02:00
626855ec69 vim:keys:TODO: Add <leader>[hl] v-mappings
TODO: <SUBJECT>
2024-10-21 17:19:52 +02:00
79977eb81f tmux: Unbind <prefix> + arrow keys
I don't use them.
2024-10-21 17:14:17 +02:00
92289052ca tmux: Make <prefix>[hjkl] not repeatable
This is more than often annoying. For example when switching from a fzf
pane to a vim pane (i.e. needing these bindings instead of `C-[hjkl]`)
and then trying to move the cursor.

Reverts: 048933e67d ("tmux: Make `<prefix>[hjkl]` bindings repeatable")
2024-10-21 17:14:17 +02:00
96ebc4e824 vim:spf:en: Add 'lockdown' 2024-10-19 18:12:08 +02:00
ce13d89c5b *: Remove accidentally added file
I accidentally staged a temporary file in b61894fcc9
("vim:ftplug:gitcommit:TODO: Adjust subject length limit").
2024-10-19 18:10:53 +02:00
f4d3a4364b vim:xdg: Fix updating spellfile through modeline
Setting `&spellfile` from the modeline is not allowed and will result in
an `E523: not allowed here` error. Fix the updating of the file by
additionally having an autocommand on BufWinEnter (i.e. after the
modeline was read).

TODO: Also get rid of the error message when rereading the modeline (:e)
2024-10-19 17:57:47 +02:00
d142200a6c dircolors: Recognize README.wiki.md as README 2024-10-18 17:32:33 +02:00
f9764de6d5 vim:keys:TODO: Handle errors when referencing commits 2024-10-18 16:13:36 +02:00
09f9ffbd8e vim:ftplug:gitcommit: Abbreviate buffer-locally
Abbreviate `cq` only in the current buffer (i.e. the commit message).
2024-10-18 16:13:36 +02:00
890c8526ee vim:ftplug:gitcommit: Abbreviate cq to %d | x 2024-10-18 16:13:36 +02:00
91be5135eb tmux: Remove completed TODO
Fixed: 7dcd00058f ("tmux:TODO: Do not modify selection when
scrolling")
Fixed-by: aa901099b0 ("tmux: Use C-[ey] for scrolling with the wheel")
2024-10-18 16:13:35 +02:00
3e9dcaff9d tmux: Paste primary selection with middle mouse
Similar to everywhere else, paste the primary X selection (XA_PRIMARY)
instead of the most recent tmux paste buffer.

TODO: Forward event to 'root' key-table to prevent code duplication
2024-10-18 16:13:35 +02:00
012d913901 tmux: Get rid of "Not in a mode" error
The copy command should only be executed when not in a mode (i.e.
alternate?). This gets rid of the error message "Not in a mode" when
double/triple clicking inside of vim etc..
2024-10-18 16:13:35 +02:00