From :h :Man:
> when running `man` from the shell and with that `MANPAGER` [='nvim
> +Man!'] in your environment, `man` will pre-format the manpage using
> `groff`. Thus, Nvim will inevitably display the manual page as it was
> passed to it from stdin. One of the caveats of this is that the width
> will _always_ be hard-wrapped
Since I actually don't like `g:man_hardwrap=0`/`MANPAGER=999` (e.g.
scrolling can be a mess with very long wrapped lines), add an
autocommand that is meant to reload the manpage through `:edit` after
every resize, so that its hard-wrapping adjusts to the new size.
This is slightly hacky, but does its job quite well.
Move the man.vim into after/ftplugin so that it overwrites the `set
wrap` of the global ftplugin, which I want turned off, since it messes
with the buffer shortly when resizing.
man(1) will assume it can use the full width of the terminal when
hard-wrapping the lines. When signcolumn is enabled the width is one
cell smaller and thus, lines that have a character in the last column
will be wrapped by vim (i.e. almost all of them).
My brain assumes that the first block handles the case of the url being
an https one if I read http in the condition. Swap them and negate the
condition for better readability.
This might be a symptom of this condition being to complex, but well -
it's shell scripting ¯\_(ツ)_/¯
Apparently there was an issue with the conversion from ssh to https
which I never noticed? The script would replace the colon of the
`https://` and not the one after the domain:
https///github.com:[...]
I rewrote both cases in a simpler way while fixing the issue.
This change was laying in a big WIP commit for ages now, waiting for me
to split and commit it nicely. The author date is thus quite far back in
the past.
I sometimes work in files where I cannot remove trailing whitespaces (at
least not permanently). In these cases the background highlighting of
them is quite strong and can be a bit annoying. To make this more
pleasing, use the foreground to highlight trailing characters, as long
as tabs and trailing spaces are displayed as non-space characters.
For this I also set `trail` in `&listchars`, and while at it, merged the
two lines setting `&listchars` and cleaned up some comments.
Use the `s` flag, so that the position before the last jump is updated
automatically.
Use `<Cmd>` so that both normal and visual mode mappings become
identical and can be merged. This has the added benefit that it now also
maps in operator-pending mode.
Complete the TODOs.
vi-kill-word does not exist. This change was lying around uncommitted
for ages now.
Fixes: 658797bda2 ("zsh:keys: Use `vi-` variants of navigation binds")
Apparently on older neovim versions, passing the name of script-local
functions to `timer_start` is not enough (in v0.10.2 this works, but
v0.7.2 not). Fix this by wrapping it in `function(...)` to pass a
Funcref.
See :h timer_start:
> timer_start({time}, {callback} [, {options}])
> [...]
> {callback} is the function to call. It can be the name of a function
> or a |Funcref|. [...]
I am not sure why I ever disabled them, but this goes way back to the
very first commit. Since some packages rely on /etc/profile.d/ to add
their location to PATH I want /etc/zsh/zprofile to source these. On my
current Manjaro machine it contains just this line:
emulate sh -c 'source /etc/profile'
Normally added by /etc/profile.d/cuda.sh and sourced by /etc/prodile.
TODO: Should I source /etc/profile.d/* from one of /etc/zsh/zprofile and
$ZDOTDIR/.zprofile?
Because of the deferring of the highlight, the old selection highlight
was deleted only when a new one was created. Introduce a second timer
that makes sure that the old highlight is cleared earlier.
Sometimes `_highlight_cword` is called without the existence of
w:cword_timer_id but with a w:cword_match_id. No idea why.
I thought that it might be a race condition, but does not seem like it.
(Also not sure if this could even run in parallel)
TODO: Investigate how _highlight_cword can be called without
w:cword_timer_id
Defer the clearing of the old highlight as well. This means that the old
highlight will remain a bit longer but prevents the highlight from
flickering because of the continuous `matchdelete`.
`highlight_selection()` is supposed to abort if the visual mode was
started on an empty line. This was done correctly for charwise-visual
but failed to do so in linewise-visual.