Neues in Neovim 0.12

Neovim 0.12 ist am 29. März diesen Jahres released worden und da gibt es einige Neuerungen.

vim.pack

Das ist der eingebaute Plugin-Manager von Neovim; dazu habe ich in https://strcat.de/blog/mal-schnell-neovim-neu-konfigurieren.html schon was dazu geschrieben. Die Plugins liegen dann unter site/pack/core/opt rum und das Lockfile dazu unter ~/.config/nvim/nvim-pack-lock.json.

Änderungen in Bezug auf LSP

Die empfohlene Konfiguration sieht wie folgt aus

vim.lsp.config['lua_ls'] = {
  cmd = { 'lua-language-server' },
  filetypes = { 'lua' },
  root_markers = { { '.luarc.json', '.luarc.jsonc' }, '.git' },
}
vim.lsp.enable('lua_ls')

Danach kann man mit :checkhealth vim.lsp prüfen ob der LSP auch läuft. Dazu gibt es auch noch mehr Mappings, Ranges, ..; alles das kann man unter https://neovim.io/doc/user/lsp/ nachlesen.

Autocompletion im Insert-Mode

Auch das ist jetzt Built-In. Aktiviert wird das mit

vim.o.autocomplete = true

Es gibt auch einige neue Flags dazu wie z. B.

ui2

Das neue Userinterface. Damit wird kurz gesagt das "Press ENTER" obsolete und die eingegebenen Kommandos im command-mode werden hervorgehoben. Das ist allerdings noch "experimental" wie es in https://neovim.io/doc/user/lua/#ui2 so schön heisst.

:restart, :connect und Busy

Da ist der Name Programm; ":restart" startet Neovim neu, ":connect" verbindet Neovim mit einem Socket (also :connect /tmp/nvim.sock) und busy setzt einen Buffer in den Status "busy"

Statusline

Die Statusline kann jetzt noch mehr anzeigen wie z. B. Diagnostics, Progress/Status-Informationen, den oben genannten Busy-Status und den Exit-Status des Terminals

LUA APIs

Ich copy&paste jetzt einfach mal alles was neu dazugekommen ist:

  • vim.net.request() can fetch/download HTTP content.
  • vim.wait() returns the callback results.
  • Lua type annotations for vim.uv.
  • vim.hl.range() now allows multiple timed highlights.
  • vim.tbl_extend(), vim.tbl_deep_extend() behavior argument can be a function.
  • vim.fs.root() can define "equal priority" via nested lists.
  • vim.fs.ext() returns the last extension of a file.
  • vim.version.range() can output human-readable string via tostring().
  • vim.version.intersect() computes intersection of two version ranges.
  • Iter:take() and Iter:skip() now optionally accept predicates.
  • Iter:peek() now works for all iterator types, not just list-iterator.
  • vim.list.unique() and Iter:unique() to deduplicate lists and iterators, respectively.
  • vim.list.bisect() performs binary search.
  • vim.json.encode() indent option performs pretty-formatting.
  • vim.json.encode() sort_keys option sorts by key.
  • vim.json.decode() skip_comments option allows comments in JSON data.
  • EXPERIMENTAL: vim.pos, vim.range provide Position/Range abstraction.

:Undotree, :DiffTool

Neovim 12 hat jetzt Undotree und DiffTool im Programm. Dazu reicht ein

:packadd nvim.undotree
:packadd nvim.difftool

und schon steht ":Undotree" und ":DiffTool" zur Verfügung; TOhtml ist jetzt opt-in und wird nicht mehr per Default geladen.

Treesitters

Das Syntaxhighlighting für Markdown ist jetzt Default. Außerdem wird eine zusätzliche Auswahl angeboten; also an, in, .. https://neovim.io/doc/user/treesitter/#treesitter-defaults

Und der klägliche rest

Also "kläglich".. https://neovim.io/doc/user/news-0.12/#news-0.12

Ich werde mich dieses Wochenende mal hinsetzen und meine Konfiguration komplett umschreiben, weil das schmerzfreier ist als die Bestehende anzupassen, weil ich im Zug/Flugzeug genügend Zeit dazu habe.. also theoretisch zumindest ^^

For comments, please send me an email