Commit Graph

1484 Commits

Author SHA1 Message Date
611e83b1c8 vim:keys: Streamline [[ and ]] mappings
Use the `s` flag, so that the position before the last jump is updated
automatically.

Use `<Cmd>` so that both normal and visual mode mappings become
identical and can be merged. This has the added benefit that it now also
maps in operator-pending mode.

Complete the TODOs.
2024-11-20 12:55:18 +01:00
f5ec488b08 vim:keys: Better >> & << for tab-indent-space-align 2024-11-16 02:27:22 +01:00
d831a4140e vim:setts: Set cindent & preserveindent
For slightly better indentation.
2024-11-16 02:22:40 +01:00
9271350aab zsh:keys: Fix non-existing mapping of vi-kill-word
vi-kill-word does not exist. This change was lying around uncommitted
for ages now.

Fixes: 658797bda2 ("zsh:keys: Use `vi-` variants of navigation binds")
2024-11-06 13:56:27 +01:00
5af20402b9 vim:looks: Formatting 2024-11-06 13:53:25 +01:00
066f30a39f vim:au: Pass Funcref to timer_start
Apparently on older neovim versions, passing the name of script-local
functions to `timer_start` is not enough (in v0.10.2 this works, but
v0.7.2 not). Fix this by wrapping it in `function(...)` to pass a
Funcref.

See :h timer_start:

> timer_start({time}, {callback} [, {options}])
> [...]
> {callback} is the function to call.  It can be the name of a function
> or a |Funcref|.  [...]
2024-11-06 13:44:03 +01:00
1d86941a07 tmux: Remove unneeded semicolon 2024-11-06 13:33:54 +01:00
ca1483052b git: Set filetype in modeline
Github does not highlight syntax otherwise.
2024-11-06 13:29:48 +01:00
e82224684b zsh: Re-enable global rc files
I am not sure why I ever disabled them, but this goes way back to the
very first commit. Since some packages rely on /etc/profile.d/ to add
their location to PATH I want /etc/zsh/zprofile to source these. On my
current Manjaro machine it contains just this line:

    emulate sh -c 'source /etc/profile'
2024-11-06 02:51:31 +01:00
edb9a2920c dircolors: Set filetype in modeline 2024-11-06 02:48:32 +01:00
2437044ed6 vim:looks: Add function to easily see syntax stack 2024-11-06 02:44:28 +01:00
c5463595c0 vim: Rename aesthetics.vim to looks.vim 2024-11-06 02:44:03 +01:00
f404c150b1 vim:setts: Decrease 'scrolloff' (15 -> 5)
It's annoying sometimes.
2024-11-06 02:39:46 +01:00
a3fa9a043f vim:coc: Fix copy-paste error 2024-11-06 02:38:42 +01:00
965786d19a vim:ftplug:wiki: Fix completion with Tab 2024-11-06 02:37:06 +01:00
22b774b839 zsh:nameddirs: Unset the right variable 2024-11-05 22:18:09 +01:00
724430979c zsh:nameddirs: Only set ws/ss when they exist 2024-11-05 22:17:40 +01:00
7bd42b2e2b zprofile: Add CUDA related paths
Normally added by /etc/profile.d/cuda.sh and sourced by /etc/prodile.

TODO: Should I source /etc/profile.d/* from one of /etc/zsh/zprofile and
      $ZDOTDIR/.zprofile?
2024-11-05 22:14:52 +01:00
003ac56cac gdb: Initial revision 2024-11-04 23:17:58 +01:00
e95bc71b0b vim:au: Improve clearing of old selection highlight
Because of the deferring of the highlight, the old selection highlight
was deleted only when a new one was created. Introduce a second timer
that makes sure that the old highlight is cleared earlier.
2024-11-04 17:43:41 +01:00
2322f4ad67 vim:au: Work around additional call of _highlight_cword
Sometimes `_highlight_cword` is called without the existence of
w:cword_timer_id but with a w:cword_match_id. No idea why.

I thought that it might be a race condition, but does not seem like it.
(Also not sure if this could even run in parallel)

TODO: Investigate how _highlight_cword can be called without
      w:cword_timer_id
2024-11-04 17:25:27 +01:00
312ea225da vim:au: Fix flickering of selection highlights
Defer the clearing of the old highlight as well. This means that the old
highlight will remain a bit longer but prevents the highlight from
flickering because of the continuous `matchdelete`.
2024-11-04 17:17:20 +01:00
551fde8f2b vim:au: Fix empty line selection in linewise-visual
`highlight_selection()` is supposed to abort if the visual mode was
started on an empty line. This was done correctly for charwise-visual
but failed to do so in linewise-visual.
2024-11-04 16:54:51 +01:00
fc1e1bdd1e vim:ftplug:fugitiveblame: Disable cword highlighting 2024-11-04 13:22:33 +01:00
c1c3e5aa99 zathura: Tweak key mappings in presentation mode 2024-11-04 09:55:37 +01:00
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
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
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