Issue #7
Email Newsletter
Sign up with your email address to receive an email when a new issue of This Week in Neovim is available
Neovim Core updates
Updates of Neovim itself, which are available on Neovim nightly.
Important: if you are a plugin author, you are strongly advised to follow the #14090 breaking changes on master GitHub thread, as it contains important breaking changes information.
#19862 changed the behavior of
fargs
in Lua callbacks fornvim_create_user_command
withnargs='?'
to match the behavior ofnargs='*'
if no arguments were provided (fargs = {}
instead offargs = { "" }
).#19743 changed Vim functions
winheight()
,winwidth()
,getwininfo()
to return inner window width and height. In non-multigrid UI the only change is that the returned height now excludes winbar, and this is compatible with Vim. In multigrid UI this means the return value of these functions now reflect the space available for buffer lines in a window. No change innvim_win_get_height
andnvim_win_get_width
.#19931 modified the rules for defining highlights in tree-sitter highlights.scm.
Previously the following two mechanisms were available
- use a capture name with initial uppercase.
@WarningMsg.foo
automatically mapped to highlight groupWarningMsg
- (undocumented but often used) extend the
vim.treesitter.highlighter.hl_map
dict to translate lowercase groups.
Both of these are now removed. Instead capture names, including the initial
@
, are now directly usable as highlight groups, both using ex commands and the api::hi link @foo.bar MyHighlight :lua vim.api.nvim_set_hl(0, "@string.special", {fg="Green"})
There are no special behaviour for upper-case names (case-insensitive just like all highlight group names). The same fallback rule still applies: if a highlight is defined for
@foo
but not for@foo.bar
, the former is used for@foo.bar
captures.- use a capture name with initial uppercase.
#19830 made some highlight group names modifications.
Previously if a highlight group with a name outside the regexp
[a-zA-Z0-9_]
was defined, Nvim would emit an invalid character warning message. This has now been promoted to an error with the codeE5248
.Additionally the ASCII character period (
.
) and at-sign (@
) has been added to the allowed list of characters of a highlight group name to support the application of defining hierarchical highlight groups, e.g.@keyword
.
Neovim Plugin Community updates
need-help-{#need-help}">Neovim is full of active plugins. This section is about the community and what is going on.
Need help {#need-help}
Testers wanted for autolist.nvim
The author of autolist.nvim
, @gaoDean is asking for Markdown testers, before starting to support other filetypes.
The goal is to stabilize the current state of the plugin for Markdown, then switch to other types of lists from other
filetypes.
Calling for regex.nvim testers!
@Djancyp is asking for volunteers to install and try their regex.nvim
plugin. The plugin helps you live test your
regex from within your code.
catppuccin.nvim is looking for new collaborators
With retirement of @nullchilly, catppuccin.nvim
is looking for new collaborators.
guides,-tours,-articles,-etc-{#guides}">
Guides, tours, articles, etc. {#guides}
new-plugins-{#new-plugins}">
New plugins {#new-plugins}
better-comment.nvim
This week is starting pretty good, with a new plugin by @Djancyp! better-comment.nvim
is a plugin that modifies the
highlighting of your comments to make them pop-out, along with virtual text. It’s based on tree-sitter.
prettierrc.nvim
@numToStr made this new plugin that reads .prettier
configuration and applies the content to your Neovim options.
Interesting idea! The motivation came from editorconfig.nvim
notifier.nvim
A minimalistic plugin by @vigoux that hooks in both vim.notify
and LSP status updates, and reports it in a non-intrusive UI.
neoscopes
A new plugin by @smartpde for simple project management and getting around in large monorepositories.
updates-{#updates}">
Updates {#updates}
go.nvim
go.nvim
received some updates lately. Among the new features:
luasnips
support with dynamic nodes.Go package outline sidebar.
JSON to go struct.
Generate return variables for function call.
mind.nvim
@phaazon released Mind v2.1, which adds a lot of new features and stabilizes already existing features. The feature set is quite large for this minor release so feel free to have a look at the Reddit announcement. Among the new features, Mind can now be used with Neovim 0.7.2, doesn’t require a window-picker plugin anymore, supports tree indexing and allows to create, search, change icons and operate trees and nodes via fuzzy searching the index, or even supports getting nodes’ links (either data path or URL) to insert them in your document.
LuaSnip
Luasnip now supports vimscript-evaluation in snipmate-snippets and regex-transformations in lsp-snippets.
mini.surround
@echasnovski made a massive update of mini.surround
. It is now more aligned with mini.ai
(other mini.nvim
module). Some of new features:
- New surrounding specification format. This is a breaking change for those who defined custom input surroundings. Previous format will work until next release and transition to new one is pretty straightforward.
- Tree-sitter support. Thanks to new specification format you can now use tree-sitter based surroundings. More information is in the help file.
- "Last"/"next" extended mappings. With the same idea as in
mini.ai
, you can now use mappings with special suffixes to operate on previous or next surrounding. - Support of
v:count
for input surrounding. - For 'tpope/vim-surround' lovers, open bracket identifiers (
(
,[
,{
,<
) now include inner padding.
Here is a full list of changes.
nvim-treesitter-textobjects
The @call.inner
capture is now unified across all languages. It generally means "all arguments, without parenthesis,
of function call".
vimtex
The vimtex
plugin by @lervag got a new 2.11 release. Nothing huge, but still nice!
did-you-know?-{#tips}">
Did you know? {#tips}
Macros are one of the most powerful tools of Vim / Neovim. They allow to record a series of Neovim commands and
actions, and replay them later. You start recording to a record register by pressing q
and the register (like a
, so
qa
), then you perform some actions and once you are done, you press q
again to register all those actions to the
a
macro.
Then, you can invoke the macro with @a
, or with a number in front of it if you want to repeat the macro several times,
like 10@a
.
Here’s a short video to demonstrate how powerful macros can be. Their power is almost unlimited, especially since you can even play macros inside recorded macros!
That’s all for this week. See you all next month, on the 5th Sep 2022 for a new full batch of Neovim updates.
want-to-contribute?-{#contribute}">
Want to contribute? {#contribute}
You have noticed something missing that you saw lately? Do not keep the candies for yourself and please feel free to share with us! You can open a PR at This Week In Neovim Contents.
Feel free to read how to contribute to get started.