up
This commit is contained in:
@@ -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' },
|
||||
})
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user