Author SHA1 Message Date
Xavier Logerais 5d32fc8518 feat: Adapt configuration for AstroNvim v6 2026-07-07 16:10:12 +00:00
8 changed files with 71 additions and 310 deletions
-212
View File
@@ -1,212 +0,0 @@
; extends
;
; ~/.config/nvim/after/queries/yaml/injections.scm
;
; Neovim >= 0.10 (@injection.filename). La ligne "; extends" doit rester la
; PREMIÈRE ligne : sans elle ce fichier n'est pas fusionné avec les
; injections de nvim-treesitter (il est ignoré, ou les remplace).
;
; Un (block_scalar) contient son en-tête (`|`, `|-`, `>+`...). #offset!
; saute cet en-tête, d'où 2 variantes par règle : en-tête de 1 caractère
; (`|`, `>`) ou de 2 (`|-`, `|+`, `>-`, `|2`...). Les en-têtes plus longs
; (`|2-`) ou suivis d'un commentaire ne sont volontairement pas injectés
; (le contenu reste une simple chaîne plutôt qu'un arbre en erreur).
; ---------------------------------------------------------------------------
; 1. Clés « nom de fichier » à valeur multi-ligne
; ConfigMap / Secret stringData / values Helm / templates ExternalSecret...
;
; config.json: | -> json nginx.conf: | -> nginx
; app.toml: |- -> toml "values.yaml": | -> yaml
; entrypoint.sh: | -> bash (*) .dockerconfigjson: | -> json
;
; Le langage est déduit par vim.filetype.match() sur le nom de la clé :
; toute extension connue de Neovim marche si le parser est installé.
; (*) ft `sh` -> parser `bash` : mapping fourni par nvim-treesitter,
; sinon : vim.treesitter.language.register('bash', 'sh')
; ---------------------------------------------------------------------------
(block_mapping_pair
key: (flow_node) @injection.filename
value: (block_node
(block_scalar) @injection.content)
(#lua-match? @injection.filename "^[\"']?[%w_.-]*%.%w+[\"']?$")
(#lua-match? @injection.content "^[|>]%s*\n")
(#gsub! @injection.filename "^[\"']?(.-)[\"']?$" "%1")
(#gsub! @injection.filename "^%.dockerconfigjson$" "dockerconfig.json")
(#offset! @injection.content 0 1 0 0))
(block_mapping_pair
key: (flow_node) @injection.filename
value: (block_node
(block_scalar) @injection.content)
(#lua-match? @injection.filename "^[\"']?[%w_.-]*%.%w+[\"']?$")
(#lua-match? @injection.content "^[|>][-+1-9]%s*\n")
(#gsub! @injection.filename "^[\"']?(.-)[\"']?$" "%1")
(#gsub! @injection.filename "^%.dockerconfigjson$" "dockerconfig.json")
(#offset! @injection.content 0 2 0 0))
; ---------------------------------------------------------------------------
; 2. Patches Kustomize -> yaml (JSON6902 en JSON inclus : JSON ⊂ YAML)
;
; - Flux Kustomization .spec.patches[].patch
; - Flux HelmRelease .spec.postRenderers[].kustomize.patches[].patch
; - kustomization.yaml .patches[].patch / .patchesJson6902[].patch
;
; spec:
; patches:
; - patch: |-
; apiVersion: apps/v1
; ...
; target:
; kind: Deployment
; ---------------------------------------------------------------------------
(block_mapping_pair
key: (flow_node) @_patches
value: (block_node
(block_sequence
(block_sequence_item
(block_node
(block_mapping
(block_mapping_pair
key: (flow_node) @_patch
value: (block_node
(block_scalar) @injection.content)))))))
(#any-of? @_patches "patches" "patchesJson6902")
(#eq? @_patch "patch")
(#lua-match? @injection.content "^[|>]%s*\n")
(#set! injection.language "yaml")
(#offset! @injection.content 0 1 0 0))
(block_mapping_pair
key: (flow_node) @_patches
value: (block_node
(block_sequence
(block_sequence_item
(block_node
(block_mapping
(block_mapping_pair
key: (flow_node) @_patch
value: (block_node
(block_scalar) @injection.content)))))))
(#any-of? @_patches "patches" "patchesJson6902")
(#eq? @_patch "patch")
(#lua-match? @injection.content "^[|>][-+1-9]%s*\n")
(#set! injection.language "yaml")
(#offset! @injection.content 0 2 0 0))
; Variante en ligne : patch: '[{"op": "remove", "path": "/spec/replicas"}]'
(block_mapping_pair
key: (flow_node) @_patches
value: (block_node
(block_sequence
(block_sequence_item
(block_node
(block_mapping
(block_mapping_pair
key: (flow_node) @_patch
value: (flow_node
[
(single_quote_scalar)
(double_quote_scalar)
] @injection.content)))))))
(#any-of? @_patches "patches" "patchesJson6902")
(#eq? @_patch "patch")
(#set! injection.language "yaml")
(#offset! @injection.content 0 1 0 -1))
; ---------------------------------------------------------------------------
; 3. Patch JSON6902 générique op/path/value, quand path == "/spec/patches"
; (n'importe quelle valeur pour op : add, replace, remove...) :
;
; - op: replace
; path: "/spec/patches"
; value:
; - target:
; kind: HelmRelease
; patch: |-
; apiVersion: helm.toolkit.fluxcd.io/v2
; ...
; ---------------------------------------------------------------------------
(block_mapping
(block_mapping_pair
key: (flow_node) @_op)
(block_mapping_pair
key: (flow_node) @_path
value: (flow_node) @_path_value)
(block_mapping_pair
key: (flow_node) @_value
value: (block_node
(block_sequence
(block_sequence_item
(block_node
(block_mapping
(block_mapping_pair
key: (flow_node) @_patch
value: (block_node
(block_scalar) @injection.content))))))))
(#eq? @_op "op")
(#eq? @_path "path")
(#eq? @_value "value")
(#eq? @_patch "patch")
(#lua-match? @_path_value "^[\"']?/spec/patches[\"']?$")
(#lua-match? @injection.content "^[|>]%s*\n")
(#set! injection.language "yaml")
(#offset! @injection.content 0 1 0 0))
(block_mapping
(block_mapping_pair
key: (flow_node) @_op)
(block_mapping_pair
key: (flow_node) @_path
value: (flow_node) @_path_value)
(block_mapping_pair
key: (flow_node) @_value
value: (block_node
(block_sequence
(block_sequence_item
(block_node
(block_mapping
(block_mapping_pair
key: (flow_node) @_patch
value: (block_node
(block_scalar) @injection.content))))))))
(#eq? @_op "op")
(#eq? @_path "path")
(#eq? @_value "value")
(#eq? @_patch "patch")
(#lua-match? @_path_value "^[\"']?/spec/patches[\"']?$")
(#lua-match? @injection.content "^[|>][-+1-9]%s*\n")
(#set! injection.language "yaml")
(#offset! @injection.content 0 2 0 0))
; Variante en ligne : patch: '[{"op": "remove", "path": "/spec/replicas"}]'
(block_mapping
(block_mapping_pair
key: (flow_node) @_op)
(block_mapping_pair
key: (flow_node) @_path
value: (flow_node) @_path_value)
(block_mapping_pair
key: (flow_node) @_value
value: (block_node
(block_sequence
(block_sequence_item
(block_node
(block_mapping
(block_mapping_pair
key: (flow_node) @_patch
value: (flow_node
[
(single_quote_scalar)
(double_quote_scalar)
] @injection.content))))))))
(#eq? @_op "op")
(#eq? @_path "path")
(#eq? @_value "value")
(#eq? @_patch "patch")
(#lua-match? @_path_value "^[\"']?/spec/patches[\"']?$")
(#set! injection.language "yaml")
(#offset! @injection.content 0 1 0 -1))
+25 -20
View File
@@ -28,13 +28,12 @@ return {
-- { import = "astrocommunity.pack.html-css" },
-- { import = "astrocommunity.pack.angular" },
-- { import = "astrocommunity.pack.ansible" },
-- { import = "astrocommunity.pack.terraform" },
-- { import = "astrocommunity.pack.docker" },
-- { import = "astrocommunity.pack.helm" },
{ import = "astrocommunity.pack.ansible" },
{ import = "astrocommunity.pack.terraform" },
{ import = "astrocommunity.pack.docker" },
{ import = "astrocommunity.pack.helm" },
-- { import = "astrocommunity.pack.rainbow-delimiter-indent-blankline" },
{ import = "astrocommunity.indent.indent-rainbowline" },
-- Recipes
@@ -49,29 +48,19 @@ return {
-- Completion
{ import = "astrocommunity.completion.blink-cmp-git" },
{ import = "astrocommunity.completion.blink-cmp-emoji" },
-- { import = "astrocommunity.completion.cmp-nerdfont" },
{ import = "astrocommunity.completion.cmp-nerdfont" },
{ import = "astrocommunity.completion.copilot-lua-cmp" },
-- { import = "astrocommunity.completion.cmp-spell" },
-- { import = "astrocommunity.completion.copilot-lua-cmp" },
-- AI
-- { import = "astrocommunity.ai.copilotchat-nvim" },
-- { import = "astrocommunity.ai.minuet-ai-nvim" },
{ import = "astrocommunity.ai.copilotchat-nvim" },
-- { import = "astrocommunity.completion.minuet-ai-nvim" },
-- Telescope
{ 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" },
-- Individual plugins (misc)
-- { import = "astrocommunity.workflow.hardtime-nvim" }, -- Display hints to get rid of bad habits
{ import = "astrocommunity.motion.marks-nvim" }, -- Display marks in the sign column
{ 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" }, -- Alternative to render-markdown-nvim
-- Individual plugins (colorschemes)
-- Colorschemes
{ import = "astrocommunity.colorscheme.vscode-nvim" },
{ import = "astrocommunity.colorscheme.github-nvim-theme" },
{ import = "astrocommunity.colorscheme.neosolarized-nvim" },
@@ -82,6 +71,18 @@ return {
{ import = "astrocommunity.colorscheme.tokyonight-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
@@ -100,4 +101,8 @@ return {
-- end
-- end,
-- },
-- Now provided by core
-- { import = "astrocommunity.bars-and-lines.vim-illuminate" }, -- highlight other uses of the word under cursor
-- { import = "astrocommunity.editing-support.todo-comments-nvim" },
}
+1 -2
View File
@@ -13,7 +13,6 @@ require("lazy").setup({
},
{ import = "community" },
{ import = "plugins" },
{ import = "plugins.custom" },
} --[[@as LazySpec]], {
-- Configure any other `lazy.nvim` configuration options here
install = { colorscheme = { "astrotheme", "habamax" } },
@@ -25,8 +24,8 @@ require("lazy").setup({
-- "gzip",
-- "netrwPlugin",
-- "tarPlugin",
-- "zipPlugin",
"tohtml",
"zipPlugin",
},
},
},
+44 -59
View File
@@ -35,6 +35,45 @@ return {
[".*/etc/foo/.*"] = "fooscript",
},
},
-- Commands
commands = {
CleanYamlSpaces = {
function()
if vim.bo.filetype == 'yaml' or vim.bo.filetype == 'yml' then
local cursor_pos = vim.api.nvim_win_get_cursor(0)
vim.cmd([[%s/\s\+$//e]])
vim.api.nvim_win_set_cursor(0, cursor_pos)
print("Espaces en fin de ligne supprimés")
else
print("Cette commande ne fonctionne que sur les fichiers YAML")
end
end,
desc = "Nettoie les espaces en fin de ligne dans les fichiers YAML",
},
},
-- Autocmd
autocmds = {
yaml_trailing_spaces = {
{
event = { "BufRead", "BufNewFile" },
pattern = { "*.yaml", "*.yml" },
callback = function()
vim.fn.matchadd("TrailingWhiteSpace", "\\s\\+$")
end,
desc = "Surligne les espaces en fin de ligne dans les fichiers YAML",
},
{
event = "BufWritePre",
pattern = { "*.yaml", "*.yml" },
callback = function()
local cursor_pos = vim.api.nvim_win_get_cursor(0)
vim.cmd([[%s/\s\+$//e]])
vim.api.nvim_win_set_cursor(0, cursor_pos)
end,
desc = "Nettoie les espaces en fin de ligne avant sauvegarde",
},
},
},
-- vim options can be configured here
options = {
opt = { -- vim.opt.<key>
@@ -51,22 +90,6 @@ return {
-- This can be found in the `lua/lazy_setup.lua` file
},
},
-- Commands
commands = {
CleanYamlSpaces = {
function()
if vim.bo.filetype == "yaml" or vim.bo.filetype == "yml" then
local cursor_pos = vim.api.nvim_win_get_cursor(0)
vim.cmd [[%s/\s\+$//e]]
vim.api.nvim_win_set_cursor(0, cursor_pos)
print "Espaces en fin de ligne supprimés"
else
print "Cette commande ne fonctionne que sur les fichiers YAML"
end
end,
desc = "Nettoie les espaces en fin de ligne dans les fichiers YAML",
},
},
-- Mappings can be configured through AstroCore as well.
-- NOTE: keycodes follow the casing in the vimdocs. For example, `<Leader>` must be capitalized
mappings = {
@@ -87,21 +110,18 @@ return {
end,
desc = "Close buffer from tabline",
},
["<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>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" },
-- ["<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" },
-- Normal mode : Custom mappings
["<F2>"] = { "<cmd>Neotree toggle<cr>", desc = "File Explorer" },
["<F2>"] = { "<cmd>Neotree toggle<cr>", desc = "File Explorer" }, -- F26 corresponds to <Ctrl+F2> on my keyboard
["<F3>"] = {
function() require("astrocore").toggle_term_cmd { cmd = "lazygit", direction = "float" } end,
desc = "Lazygit terminal",
@@ -113,7 +133,7 @@ return {
},
-- Insert mode : Custom mappings
i = {
["<F2>"] = { "<cmd>Neotree toggle<cr>", desc = "File Explorer" },
["<F2>"] = { "<cmd>Neotree toggle<cr>", desc = "File Explorer" }, -- F26 corresponds to <Ctrl+F2> on my keyboard
["<F3>"] = {
function() require("astrocore").toggle_term_cmd { cmd = "lazygit", direction = "float" } end,
desc = "Lazygit terminal",
@@ -135,7 +155,7 @@ return {
-- Clear Ctrl+l so that we can use it to clear the terminal
["<C-l>"] = 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-k>"] = false,
-- My terms
@@ -149,40 +169,5 @@ return {
}, -- F28 corresponds to <Ctrl+F4> on my keyboard
},
},
-- Autocmd
autocmds = {
-- Configuration pour ouvrir l'aide dans un nouvel onglet
help_in_tab = {
{
event = "BufWinEnter",
pattern = "*.txt",
callback = function()
if vim.bo.filetype == "help" then
-- Déplace le buffer d'aide vers un nouvel onglet
vim.cmd "wincmd T"
end
end,
desc = "Ouvre l'aide dans un nouvel onglet",
},
},
yaml_trailing_spaces = {
{
event = { "BufRead", "BufNewFile" },
pattern = { "*.yaml", "*.yml" },
callback = function() vim.fn.matchadd("TrailingWhiteSpace", "\\s\\+$") end,
desc = "Surligne les espaces en fin de ligne dans les fichiers YAML",
},
{
event = "BufWritePre",
pattern = { "*.yaml", "*.yml" },
callback = function()
local cursor_pos = vim.api.nvim_win_get_cursor(0)
vim.cmd [[%s/\s\+$//e]]
vim.api.nvim_win_set_cursor(0, cursor_pos)
end,
desc = "Nettoie les espaces en fin de ligne avant sauvegarde",
},
},
},
},
}
-16
View File
@@ -1,16 +0,0 @@
-- INFO:
-- Bllets.vim is a Vim plugin for automated bullet lists.
-- https://github.com/bullets-vim/bullets.vim
-- https://github.com/bullets-vim/bullets.vim/wiki/Configuration
-- https://github.com/bullets-vim/bullets.vim/wiki/Usage
return {
"bullets-vim/bullets.vim",
ft = { "markdown", "yaml", "text" },
init = function()
vim.g.bullets_enabled_file_types = { "markdown", "yaml", "text" }
vim.g.bullets_renumber_on_change = 1
end,
}
-- TODO: Voir aussi l'adaptation lua de ce plugin : https://github.com/kaymmm/bullets.nvim
+1 -1
View File
@@ -1,4 +1,4 @@
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
return {
"milanglacier/minuet-ai.nvim",
opts = {