From 3929be281b77d55168f55d618c899eaf21125d0e Mon Sep 17 00:00:00 2001 From: Jeff LANCE Date: Mon, 4 Aug 2025 23:27:07 +0200 Subject: [PATCH] up --- lua/custom/keymaps/neotree.lua | 4 +-- lua/custom/plugins/neotree.lua | 7 +++-- lua/kickstart/core/autocommands.lua | 4 +-- lua/kickstart/core/lazy-plugins.lua | 1 + lua/kickstart/plugins/noice.lua | 42 +++++++++++++++++++++++++++++ 5 files changed, 52 insertions(+), 6 deletions(-) create mode 100644 lua/kickstart/plugins/noice.lua diff --git a/lua/custom/keymaps/neotree.lua b/lua/custom/keymaps/neotree.lua index 8453efc..33ce20e 100644 --- a/lua/custom/keymaps/neotree.lua +++ b/lua/custom/keymaps/neotree.lua @@ -1,7 +1,7 @@ local wk = require 'which-key' -local neotree = require 'custom.plugins.neotree' +local neotree_utils = require 'custom.plugins.neotree' wk.add({ { "f", group = "file" }, -- group - { 'fe', neotree.smart_open(), desc = 'Fichiers...', mode = 'n' }, + { 'fe', 'Neotree toggle position=right reveal_force_cwd ~', desc = 'Fichiers...', mode = 'n' }, }) diff --git a/lua/custom/plugins/neotree.lua b/lua/custom/plugins/neotree.lua index 01392a7..791991a 100644 --- a/lua/custom/plugins/neotree.lua +++ b/lua/custom/plugins/neotree.lua @@ -9,16 +9,19 @@ function M.smart_open() if is_real_file then target_path = vim.fn.fnamemodify(bufname, ":p:h") + vim.cmd("Neotree toggle position=left reveal_file=" .. target_path) elseif bufname ~= "" then -- buffer avec un nom mais fichier inexistant (ex: nouveau buffer) target_path = "~" - elseif vim.bo.filetype == "starter" then + vim.cmd("Neotree toggle position=right reveal_force_cwd reveal_file=" .. target_path) + elseif vim.bo.filetype == "ministarter" then -- buffer mini.starter target_path = "~" + vim.cmd("Neotree toggle reveal=true position=float dir=" .. target_path) end -- Appel de Neotree avec le bon dossier - vim.cmd("Neotree toggle reveal=true position=float dir=" .. target_path) + -- vim.cmd("Neotree toggle reveal=true dir=" .. target_path) end return M diff --git a/lua/kickstart/core/autocommands.lua b/lua/kickstart/core/autocommands.lua index 42f2e35..b41b5fa 100644 --- a/lua/kickstart/core/autocommands.lua +++ b/lua/kickstart/core/autocommands.lua @@ -22,10 +22,10 @@ vim.api.nvim_create_autocmd('TextYankPost', { -- vim.api.nvim_create_autocmd("VimEnter", { -- callback = function() -- vim.defer_fn(function() --- if vim.bo.filetype == "starter" then +-- if vim.bo.filetype == "ministarter" then -- neotree_utils.smart_open() -- end --- end, 100) -- délai pour laisser mini.starter s'afficher +-- end, 0) -- délai pour laisser mini.starter s'afficher -- end, -- }) diff --git a/lua/kickstart/core/lazy-plugins.lua b/lua/kickstart/core/lazy-plugins.lua index 88975ac..8f0560e 100644 --- a/lua/kickstart/core/lazy-plugins.lua +++ b/lua/kickstart/core/lazy-plugins.lua @@ -13,6 +13,7 @@ require('lazy').setup({ -- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link). 'NMAC427/guess-indent.nvim', -- Detect tabstop and shiftwidth automatically + require 'kickstart.plugins.noice', require 'kickstart.plugins.gitsigns', require 'kickstart.plugins.telescope', require 'kickstart.plugins.lsp', diff --git a/lua/kickstart/plugins/noice.lua b/lua/kickstart/plugins/noice.lua new file mode 100644 index 0000000..d2bd938 --- /dev/null +++ b/lua/kickstart/plugins/noice.lua @@ -0,0 +1,42 @@ +-- Noice (Nice, Noise, Notice) +-- Highly experimental plugin that completely replaces the UI for messages, cmdline and the popupmenu. + +return { + { -- Noice + "folke/noice.nvim", + event = "VeryLazy", + opts = { + -- add any options here + }, + dependencies = { + -- if you lazy-load any plugin below, make sure to add proper `module="..."` entries + "MunifTanjim/nui.nvim", + -- OPTIONAL: + -- `nvim-notify` is only needed, if you want to use the notification view. + -- If not available, we use `mini` as the fallback + "rcarriga/nvim-notify", + }, + config = function() + local noice = require('noice') + + noice.setup({ + lsp = { + -- override markdown rendering so that **cmp** and other plugins use **Treesitter** + override = { + ["vim.lsp.util.convert_input_to_markdown_lines"] = true, + ["vim.lsp.util.stylize_markdown"] = true, + ["cmp.entry.get_documentation"] = true, -- requires hrsh7th/nvim-cmp + }, + }, + -- you can enable a preset for easier configuration + presets = { + bottom_search = true, -- use a classic bottom cmdline for search + command_palette = true, -- position the cmdline and popupmenu together + long_message_to_split = true, -- long messages will be sent to a split + inc_rename = false, -- enables an input dialog for inc-rename.nvim + lsp_doc_border = false, -- add a border to hover docs and signature help + }, + }) + end, + } +} \ No newline at end of file