1 Commits
Author SHA1 Message Date
Xavier Logerais 5d32fc8518 feat: Adapt configuration for AstroNvim v6 2026-07-07 16:10:12 +00:00
9 changed files with 87 additions and 77 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
# AstroNvim Template # AstroNvim Template
**NOTE:** This is for AstroNvim v5+ **NOTE:** This is for AstroNvim v6+
A template for getting started with [AstroNvim](https://github.com/AstroNvim/AstroNvim) A template for getting started with [AstroNvim](https://github.com/AstroNvim/AstroNvim)
+9 -1
View File
@@ -1,10 +1,18 @@
-- This file simply bootstraps the installation of Lazy.nvim and then calls other files for execution -- This file simply bootstraps the installation of Lazy.nvim and then calls other files for execution
-- This file doesn't necessarily need to be touched, BE CAUTIOUS editing this file and proceed at your own risk. -- This file doesn't necessarily need to be touched, BE CAUTIOUS editing this file and proceed at your own risk.
local lazypath = vim.env.LAZY or vim.fn.stdpath "data" .. "/lazy/lazy.nvim" local lazypath = vim.env.LAZY or vim.fn.stdpath "data" .. "/lazy/lazy.nvim"
if not (vim.env.LAZY or (vim.uv or vim.loop).fs_stat(lazypath)) then if not (vim.env.LAZY or (vim.uv or vim.loop).fs_stat(lazypath)) then
-- stylua: ignore -- stylua: ignore
vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath }) local result = vim.fn.system({ "git", "clone", "--filter=blob:none", "https://github.com/folke/lazy.nvim.git", "--branch=stable", lazypath })
if vim.v.shell_error ~= 0 then
-- stylua: ignore
vim.api.nvim_echo({ { ("Error cloning lazy.nvim:\n%s\n"):format(result), "ErrorMsg" }, { "Press any key to exit...", "MoreMsg" } }, true, {})
vim.fn.getchar()
vim.cmd.quit()
end end
end
vim.opt.rtp:prepend(lazypath) vim.opt.rtp:prepend(lazypath)
-- validate that lazy is available -- validate that lazy is available
+31 -28
View File
@@ -28,13 +28,12 @@ return {
-- { import = "astrocommunity.pack.html-css" }, -- { import = "astrocommunity.pack.html-css" },
-- { import = "astrocommunity.pack.angular" }, -- { import = "astrocommunity.pack.angular" },
-- { import = "astrocommunity.pack.ansible" }, { import = "astrocommunity.pack.ansible" },
-- { import = "astrocommunity.pack.terraform" }, { import = "astrocommunity.pack.terraform" },
-- { import = "astrocommunity.pack.docker" }, { import = "astrocommunity.pack.docker" },
-- { import = "astrocommunity.pack.helm" }, { import = "astrocommunity.pack.helm" },
-- { import = "astrocommunity.pack.rainbow-delimiter-indent-blankline" }, -- { import = "astrocommunity.pack.rainbow-delimiter-indent-blankline" },
{ import = "astrocommunity.indent.indent-rainbowline" },
-- Recipes -- Recipes
@@ -44,39 +43,24 @@ return {
{ import = "astrocommunity.recipes.cache-colorscheme" }, { import = "astrocommunity.recipes.cache-colorscheme" },
{ import = "astrocommunity.recipes.neo-tree-dark" }, { import = "astrocommunity.recipes.neo-tree-dark" },
{ import = "astrocommunity.recipes.neovide" }, { import = "astrocommunity.recipes.neovide" },
-- { import = "astrocommunity.recipes.ai" }, { import = "astrocommunity.recipes.ai" },
-- Completion -- Completion
{ import = "astrocommunity.completion.blink-cmp-git" }, { import = "astrocommunity.completion.blink-cmp-git" },
{ import = "astrocommunity.completion.blink-cmp-emoji" }, { import = "astrocommunity.completion.blink-cmp-emoji" },
-- { import = "astrocommunity.completion.cmp-nerdfont" }, { import = "astrocommunity.completion.cmp-nerdfont" },
{ import = "astrocommunity.completion.minuet-ai-nvim" }, { import = "astrocommunity.completion.copilot-lua-cmp" },
-- { import = "astrocommunity.completion.cmp-spell" }, -- { import = "astrocommunity.completion.cmp-spell" },
-- { import = "astrocommunity.completion.copilot-lua-cmp" },
-- AI
{ import = "astrocommunity.ai.copilotchat-nvim" },
-- { import = "astrocommunity.completion.minuet-ai-nvim" },
-- Telescope -- Telescope
{ import = "astrocommunity.terminal-integration.toggleterm-manager-nvim" }, -- A Telescope extension to manage Toggleterm's terminals in NeoVim { import = "astrocommunity.terminal-integration.toggleterm-manager-nvim" }, -- A Telescope extension to manage Toggleterm's terminals in NeoVim
-- { import = "astrocommunity.file-explorer.telescope-file-browser-nvim" }, -- { import = "astrocommunity.file-explorer.telescope-file-browser-nvim" },
-- Individual plugins (misc) -- Colorschemes
{ import = "astrocommunity.workflow.hardtime-nvim" }, -- Display hints to get rid of bad habits
{ import = "astrocommunity.diagnostics.trouble-nvim" },
{ import = "astrocommunity.editing-support.nvim-devdocs" },
{ import = "astrocommunity.git.diffview-nvim" },
{ import = "astrocommunity.markdown-and-latex.render-markdown-nvim" },
-- { import = "astrocommunity.markdown-and-latex.markview-nvim" },
{ import = "astrocommunity.motion.marks-nvim" }, -- Display marks in the sign column
{ import = "astrocommunity.programming-language-support.kulala-nvim" }, -- A minimal HTTP-client interface for Neovim
-- Disabled
-- { import = "astrocommunity.bars-and-lines.smartcolumn-nvim" }, -- display a column when text width exceed defined limit
-- { import = "astrocommunity.editing-support.chatgpt-nvim" },
-- { import = "astrocommunity.programming-language-support.rest-nvim" },
-- { import = "astrocommunity.project.project-nvim" },
-- Individual plugins (colorschemes)
{ import = "astrocommunity.colorscheme.vscode-nvim" }, { import = "astrocommunity.colorscheme.vscode-nvim" },
{ import = "astrocommunity.colorscheme.github-nvim-theme" }, { import = "astrocommunity.colorscheme.github-nvim-theme" },
{ import = "astrocommunity.colorscheme.neosolarized-nvim" }, { import = "astrocommunity.colorscheme.neosolarized-nvim" },
@@ -87,6 +71,25 @@ return {
{ import = "astrocommunity.colorscheme.tokyonight-nvim" }, { import = "astrocommunity.colorscheme.tokyonight-nvim" },
{ import = "astrocommunity.colorscheme.onedarkpro-nvim" }, { import = "astrocommunity.colorscheme.onedarkpro-nvim" },
-- Individual plugins (misc)
{ import = "astrocommunity.diagnostics.trouble-nvim" },
{ import = "astrocommunity.motion.marks-nvim" }, -- Display marks in the sign column
{ import = "astrocommunity.git.diffview-nvim" },
{ import = "astrocommunity.markdown-and-latex.render-markdown-nvim" },
-- { import = "astrocommunity.markdown-and-latex.markview-nvim" },
{ import = "astrocommunity.programming-language-support.kulala-nvim" }, -- A minimal HTTP-client interface for Neovim
{ import = "astrocommunity.indent.indent-rainbowline" },
{ import = "astrocommunity.editing-support.nvim-devdocs" },
-- { import = "astrocommunity.workflow.hardtime-nvim" }, -- Display hints to get rid of bad habits
-- Disabled
-- { import = "astrocommunity.bars-and-lines.smartcolumn-nvim" }, -- display a column when text width exceed defined limit
-- { import = "astrocommunity.editing-support.chatgpt-nvim" },
-- { import = "astrocommunity.programming-language-support.rest-nvim" },
-- { import = "astrocommunity.project.project-nvim" },
-- Individual plugins customization -- Individual plugins customization
-- { -- {
-- "nvim-treesitter/nvim-treesitter", -- "nvim-treesitter/nvim-treesitter",
+5 -5
View File
@@ -1,7 +1,7 @@
require("lazy").setup({ require("lazy").setup({
{ {
"AstroNvim/AstroNvim", "AstroNvim/AstroNvim",
version = "^5", -- Remove version tracking to elect for nightly AstroNvim version = "^6", -- Remove version tracking to elect for nightly AstroNvim
import = "astronvim.plugins", import = "astronvim.plugins",
opts = { -- AstroNvim options must be set here with the `import` key opts = { -- AstroNvim options must be set here with the `import` key
mapleader = " ", -- This ensures the leader key must be configured before Lazy is set up mapleader = " ", -- This ensures the leader key must be configured before Lazy is set up
@@ -20,13 +20,13 @@ require("lazy").setup({
performance = { performance = {
rtp = { rtp = {
-- disable some rtp plugins, add more to your liking -- disable some rtp plugins, add more to your liking
-- disabled_plugins = { disabled_plugins = {
-- "gzip", -- "gzip",
-- "netrwPlugin", -- "netrwPlugin",
-- "tarPlugin", -- "tarPlugin",
-- "tohtml", "tohtml",
-- "zipPlugin", "zipPlugin",
-- }, },
}, },
}, },
} --[[@as LazyConfig]]) } --[[@as LazyConfig]])
+10 -15
View File
@@ -93,27 +93,15 @@ return {
-- Mappings can be configured through AstroCore as well. -- Mappings can be configured through AstroCore as well.
-- NOTE: keycodes follow the casing in the vimdocs. For example, `<Leader>` must be capitalized -- NOTE: keycodes follow the casing in the vimdocs. For example, `<Leader>` must be capitalized
mappings = { mappings = {
-- first key is the mode
n = { n = {
-- second key is the lefthand side of the map
-- tables with just a `desc` key will be registered with which-key if it's installed
-- this is useful for naming menus
-- ["<Leader>b"] = { desc = "Buffers" },
-- setting a mapping to false will disable it
-- ["<C-S>"] = false,
-- Visual selection of pasted text
["gp"] = { "`[v`]", desc = "Visual selection of pasted text" },
-- navigate buffer tabs -- navigate buffer tabs
["]b"] = { function() require("astrocore.buffer").nav(vim.v.count1) end, desc = "Next buffer" }, ["]b"] = { function() require("astrocore.buffer").nav(vim.v.count1) end, desc = "Next buffer" },
["[b"] = { function() require("astrocore.buffer").nav(-vim.v.count1) end, desc = "Previous buffer" }, ["[b"] = { function() require("astrocore.buffer").nav(-vim.v.count1) end, desc = "Previous buffer" },
-- mappings seen under group name "Buffer" -- mappings seen under group name "Buffer"
["<Leader>b"] = { desc = "Buffers" },
["<Leader>bn"] = { function() require("astrocore.buffer").nav(vim.v.count1) end, desc = "Next buffer" },
["<Leader>bp"] = { function() require("astrocore.buffer").nav(-vim.v.count1) end, desc = "Previous buffer" },
["<Leader>bd"] = { ["<Leader>bd"] = {
function() function()
require("astroui.status.heirline").buffer_picker( require("astroui.status.heirline").buffer_picker(
@@ -125,6 +113,13 @@ return {
["<Leader>bp"] = { function() require("astrocore.buffer").nav(-vim.v.count1) end, desc = "Previous buffer" }, ["<Leader>bp"] = { function() require("astrocore.buffer").nav(-vim.v.count1) end, desc = "Previous buffer" },
["<Leader>bn"] = { function() require("astrocore.buffer").nav(vim.v.count1) end, desc = "Next buffer" }, ["<Leader>bn"] = { function() require("astrocore.buffer").nav(vim.v.count1) end, desc = "Next buffer" },
-- tables with just a `desc` key will be registered with which-key if it's installed
-- this is useful for naming menus
-- ["<Leader>b"] = { desc = "Buffers" },
-- setting a mapping to false will disable it
-- ["<C-S>"] = false,
-- Normal mode : Custom mappings -- Normal mode : Custom mappings
["<F2>"] = { "<cmd>Neotree toggle<cr>", desc = "File Explorer" }, -- F26 corresponds to <Ctrl+F2> on my keyboard ["<F2>"] = { "<cmd>Neotree toggle<cr>", desc = "File Explorer" }, -- F26 corresponds to <Ctrl+F2> on my keyboard
["<F3>"] = { ["<F3>"] = {
@@ -160,7 +155,7 @@ return {
-- Clear Ctrl+l so that we can use it to clear the terminal -- Clear Ctrl+l so that we can use it to clear the terminal
["<C-l>"] = false, ["<C-l>"] = false,
["<C-h>"] = false, ["<C-h>"] = false,
-- Clear Ctrl-J and Ctrl-K so that we can use them for apps running in the terminal (for example lazygit) -- Clear Ctrl-J and Ctrl-K so that we can use them to navigate the terminal (for lazygit)
["<C-j>"] = false, ["<C-j>"] = false,
["<C-k>"] = false, ["<C-k>"] = false,
-- My terms -- My terms
+9 -10
View File
@@ -41,19 +41,18 @@ return {
servers = { servers = {
-- "pyright" -- "pyright"
}, },
-- customize language server configuration options passed to `lspconfig` -- customize language server configuration passed to `vim.lsp.config`
---@diagnostic disable: missing-fields -- client specific configuration can also go in `lsp/` in your configuration root (see `:h lsp-config`)
config = { config = {
-- clangd = { capabilities = { offsetEncoding = "utf-8" } }, -- ["*"] = { capabilities = {} }, -- modify default LSP client settings such as capabilities
}, },
-- customize how language servers are attached -- customize how language servers are attached
handlers = { handlers = {
-- a function without a key is simply the default handler, functions take two parameters, the server name and the configured options table for that server -- a function with the key `*` modifies the default handler, functions takes the server name as the parameter
-- function(server, opts) require("lspconfig")[server].setup(opts) end -- ["*"] = function(server) vim.lsp.enable(server) end
-- the key is the server that is being setup with `lspconfig` -- the key is the server that is being setup with `vim.lsp.config`
-- rust_analyzer = false, -- setting a handler to false will disable the set up of that language server -- rust_analyzer = false, -- setting a handler to false will disable the set up of that language server
-- pyright = function(_, opts) require("lspconfig").pyright.setup(opts) end -- or a custom handler function can be passed
}, },
-- Configure buffer local auto commands to add when attaching a language server -- Configure buffer local auto commands to add when attaching a language server
autocmds = { autocmds = {
@@ -72,7 +71,7 @@ return {
-- the rest of the autocmd options (:h nvim_create_autocmd) -- the rest of the autocmd options (:h nvim_create_autocmd)
desc = "Refresh codelens (buffer)", desc = "Refresh codelens (buffer)",
callback = function(args) callback = function(args)
if require("astrolsp").config.features.codelens then vim.lsp.codelens.refresh { bufnr = args.buf } end if require("astrolsp").config.features.codelens then vim.lsp.codelens.enable(true, { bufnr = args.buf }) end
end, end,
}, },
}, },
@@ -90,13 +89,13 @@ return {
function() require("astrolsp.toggles").buffer_semantic_tokens() end, function() require("astrolsp.toggles").buffer_semantic_tokens() end,
desc = "Toggle LSP semantic highlight (buffer)", desc = "Toggle LSP semantic highlight (buffer)",
cond = function(client) cond = function(client)
return client.supports_method "textDocument/semanticTokens/full" and vim.lsp.semantic_tokens ~= nil return client:supports_method "textDocument/semanticTokens/full" and vim.lsp.semantic_tokens ~= nil
end, end,
}, },
}, },
}, },
-- A custom `on_attach` function to be run after the default `on_attach` function -- A custom `on_attach` function to be run after the default `on_attach` function
-- takes two parameters `client` and `bufnr` (`:h lspconfig-setup`) -- takes two parameters `client` and `bufnr` (`:h lsp-attach`)
on_attach = function(client, bufnr) on_attach = function(client, bufnr)
-- this would disable semanticTokensProvider for all clients -- this would disable semanticTokensProvider for all clients
-- client.server_capabilities.semanticTokensProvider = nil -- client.server_capabilities.semanticTokensProvider = nil
+10 -1
View File
@@ -1,15 +1,24 @@
if true then return {} end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE if true then return {} end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE
-- Customize Treesitter -- Customize Treesitter
-- --------------------
-- Treesitter customizations are handled with AstroCore
-- as nvim-treesitter simply provides a download utility for parsers
---@type LazySpec ---@type LazySpec
return { return {
"nvim-treesitter/nvim-treesitter", "AstroNvim/astrocore",
---@type AstroCoreOpts
opts = { opts = {
treesitter = {
highlight = true, -- enable/disable treesitter based highlighting
indent = true, -- enable/disable treesitter based indentation
auto_install = true, -- enable/disable automatic installation of detected languages
ensure_installed = { ensure_installed = {
"lua", "lua",
"vim", "vim",
-- add more arguments for adding more treesitter parsers -- add more arguments for adding more treesitter parsers
}, },
}, },
},
} }
+3 -1
View File
@@ -49,10 +49,12 @@ return {
{ {
"L3MON4D3/LuaSnip", "L3MON4D3/LuaSnip",
config = function(plugin, opts) config = function(plugin, opts)
require "astronvim.plugins.configs.luasnip"(plugin, opts) -- include the default astronvim config that calls the setup call
-- add more custom luasnip configuration such as filetype extend or custom snippets -- add more custom luasnip configuration such as filetype extend or custom snippets
local luasnip = require "luasnip" local luasnip = require "luasnip"
luasnip.filetype_extend("javascript", { "javascriptreact" }) luasnip.filetype_extend("javascript", { "javascriptreact" })
-- include the default astronvim config that calls the setup call
require "astronvim.plugins.configs.luasnip"(plugin, opts)
end, end,
}, },
+2 -8
View File
@@ -1,11 +1,5 @@
if true then return end -- WARN: REMOVE THIS LINE TO ACTIVATE THIS FILE
-- This will run last in the setup process. -- This will run last in the setup process.
-- This is just pure lua so anything that doesn't -- This is just pure lua so anything that doesn't
-- fit in the normal config locations above can go here -- fit in the normal config locations above can go here
-- Needed for python3 through mise
-- Locate python3 using PATH
local python_path = vim.fn.exepath "python3"
if python_path == nil or python_path == "" then
else
vim.g.python3_host_prog = python_path
end