Commit Graph

432 Commits

Author SHA1 Message Date
e8a8f9637a vim:coc: Re-enable backup files
CoC disables backup files due to a problem with a typescript
language-server (it becoming slow when the backup file is written,
triggering a `structureChanged`). But:

1. I want backup files
2. I do not use that language server
3. If I would:
	1. I could disable backup files in a filetype plugin
	2. The linked issue is from 2019 - no idea if this is still
	   present today
4. I don't think this issue is even a thing with a `&backupdir` that
   does not include relative directories (which is the case for me)

So remove the lines disabling backups and go back to vim's defaults:
`nobackup` and `writebackup`.

Link: https://github.com/neoclide/coc.nvim/issues/649
2025-09-03 11:54:50 +02:00
0e5baf5e36 vim:coc: Add coc-go server 2025-09-03 11:36:27 +02:00
372865f9c4 vim:syn:md: Use lookarounds instead of \zs & \ze
Apparently the `\zs` token does not match characters if they are already
part of a syntax match. For example in `[^0][^1]` only the zero footnote
is matched. Fix this by using a positive lookbehind that does not have
this limitation.

Additionally, use a negative lookahead for the colon to make the pattern
slightly more readable, since it does not need the end-of-line check.
2025-08-12 13:00:41 +02:00
3fb5b5f376 vim:syn:md: Conceal numeric footnotes
Conceal numeric footnotes with superscript numbers. The whole thing is a
bit of a gimmick since only single digit numbers are concealed but I had
this idea for quite some time and wanted to execute it.

When not put into the `after/` directory, the matches are overwritten by
the `markdownFootnote` group.
2025-08-12 12:59:33 +02:00
688f8e18aa vim:ftplug:shell*: Add - to &iskeyword
Add the dash to the keyword character list since command names can (and
do) contain them.
2025-08-06 12:30:35 +02:00
5baad5d7a2 vim:ftplug: Remove broken cuda.vim symlink
c.vim does not exist anymore since commit 4802abee17 (vim:setts:
Revert "Include `-` in `&iskeyword`", 2025-07-20).
2025-08-06 12:30:35 +02:00
fc0cf2ff0a vim:keys: Make git hunk mappings shorter
I act very rarely on the whole file but quite often on hunks, so it
makes sense to have the mappings for the latter shorter.

The new mappings I wanted to use for the whole file are conflicting with
`<leader>gf` (i.e. `:GFiles`), so I've disabled them for now.
2025-08-05 10:57:00 +02:00
1ee41e1c5b vim:keys: Reference commits w/ --pretty=reference
Use git's preferred way of referencing commits (`--pretty=reference`)
instead of the kernel's (`--pretty='%h ("%s")'`). I can see that
specifying the date makes sense and that the quotes are at best
unnecessary in the parentheses and at worst confusing when the subject
contains quotes itself.

Link: https://git-scm.com/docs/SubmittingPatches#describe-changes
2025-07-20 03:37:47 +02:00
4802abee17 vim:setts: Revert "Include - in &iskeyword"
Commit 0369218114 ("vim:settings: Include `-` in `&iskeyword`") added
the dash to `&iskeyword` but I didn't give an explanation for the change
and don't remember what led me to it. Today I'm annoyed by it since it
breaks some stuff (e.g. previously the C pointer arrow and syntax
highlighting of negative numbers in Python). The C ftplugin is obsolete
now, so delete it.

