Optimize init.lua untuk Neovim 0.13: dari 470ms ke 130ms
Optimize init.lua untuk Neovim 0.13: dari 470ms ke 130ms Neovim sekarang di 0.13 (development). Kalau korang masih guna config lama (0.12 atau sebelumnya), ada beberapa benda 0.13 yang patut diambil kira — dan ada juga bug senyap yang makan masa startup tanpa kita sedar. Dulu aku guna init.lua yang aku share di…
Optimizing the init.lua file for Neovim 0.13 can significantly reduce startup time from 470ms to just 130ms. Neovim 0.13 introduces new features and improvements that are worth considering when upgrading from previous versions. However, there may be some silent bugs in 0.13 that can cause startup delays without being noticed.
The provided init.lua file is optimized for Neovim 0.13, featuring a native pack and LSP configuration. To enhance performance, the Lua module loading process has been optimized with bytecode caching enabled. Additionally, the leader key mapping is set before plugin setup.
The init.lua file loads several native plugins, including mason, mason-lspconfig, nvim-lspconfig, nvim-treesitter, nvim-cmp, cmp-nvim-lsp, cmp-buffer, LuaSnip, mini.pairs, mini.icons, lualine.nvim, fzf-lua, tokyonight.nvim, toggleterm.nvim, wakatime, and plenary.nvim. Mason setup is also configured to run before lsp.enable, which adds mason/bin to the PATH.
After configuring the plugins, the init.lua file sets up the nvim-cmp autocompletion system, using LuaSnip and the VS Code snippets. The setup includes enabling ghost text and configuring various mapping presets, such as inserting, selecting the next item, and selecting the previous item.
Finally, the init.lua file configures the new native LSP API in Neovim 0.13. It sets up capabilities for servers like lua_ls, html, intelephense, ts_ls, gopls, and pyright. This optimized init.lua file helps Neovim users enjoy faster startup times and improved performance when working with the latest Neovim 0.13 release.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.