Commit Graph

407 Commits

Author SHA1 Message Date
993bd5a16e vim:ftdetect:envrc: Require .envrc only as suffix
Otherwise opening a template (i.e.
`.local/share/direnv/templates/*.envrc`) will not set the filetype
properly.
2023-01-11 22:04:32 +01:00
9de97a7f93 vim:ftdetect: Set ft=sh when opening .envrc files 2023-01-11 22:03:19 +01:00
890464b8dd vim:ftplug:tex: Close quickfix window on movement
When continuous compiling on write, the quickfix window can be tedious
when it pops up every time containing errors that will be resolved in
the future or ignored.

Fix this by closing it as soon as the cursor is moved.
2023-01-11 21:42:43 +01:00
fdafdb6154 vim:ftplug:tex: Use tex_build as build directory 2023-01-11 21:42:42 +01:00
e51427143f vim:keys: Format paragraph with <C-q> in INSERT
`i_CTRL-Q` is not really useful anyways:

> Same as CTRL-V.
> Note: Some terminal connections may eat CTRL-Q, it doesn't work then.
> It does work in the GUI.
2023-01-11 21:42:39 +01:00
fed62f3b6d vim:keys: Keep the cursor position when formatting
Quickly formatting multiple paragraphs is now not as simple as before,
but the benefits still prevail.
2023-01-08 14:04:13 +01:00
5dc975c155 vim:highNonASCII:french: Add forgotten ÿ 2023-01-05 09:00:27 +01:00
678910f4ec vim:highNonASCII:french: Move œ (oe) behind o 2023-01-05 09:00:06 +01:00
8fda4ce158 vim:setts: Set conceallevel=1
I want concealable text to be replaced if possible but not hidden
completely (i.e. `=2`) as this makes moving over lines nauseous.
2023-01-04 22:44:41 +01:00
06c0d17fe4 vim:keys: Add <leader>v/ to search in visual selec 2022-12-29 19:55:02 +01:00
616988560a vim:keys: Add mapping for commit amending
Map `<leader>gca` to fugitives `G commit --amend`, as I use that quite
often.

