Add: first import

This commit is contained in:
DuN0z 2025-10-22 06:57:49 +02:00
commit 82641f61be
23 changed files with 800 additions and 0 deletions

24
lua/plugins/basic.lua Normal file
View file

@ -0,0 +1,24 @@
return {
{
"nvim-lua/plenary.nvim", -- lua functions that many plugins use
},
{
"christoomey/vim-tmux-navigator", -- tmux & split window navigation
},
{
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
config = function()
require("nvim-treesitter.configs").setup({
ensure_installed = { "lua", "python", "bash", "markdown" }, -- Parsers à installer
sync_install = false,
auto_install = true,
highlight = {
enable = true,
additional_vim_regex_highlighting = false,
},
indent = { enable = true },
})
end,
},
}

16
lua/plugins/comments.lua Normal file
View file

@ -0,0 +1,16 @@
return {
{
"folke/todo-comments.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
config = function()
require("todo-comments").setup({
keywords = {
FIX = { icon = "", color = "error", alt = { "BUG", "FIXME" } },
TODO = { icon = "", color = "info" },
HACK = { icon = "", color = "warning" },
NOTE = { icon = "", color = "hint", alt = { "INFO" } },
}
})
end,
}
}

View file

@ -0,0 +1,45 @@
return {
{
"folke/zen-mode.nvim",
opts = {
window = {
backdrop = 0.95,
width = 120,
options = {
signcolumn = "no",
number = false,
relativenumber = false,
cursorline = false,
cursorcolumn = false,
foldcolumn = "0",
--list = false,
},
},
plugins = {
options = {
enabled = true,
ruler = false,
showcmd = false,
laststatus = 2,
},
tmux = { enabled = true },
todo = { enabled = true },
},
on_open = function()
-- vim.g.zen_mode_active = true
vim.cmd("Limelight") -- Active Limelight avec ZenMode
end,
on_close = function()
-- vim.g.zen_mode_active = false
vim.cmd("Limelight!") -- Désactive Limelight avec ZenMode
end,
},
},
{
"junegunn/limelight.vim",
config = function()
vim.g.limelight_conceal_ctermfg = "gray" -- Couleur des lignes non actives en terminal
vim.g.limelight_conceal_guifg = "gray" -- Couleur des lignes non actives en GUI
end,
},
}

174
lua/plugins/lsp.lua Normal file
View file

@ -0,0 +1,174 @@
return {
{
"williamboman/mason.nvim",
build = ":MasonUpdate",
config = function()
require("mason").setup()
end,
},
-- Mason-LSPconfig : Intégration avec les serveurs LSP
{
"williamboman/mason-lspconfig.nvim",
config = function()
require("mason-lspconfig").setup({
ensure_installed = { "clangd","pyright", "lua_ls", "marksman", "ruff" },
})
end,
},
-- LSP Config : Configuration des serveurs LSP
{
"neovim/nvim-lspconfig",
config = function()
local lspconfig = require("lspconfig")
local capabilities = require('cmp_nvim_lsp').default_capabilities()
local navic = require("nvim-navic")
local on_attach = function(client, bufnr)
if client.server_capabilities.documentSymbolProvider then
navic.attach(client, bufnr) -- Attache Navic au LSP
end
end
-- Cpp
lspconfig.clangd.setup({
capabilities = capabilities,
})
-- Python
lspconfig.pyright.setup({
on_attach = on_attach,
})
-- Lua
lspconfig.lua_ls.setup({
on_attach = on_attach,
settings = {
Lua = {
diagnostics = { globals = { "vim" } },
workspace = { library = vim.api.nvim_get_runtime_file("", true) },
},
},
})
-- Markdown & reStructuredText
lspconfig.marksman.setup({})
local navic = require("nvim-navic")
-- Exemple avec Pyright
require("lspconfig").pyright.setup({
on_attach = function(client, bufnr)
if client.server_capabilities.documentSymbolProvider then
navic.attach(client, bufnr) -- Attache Navic au LSP
end
end,
})
end,
},
{
"L3MON4D3/LuaSnip",
build = "make install_jsregexp",
config = function()
require("luasnip.loaders.from_vscode").lazy_load()
end,
},
-- nvim-cmp : Moteur dautocomplétion
{
"hrsh7th/nvim-cmp",
dependencies = {
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
"hrsh7th/cmp-cmdline",
"L3MON4D3/LuaSnip",
"saadparwaiz1/cmp_luasnip",
},
config = function()
local cmp = require("cmp")
local luasnip = require("luasnip")
cmp.setup({
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
mapping = {
-- Comportement intelligent pour Tab
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item() -- Sélectionne l'élément suivant si le menu est ouvert
elseif luasnip.expand_or_jumpable() then
luasnip.expand_or_jump() -- Passe au placeholder suivant si dans un snippet
else
fallback() -- Sinon, insère une tabulation normale
end
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item() -- Sélectionne l'élément précédent si le menu est ouvert
elseif luasnip.jumpable(-1) then
luasnip.jump(-1) -- Passe au placeholder précédent si dans un snippet
else
fallback() -- Sinon, insère une tabulation normale
end
end, { "i", "s" }),
-- Comportement pour Entrée
["<CR>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.confirm({ select = true }) -- Confirme la sélection
elseif luasnip.jumpable(1) then
luasnip.jump(1) -- Passe au placeholder suivant dans un snippet
else
fallback() -- Sinon, insère une nouvelle ligne
end
end, { "i", "s" }),
},
sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "luasnip" },
{ name = "buffer" },
{ name = "path" },
}),
})
end,
},
-- black : Formatage de python
{
"psf/black",
ft = { "python" },
build = ":BlackUpgrade",
},
{
"jose-elias-alvarez/null-ls.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
config = function()
local null_ls = require("null-ls")
null_ls.setup({
sources = {
null_ls.builtins.formatting.clang_format.with({
filetypes = { "cpp", "c", "objc", "objcpp" }, -- Limiter aux langages supportés
}),
},
-- Optionnel : configurer un mapping ou autoformat
on_attach = function(client, bufnr)
if client.supports_method("textDocument/formatting") then
local group = vim.api.nvim_create_augroup("LspFormatting", { clear = true })
vim.api.nvim_create_autocmd("BufWritePre", {
group = group,
buffer = bufnr,
callback = function()
vim.lsp.buf.format({ bufnr = bufnr })
end,
})
end
end,
})
end,
},
}

