This commit is contained in:
2025-08-04 23:27:07 +02:00
parent ecaf50a044
commit 3929be281b
5 changed files with 52 additions and 6 deletions

View File

@@ -1,7 +1,7 @@
local wk = require 'which-key'
local neotree = require 'custom.plugins.neotree'
local neotree_utils = require 'custom.plugins.neotree'
wk.add({
{ "<leader>f", group = "file" }, -- group
{ '<leader>fe', neotree.smart_open(), desc = 'Fichiers...', mode = 'n' },
{ '<leader>fe', '<CMD>Neotree toggle position=right reveal_force_cwd ~<CR>', desc = 'Fichiers...', mode = 'n' },
})

View File

@@ -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

View File

@@ -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,
-- })

View File

@@ -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',

View File

@@ -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,
}
}