This reverts commit 0369218114.
2025-07-20 03:05:10 +02:00
5539a5e437 vim:ftplug:asl: Use 2 spaces for indentation 2025-07-09 14:01:15 +02:00
39486a6f45 vim:ftdetect:asl: Allow uppercase file ending 2025-07-09 14:01:11 +02:00
fded58696a vim:keys:TODO: omap [ia]$ in shell scripts
I'd like to have `$` as a text object in shell scripts to select
parameter expansions and command substitutions.
2025-06-27 16:38:52 +02:00
cf68e01510 vim:keys: Center line when opening quickfix entry 2025-06-27 16:37:20 +02:00
f5c6baf856 vim:keys: Add note about macro_type augroup 2025-06-27 16:36:21 +02:00
a8d46caa78 vim:keys: Modularize changes to ]]/][ mappings
Instead of changing the functionality of `]]` and swapping `][` and
`]]` in one mapping, do it in two separate steps. This way both changes
can be used independently of each other.

Fixes: 459e0b7113 ("vim:keys:TODO: Modularize changes to ]]/][ maps")
2025-06-27 16:33:56 +02:00
2d9b00a0d3 vim:keys: Convert decimal numbers with <leader>hex 2025-06-27 13:29:25 +02:00
781e3a2f4b vim:keys: Substitute only inside visual selection
When substituting in a visual block selection, the automatically
inserted range `'<,'>` is not enough as the pattern will also match
outside of the selection on the same lines. To only match inside the
selection, insert the `\%V` atom.

Theoretically the pattern will also need the atom before the last
character to make sure that everything is inside the selection, but this
can be inserted manually when needed (see `:h /\%V`).
2025-06-26 16:18:22 +02:00
28903758a8 vim:ftdetect: Use C's syntax highlighting for .asl
Make .asl files (ACPI Source Language) belong to the 'c' filetype. Not
perfect, but an easy way to have some colors without a full plugin.

Additionally set the 'asl' filetype too, in case I want to add some
ftplugin in the future.
2025-06-11 12:50:45 +02:00
6b98838f7e vim:keys: Remove unneeded mappings
These were commented out already for longer. For `(` I have delimitMate
and the `<CR>` mapping conflicts with the one from coc.nvim (which
includes the `<C-G>u`)
2025-06-02 20:59:43 +02:00
f0ec75aa9c vim:keys: Map <leader>d also in visual mode 2025-06-02 20:59:43 +02:00
533e82cb81 vim:keys: Add :keeppatterns to substituting vmaps
All of these should not modify @/.
2025-06-02 20:59:43 +02:00
e0e1e5d971 vim:keys: Fix <Cmd> vmaps
When switching to <Cmd> for mappings in fc9874bf97 ("vim:keys: Use
<Cmd> for plain command mappings") I forgot that the previously inserted
selection range marks (i.e. '<,'>) are missing now. This broke vmaps
that used :substitute without having added them manually.

Since <Cmd> has some performance benefits, I want to keep it and add the
missing marks where needed.
2025-06-02 20:59:37 +02:00
9dc8e71ce6 vim:keys: Map <C-w>! to move window to new tab
I memorized tmux's <prefix>! mapping, but always forget how it is done
in vim.
2025-05-28 14:05:40 +02:00
d7289e1d69 vim:xdg: Fix E474 when &spl has multiple languages
Escape comma to not get

    E474: Invalid argument
2025-05-20 11:47:42 +02:00
2aeb664692 vim👨 Set 'showbreak' to NONE 2025-05-20 11:47:42 +02:00
671d924cca vim:fzf: Span fzf over full window in tmux
Use tmux popup windows for fzf in vim, so that it spans (almost) the
full tmux window. My use-case for this is, that sometimes I open fzf in
a split pane and notice then that the lines are too long for the width
of the pane. Since the fzf window won't resize if I resize the pane
(TODO: issue in fzf.vim), I have to first close it, resize and then
reopen fzf. I hope to fix this by using always the big tmux popup and
eliminating the need to resize at all. The issue remains when vim is in
a split window outside of tmux. I can imagine that this will become
annoying, but we'll see...
2025-04-30 17:44:15 +02:00
25c00c6efd vim:setts: Use ellipsis for lcs extends & precedes 2025-04-30 17:03:04 +02:00
ad025e7d9d vim:setts: Highlight trailing spaces a bit better
Switch from middle dot to bullet point, since it is a bit bigger.
2025-04-30 17:03:04 +02:00
d3cbc9d560 vim:setts: Change 'tabstop' to 8
I got used to code that is indented with (meant) tabs of width 8.
2025-04-30 17:03:04 +02:00
3599a147b8 vim:coc: Abort when coc is not loaded 2025-03-26 00:48:48 +01:00
e04d78a9d8 vim:ftdetect: Glob clang-formats 2025-03-25 18:04:03 +01:00
bf4c5a1291 vim:keys: Alias <leader>g* to <leader>* 2025-03-25 18:03:59 +01:00
393c4e055f vim:coc: Disable diagnostic signs
The line number highlighting is enough and this way I still see the git
signs (without messing with priorities).
2025-03-20 12:51:10 +01:00
63febddf82 vim:coc: Decrease message delay
The value of 25 is orientated at my key repeat rate of 50 (see xinitrc).
This way the message comes fairly quick while not refreshing on every
character when keeping a navigation key pressed.
2025-03-20 12:51:09 +01:00
2b1bdf0fee vim:coc: Disable inlay hints 2025-03-20 12:51:02 +01:00
a73334c8f0 vim: Disable spell checking in .clang-format
Find's a bunch of false positives.

TODO: <COMMENT>
2025-03-11 11:29:11 +01:00
da27170b7e vim:ftplug: Symlink cuda.vim to c.vim 2025-03-05 00:50:16 +01:00
4953434904 c.vim: Use setlocal 2025-03-05 00:50:12 +01:00
459453dc5e fzf.vim: Set w:ignore_non_ascii_chars only once 2025-03-03 16:38:59 +01:00
103355478b fzf.vim: Set filetype to hybrid vim + fzf
This way the Unicode characters are not highlighted. This hopefully
has no weird side-effects.
2025-03-03 16:38:59 +01:00
c348624a00 fzf.vim: Ignore more non-ASCII characters 2025-03-03 16:38:59 +01:00
6531800c4a markdown.vim: Don't set formatoptions
Automatic formatting is annoying and trailing whitespace is nothing I
want ever in my files.
2025-02-05 09:35:20 +01:00
2c55f45783 markdown.vim: Do not fold everything when loading 2025-02-05 09:35:18 +01:00
558bb0582e man.vim: Check if WinResized is supported
WinResized was introduced rather recently with vim patch 9.0.0917 /
neovim v0.9.0 via commit 4571ba4d0a52 ("vim-patch:partial:9.0.0917: the
WinScrolled autocommand event is not enough (#21161)").
2025-01-29 14:27:11 +01:00
b1a21fbdb0 vim:ftplug:man: Try to keep the position in file
How did I only test this while being at the top of the page?
2025-01-25 13:37:11 +01:00
f863f66542 vim:ftplug:man: Add comment to nospell setting 2025-01-25 03:04:35 +01:00
2842bba50c vim:ftplug:man: Move scrolling settings from zprofile 2025-01-25 03:02:07 +01:00
78917a686e vim:ftplug:man: Enable resizing with hard-wrapping
From :h :Man:

> when running `man` from the shell and with that `MANPAGER` [='nvim
> +Man!'] in your environment, `man` will pre-format the manpage using
> `groff`. Thus, Nvim will inevitably display the manual page as it was
> passed to it from stdin. One of the caveats of this is that the width
> will _always_ be hard-wrapped

Since I actually don't like `g:man_hardwrap=0`/`MANPAGER=999` (e.g.
scrolling can be a mess with very long wrapped lines), add an
autocommand that is meant to reload the manpage through `:edit` after
every resize, so that its hard-wrapping adjusts to the new size.

This is slightly hacky, but does its job quite well.

Move the man.vim into after/ftplugin so that it overwrites the `set
wrap` of the global ftplugin, which I want turned off, since it messes
with the buffer shortly when resizing.
2025-01-25 02:57:38 +01:00
467df52c66 vim:ftplug:man: Fix wrapping due to signcolumn
man(1) will assume it can use the full width of the terminal when
hard-wrapping the lines. When signcolumn is enabled the width is one
cell smaller and thus, lines that have a character in the last column
will be wrapped by vim (i.e. almost all of them).
2025-01-25 01:08:51 +01:00
fde6aa06a4 vim:quick-scope: Only highlight on f,F,t,T 2025-01-21 18:32:17 +01:00