49
lua/plugins/tools.lua Normal file
View file

@ -0,0 +1,49 @@
return {
{
"nvim-telescope/telescope-file-browser.nvim",
dependencies = { "nvim-telescope/telescope.nvim", "nvim-lua/plenary.nvim" }
},
{
"folke/which-key.nvim",
event = "VeryLazy",
opts = {
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
},
keys = {
{
"<leader>?",
function()
require("which-key").show({ global = false })
end,
desc = "Buffer Local Keymaps (which-key)",
},
},
},
{
"kylechui/nvim-surround",
version = "*",
event = "VeryLazy",
config = function()
require("nvim-surround").setup({})
end
},
{
"windwp/nvim-autopairs",
event = "InsertEnter",
config = function()
local npairs = require("nvim-autopairs")
npairs.setup({
check_ts = true, -- Active la vérification via Treesitter
fast_wrap = {},
})
-- Intégration avec nvim-cmp
local cmp_autopairs = require("nvim-autopairs.completion.cmp")
local cmp = require("cmp")
cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done())
end,
},
}

105
lua/plugins/ui.lua Normal file
View file

@ -0,0 +1,105 @@
return {
{
'AlexvZyl/nordic.nvim',
lazy = false,
priority = 1000,
config = function()
require('nordic').load()
end
},
{
"akinsho/toggleterm.nvim",
version = "*",
config = function()
require("toggleterm").setup({
open_mapping = [[<C-\>]], -- Par défaut, ouvre le terminal avec Ctrl+\
direction = "horizontal", -- Terminal en bas (horizontal)
size = 15, -- Hauteur du terminal
})
end,
},
{
"nvim-lualine/lualine.nvim",
dependencies = { "nvim-tree/nvim-web-devicons", },
config = function()
local navic = require("nvim-navic")
require("lualine").setup({
options = {
theme = "auto",
section_separators = { "", "" },
component_separators = { "|", "|" },
},
sections = {
lualine_a = { "mode" },
lualine_b = { "branch", "diff" },
lualine_c = {
{
"filename", -- Affiche le chemin du fichier
path = 1, -- 0 = Nom du fichier, 1 = Relatif, 2 = Absolu
symbols = {
modified = "", -- Fichier modifié
readonly = " 🔒", -- Lecture seule
unnamed = " [No Name]",
},
},
{
function()
return navic.is_available() and navic.get_location() or ""
end,
icon = ""
},
},
lualine_x = { "encoding", "filetype" },
lualine_y = { "progress" },
lualine_z = { "location" },
},
})
end,
},
{
"gorbit99/codewindow.nvim",
config = function()
local codewindow = require("codewindow")
codewindow.setup({
auto_enable = true,
width = 10,
minimap_width = 15,
window_border = "none",
use_lsp = true,
use_treesitter = true,
exclude_filetypes = { "markdown", "" },
})
-- Raccourci pour activer/désactiver la minimap
vim.keymap.set("n", "<leader>m", function()
codewindow.toggle_minimap()
end, { desc = "Basculer la minimap" })
end,
},
{
"SmiteshP/nvim-navic",
dependencies = { "neovim/nvim-lspconfig" },
config = function()
require("nvim-navic").setup({
highlight = true,
separator = " > ",
})
end,
},
{
"akinsho/bufferline.nvim",
version = "*",
dependencies = { "nvim-tree/nvim-web-devicons" },
config = function()
require("bufferline").setup({
options = {
mode = "buffers",
separator_style = "slant",
diagnostics = "nvim_lsp",
},
})
end,
},
}