Commit Graph

21 Commits

Author SHA1 Message Date
a0d68f9265 vim:autocmd: Highlight old cursor position
Highlight old cursor position as if the cursor was still there when
switching window focus.

This way I keep an overview of the cursor positions.
2022-11-21 16:31:58 +01:00
93ef5afaba vim:autocmd: Update cword highlight in insert mode 2022-11-21 15:52:26 +01:00
ac99f373d3 vim:autocmd: Highlight cword with lower priority
Use a priority of below 0 so that the cword highlighting does not
overrule the highlighting of `hlsearch`.
2022-11-21 15:50:55 +01:00
762089cbee vim:autocmd: Use matchadd to Highlight cword
Use `matchadd` instead of `match` as it has no limit on the number of
highlights.

Also call the function every time the cursor moved instead of only when
holding. This makes it snappier while also keeping the highlight when
moving inside the cword.
2022-11-21 15:46:50 +01:00
684421d337 vim:autocmd: Start insert mode on new file 2022-11-01 16:55:42 +01:00
bc0affc832 vim:autocmd: Do not mark stdin as modified
Set `nomodified` after reading from standard input. This way the buffer
can be closed without error message.

This will **not** disable modified warnings completely. If the input is
modified after read, vim will reset `modified` (As it should).
2022-10-16 02:01:25 +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
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
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
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
01ebc211bb vim:autocmd: Disable relative numbers in insert
As relative line numbers are only really needed in normal mode and in
the current buffer, disable them in insert mode or when the
buffer/window is not focused.
2022-07-12 21:00:05 +02:00
fc0969abba vim: Drop textwidth autocmd for native way
Instead of needing a manual autocmd that triggers on textwidth changes,
colorcolumn supports offsets to textwidth natively.
2022-03-22 16:18:58 +01:00
94271371dc vim:autocmd: Fix typo in OptionSet textwidth
The old `textwidth` value is meant to be subtracted from colorcolumn, to
then add the new one.

Fixes: 41656d28d6 ("vim:autocmd: Reset textwidth value in colorcolumn")
2022-03-21 15:24:31 +01:00
41656d28d6 vim:autocmd: Reset textwidth value in colorcolumn
Instead of overwriting the entire colorcolumn value, reset only the
textwidth value, by subtracting it first and then readding it.
2022-03-18 17:33:56 +01:00
9796992737 vim:autocmd: Highlight word under cursor 2022-02-17 15:21:51 +01:00
a98457e66b vim:autocmd: Adjust colorcolumn with &textwidth 2022-02-16 00:54:19 +01:00
8c66e1cf68 vim:autocmd: Add bindings when sourcing termdebug 2021-07-13 16:54:55 +02:00
8c37dc2316 vim:vimrc.d:*: Use " instead of # in header lines 2021-07-13 16:52:42 +02:00
22501182ce vim: Use timer instead of autocommand for autoread 2021-04-26 17:56:15 +02:00
f746909e3a vim: Enable &autoread + autocmd for regular check 2021-02-17 02:38:15 +01:00
b9f26d7482 vim: Split vimrc into vimrc.d/ 2020-12-23 01:42:42 +01:00