Also change the normal commit mapping to use double `c`s for unambiguity
between the mappings and as I already got the habit of pressing `c`
twice to skip waiting `timeoutlen` (As the mapping was already
ambiguous with `<leader>gcd` for `:Gcd`).
2022-12-28 13:55:08 +01:00
dacd6d5de0 vim:keys:<leader>": Convert only pairs of quotes
When converting double to single quotes with `<leader>"`, only pairs of
quotes should be converted. This lowers the false positive rate by
trying to make sure that the double quotes are really used for string
quotation and not for something else (e.g. exactly these mappings).
2022-12-28 13:53:33 +01:00
9ac408ccae vim:aucmd:highVisualSel: Yank lines silently
When yanking multiple lines, a message stating that will appear. Make
this message silent.
2022-12-28 13:44:19 +01:00
aae84fd197 vim:aesth:highNonASCII: Add uppercase Umlaute
Forgot to add the uppercase Umlaute as well.
2022-12-28 13:42:48 +01:00
b559ff646b vim:aesth:highNonASCII: Support multi-spelllang
`&spelllang` can be a list of multiple languages. Support that by
matching the language at the start, the end and/or between commas,
instead of comparing the value, and then appending to `l:ignore_chars`
for every matched language.
2022-12-28 13:40:50 +01:00
c2a657c609 vim:aesth:highNonASCII: Support spelllang=french 2022-12-28 13:39:46 +01:00
1360969ca4 vim:aesth: Refactor HighlightNonASCIIChars()
Make it easier to support other languages.
2022-12-28 13:32:02 +01:00
fe669c0aa7 vim:keys: Add visual equivalent of substitute maps 2022-12-28 13:23:05 +01:00
731a290d7b vim:keys: Map <leader>" to s/"/'/g
I prefer single quotes when a language supports them for normal strings
(e.g. python & vimlang). Add this mapping for a quick conversion.
2022-12-28 12:57:13 +01:00
fd1cb36437 vim:keys: Rephrase wrap-move comment s/real/normal 2022-12-28 12:32:55 +01:00
46ec34826e vim:keys: Map display movements only when wrapping 2022-12-27 04:24:21 +01:00
3a7f06256f vim:keys: Keep selection when changing indentation 2022-12-25 22:42:22 +01:00
4c111c0e3b vim:keys: Make display-line movements the default
I'd rather have the movement mappings behave on display-lines to make it
easier when navigating in very long lines.
2022-12-22 10:55:16 +01:00
a14bc72716 vim:autocmd: Highlight visual selection
Highlight visual selection similar to the cword highlight. Restrict the
cword highlight to only normal mode.
2022-12-22 01:19:01 +01:00
66a231e8a8 vim:autocmd: Remove forgotten debug print 2022-12-22 01:16:38 +01:00
47150894c2 vim:ftplugin:markdown,tex: Turn on line-wrap 2022-12-12 11:24:19 +01:00
0ef3cd3723 vim:setts: Turn off line wrapping 2022-12-12 11:21:27 +01:00
9abf215871 vim:autocommands: Reset old_cword when deleting
When deleting the match, w:old_cword has to be unset as well. Otherwise
it can happen that it is not properly readded (e.g. when moving from a
word to an empty line and then back to the same word).
2022-12-06 15:34:33 +01:00
5ee98950eb vim:autocmd: Check if same cword when highlighting
When highlighting the current word, check if it is the same as the
currently highlighted one, so that matchdelete and matchadd are not
called unnecessarily.
2022-12-06 15:31:53 +01:00
a290c07acc vim:settings: Improve line wrapping behaviour 2022-11-21 16:38:52 +01:00
33491571e2 vim:autocmd: Add TODO and wip code for old_cursor
The commented code seem to not work but I want to have the behaviour
when entering the command line too.
2022-11-21 16:36:53 +01:00
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
7a4e8e6df2 vim: Set only local value when cycling spelllang
When having multiple windows open, I want it to change only for the
current buffer/window.
2022-11-21 15:18:13 +01:00
a85f5ba81a vim: Do not always highlight Umlaute as non-ascii
When the spelling language is set to German, they should not be flagged
and thus excluded from the regex.
2022-11-21 15:16:59 +01:00
684421d337 vim:autocmd: Start insert mode on new file 2022-11-01 16:55:42 +01:00
594e31d4b7 vim:coc: Customize completion menu mappings
When no item was inserted yet, the first tab should insert the first
item or the first shift-tab should select and insert the last item.
2022-10-21 03:34:10 +02:00
2d27e598b6 vim:coc: Use tabs for indentation 2022-10-21 02:05:21 +02:00
fc9f8f93ef vim:coc: Fix issues with new version v0.0.82
- CheckBackspace needs to be used instead of <SID>CheckBackspace
- Comment out clashing/obtrusive leader/space mappings
- Change classobj mappings to use `o` as they were clashing with the
  comment textobj.
- Simulate the default statusline with the help of 'statusline'.
  Otherwise it would be empty/just containing coc elements.
2022-10-21 02:05:21 +02:00
928b1e8647 vim:coc: Add the remaining parts of suggested conf
"Lieber haben als brauchen".
2022-10-21 01:43:52 +02:00
3d44400c59 vim:plugins: Update coc.nvim to v0.0.82
Update the copied parts from the suggested config in the README.
2022-10-21 01:40:28 +02:00
77393007bf vim: Move coc config into existing structure 2022-10-21 01:33:36 +02:00
83e10f32da vim:plugins: Hotfix broken packloadall w/ nvim 0.8 2022-10-21 01:03:17 +02:00
b698873d2c vim:keys: Fix BCommits and G blame mapping clash 2022-10-21 00:52:45 +02:00
a94f72c4d9 vim:keys:<leader>*: Start vim's search too
Additionally to start the search with ripgrep, start a vim search as
well. That way navigation between search results in the opened file is
easier.

The register is modified directly and hlsearch is turned on manually
instead of using the builtin `*`, so that the cursor does not move to
the next result in the current file.
2022-10-21 00:45:47 +02:00
1aa6266200 vim:keys: Fix <leader>* for words starting w/ b
`<C-R><C-W>` inserts the cword, but skips over any character that were
already typed. This broke the search for words beginning with a `b`.
2022-10-21 00:39:21 +02:00
298b205aa9 vim:coc: Add vimlang and json language server 2022-10-20 21:55:53 +02: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