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.
`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).
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.
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.
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.
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.
Neovim does not make `has('clipboard')` obsolete. It only simplifies
clipboard support but `has('clipboard')` will still return `0` if no
supported clipboard program is installed.
See `:help clipboard`
Nvim has no direct connection to the system clipboard. Instead it
depends on a |provider| which transparently uses shell commands to
communicate with the system clipboard or any other clipboard
"backend".
and `:help clipboard-tool`
The presence of a working clipboard tool implicitly enables the '+'
and '*' registers. Nvim looks for these clipboard tools, in order of
priority:
- |g:clipboard|
- pbcopy, pbpaste (macOS)
- wl-copy, wl-paste (if $WAYLAND_DISPLAY is set)
- xclip (if $DISPLAY is set)
- xsel (if $DISPLAY is set)
- lemonade (for SSH) https://github.com/pocke/lemonade
- doitclient (for SSH)
http://www.chiark.greenend.org.uk/~sgtatham/doit/
- win32yank (Windows)
- termux (via termux-clipboard-set, termux-clipboard-set)
- tmux (if $TMUX is set)