This way it is more easily extendable.
This also gives the possibility to modify it in ftplugins. I thought
about removing 'de' from the dictionary in the tex.vim ftplugin to
encourage using `\"a` and alike.
When 'lazyredraw' is set the search count is not displayed. This seems
like a bug as it is being displayed if `n` and `N` are not remapped.
Fix this by shortly turning off lazyredraw and resetting it after.
This leads to the new problem that hlsearch is not triggered. It does
stay though after searching with `/<CR>`, so this is a smaller issue I
can fix later.
Found thanks to: https://github.com/kevinhwang91/nvim-hlslens/issues/34
In a terminal with libtermkey support (e.g. my st build), <Tab> and
<C-I> can be differentiated.
Because of that the keys have to be mapped explicitly.
Add two vmaps that call ExpandVisualSelection() for the appropriate
direction.
That expands the selection over all directly following lines in the
given direction that contain the current selection at the same position.
Example:
```
- TODO: ...
- TODO: ...
- TODO: ...
```
In visual block one can select `TODO: ` on the first line and then call
`ExpandVisualSelection(1)` which results in a block selection that spans
over all other TODOs as well.
Map <C-BS> (i.e. Ctrl-Backspace) to delete one word in insert mode & co.
as it is properly recognized in some terminals implementing [fixterm][1]
(e.g. kitty and patched st).
Keep the <C-H> mapping for other terminals but reuse the <C-BS> mapping.
[1]: http://www.leonerd.org.uk/hacks/fixterms/
Similar to <leader>* in normal mode, set the search pattern to the
visual selection and start a ripgrep search.
To not mess up the commandline, potential quotes that are the same as
the ones used around the string need to be escaped. As this is only
possible with double quotes, a second layer of backslash escaping is
needed as well.
Because of that, **before** escaping backslashes and double quotes, all
backslashes need to be escaped a second time. The other way around would
result in two backslashes in front of each double quote, which would
miss the whole point entirely.
In addition GetVisualSelection needed to be expanded to first reselect
the visual selection for it to work in the new mapping.
I rarely use them and are more an annoyance.
For the case that I want to enable them in a session, move the
numbertoggle augroup into a function and add an autocommand on
`OptionSet relativenumber`.
Underline old cursor position for better readability. Reusing
`TermCursor` made me confuse the current window many times.
My favorite solution would be an empty box around the position similar
to how terminals do it when focus is lost. But I fear that this is not
possible with a simple highlighting group.
When the cursor is on the last character of the hash (e.g. after
pasting), the mapping would break and insert the commit subject behind
the next word.
Fix this by using `viw<Esc>` which places the cursor on the end of the
current word independent of the placement of the cursor.
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.
`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.
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`).
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).