Commit Graph

432 Commits

Author SHA1 Message Date
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
39e8b266d0 vim:keys: Add mapping to strip trailing whitespace 2022-10-16 01:57:16 +02:00
896970de81 vim:keys: Remove unused mappings to move lines 2022-10-13 18:48:35 +02:00
7be49e9318 vim:keys: Use RFC 3339 for vmap version of utc
Forgot to change the format for both mappings in 73aa0e9752
("vim:keys: Use RFC 3339 when converting unix times").
2022-10-13 18:29:30 +02:00
3b86618541 vim:keys: Map :{,B}Commits in other modes too
They support a range to show only commits that track the range.
2022-10-13 18:29:29 +02:00
a02fbd4403 vim:keys: Swap behaviour of ]] and ][
Swap the behaviour of `[[` `[]`. This way the first bracket indicates
the direction of the motion and the second the target (i.e. open or
closed brace).

I assume that the reason behind these mappings is to be able to easily
change the direction of the move by 'inverting' the keys (e.g. `]]` ->
`[[`). I understand that, but find the new way more intuitive.
2022-10-13 18:29:29 +02:00
1d2cdf7aea vim:keys: Use word boundaries with <leader>*
Ripgrep supports word boundaries, may as well use them to act closer to
`*` (:h star).
2022-10-12 12:37:17 +02:00
50640bc294 vim:ftplugin: Remove zsh.vim
zshOption has improved a lot and isn't even called like that anymore.
2022-10-09 19:51:03 +02:00
e25a0d29a7 vim:keys: Add binding for Signed-off-by trailer 2022-10-06 18:50:50 +02:00
3f259d9cd8 vim: Do not include the line break in selections 2022-09-28 00:58:48 +02:00
2f6d8af3f9 vim:settings: Turn on lazyredraw 2022-08-31 02:39:42 +02:00
5606967050 vim:keys: Fix <leader>dd (clear line)
`0` is necessary to move to real beginning of the line.
2022-08-30 20:39:21 +02:00
bcebc70082 vim:keys: Add mappings for git log 2022-08-30 19:52:23 +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
947a939f67 vim: Move CycleSpellLang into keys.vim
See ba3a54fc4 ("vim: Move numbertoggle autocmd into settings.vim").
2022-08-30 19:52:23 +02:00
6f0b433fdf vim:keys: Add <leader>dd to clear line
I sometimes have the situation that I want to create empty lines but
they contain either whitespace from keeping the indentation and/or the
comment string (`o` on a comment line). My current workflow is to either
delete it and recreate it properly (e.g. from the 'other side' i.e. a
non-comment line) or clear it with `cc`. Both ways are a bit awkward.

Add a mapping that clears a line but stays in normal mode.

Also remove the `<leader>d` mapping that deletes and puts the content
into the system clipboard as I rarely use this one.
2022-08-30 14:57:52 +02:00
c0892a8bdb vim:keys: Map <leader>bt to buffer ctags 2022-08-30 14:33:41 +02:00
7a081c0bd9 vim:keys: Map <leader>* to :Rg search of cword 2022-08-30 14:32:54 +02:00
4af065f1fd vim:plugs: Redefine :Rg to include hidden files 2022-08-30 14:31:37 +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
b56eaa0eb2 vim:keys: Map <leader>gb to git blame 2022-08-28 00:11:16 +02:00
ede49ac9f7 vim:keys: Map <leader>gf to git status files 2022-08-28 00:11:15 +02:00
5ab97d6111 vim:keys: Map <leader>gg only with fugitive 2022-08-28 00:10:55 +02:00
4d43566a68 vim:coc: Use pyright 2022-08-26 08:38:07 +02:00
fb90ae3142 vim:keys: Xmap <leader>ga to git add selection
As `GitGutterStageHunk` adds only the selected lines and not the full
hunk, remove the `h` for hunk from the mapping.
2022-08-26 08:37:11 +02:00
9ce1cd236b vim: Remove german umlaut mappings
As I started to type on the international US layout I don't need any
extra bindings for special characters in vim.

Move the update of `spellfile` into xdg.vim, as it was the only
remaining body of `NewSpellLang()` and fits thematically.
2022-08-25 04:27:51 +02:00