Finally changed the 'show line diagnostics' (opening a popup with all
diagnostics on current line) mapping to fit to the other remappings
moving 'diagnostics' to the `e` key, with `<localleader>le`.
And fixed the ability to toggle diagnostics as virtual lines with
`<localleader>lO`.
Update to solely use snacks zen mode, removing both twilight and
zen-mode plugins.
For now, we switch to a personal fork of `snacks.nvim` which enables
explicit enabling and disabling of the zen mode.
If it gets upstreamed we can switch back to the regular snacks plugin.
Streamlined some snacks loading and optional lazy-loading.
Since the molten-nvim plugin supports setting `snacks.nvim` as
`molten_image_provider`, we add it as optional dependency.
It is _not_ enabled yet however, have to figure out how to accomplish
this from the embedded optional spec, and also fix molten-nvim before
adding more stuff to it.
It is no longer necessary to manually install the nushell tresitter as a
lazy plugin spec, according to:
https://github.com/nushell/tree-sitter-nu/blob/main/installation/neovim.md
Instead we just enable the treesitter 'nu' language in the
`languages.lua` file as usual and it works out of the box.
Added suport for the mdx filetype. With the mdx.nvim plugin it will be
recognized and applied to `*.mdx` files. The plugin also associates the
markdown parser with it, and adds some queries for mdx features.
Lastly, added mdx to the list of markdown-like languages in our prose
module so plugins like render-markdown also recognize the language and
work with it.
The reason render-markdown was not working for either is that it
requires the markdown treesitter active for the respective language.
With this, for the filetypes in question we simply tell the markdown
treesitter to also parse these.
This _might_ be a problem in the future if the djot treesitter (which
also exists and can be enabled by TS in nvim) diverges more or some
other unforeseen change happens. For now, it seems to work fine. Might
not support all the features in djot that diverge from md? I have not
used them extensively enough to notice.
Suggestions are given at the top of the completion menu. Additionally,
since that can get really annoying really quick there have been some
changes specifically for copilot.lua:
We start with it disabled. It can be enabled with `<leader>ap` and
disabled again with `<leader>aP` for Ai>coPilot. If the plugin at some
point exposes functionality to toggle itself on/off completely I would
gladly switch to that. The current toggle command only attaches/detaches
the buffer but still runs the client in the background. This is less
desirable for me, plus it means the completions are still done
automatically in blink.
This used to be default (and according to the docs still is?) but I had
to set it manually to still show all models to select from. Perhaps
because we explicitly set 'show_defaults' we also have to be explicit
about this.
Will paste and try to integrate _anything_ into the curent buffer. Wrong
programming language, no formatting, pseudo code, natural language instructions, anything.
For any files under my WIKIROOT directory I am sure that they are
textual (if they fall into the wrapping.nvim allowlist).
So we do not need to undertake the 'nontextual' file heuristic that uses
the capabilities of the language server connected. Especially since our
ZK lsp, or markdown lsp would always return the capability.
Unfortunately wrapping.nvim does not currently have the ability to
provide your own 'nontextual' heuristic, so I instead use a fork which
does and provide the correct function in the options.
By default we wrap the contents.
This will slightly worsen some coding previews, but greatly improve the
default preview for text files.
We will see if it makes sense to keep over time but this makes more
sense to me right now -- especially with zk.nvim using fzf-lua as
preview provider.
We found the correct option and it does not instant-select single result
search anymore.
So we can remove the FIXME since it is indeed fixed.
WIP: ZK workflow improvements
Correctly append md_like and org_like into prose filetypes.
And correctly load render_markdown for all md_like filetypes.
NOTE: _Still_ does not work to render for djot on my end. Is it because
of different TS queries? I am not sure.
Also given new mapping. Hit `<c-t>` instead of `<c-x>`. `<c-x>` (in
insert mode) instead now brings up the path completion which was
previously on the other mapping.
On any line in a markdown-like file (i.e. markdown, quarto, djot, etc.),
we can hit `<c-t>` in normal mode or insert mode to toggle the current
line having a checkbox or not. It takes care to leave the current item a
list item like it was if it already was filled with content.
It does _not_ remove the list item even if it is empty, this may be an
improvement for the future (i.e., empty line -> we hit <c-t> -> line
turns into `- [ ] ` -> we hit <c-t> -> line stays `- `).
But care should be taken to not remove a list item if we don't intend
to, e.g. we could have toggled part of a list beforehand and don't want
to remove the list on each toggle. That's why it is more conservative
for now and I think it should work well enough (the case is likely to be
rare in my mind).
Also, while it does pick up the extended checkbox symbols ([o], [~], [-]),
those are currently hardcoded into the query.
In my mind it should pick those up dynamically from another plugin
instead of hardcoding here, e.g. render-markdown which also defines the
symbols?
Lastly, we could extend it to use treesitter queries instead / on top if
TS is found which would make it more robust than regex matching. But for
an hour of hacking it works quite well.
Shamelessly stolen from http://www.lazyvim.org/plugins/coding#miniai,
allows us to select in/around:
[c]lass, [f]unction, [d]igits, MultiCas[e] words, [g]lobal buffer,
[u]sage of functions (function calls) or the last part of a function
[Usage] and the current code bl[o]ck (loop, conditional or block).
Super useful!
Could be optionally set for 'blink' but since blink.cmp also displays
lsp results this is more general (and, currently, the recommended way).
Suggests task states if doing a single '-' dash at an appropriate place.