mirror of
https://github.com/nvim-lua/kickstart.nvim.git
synced 2025-07-18 17:55:38 +02:00
move neo tree to custom folder
This commit is contained in:
parent
395d7b9c06
commit
a8bf9b1ba5
2 changed files with 0 additions and 1 deletions
51
lua/custom/plugins/neo-tree.lua
Normal file
51
lua/custom/plugins/neo-tree.lua
Normal file
|
@ -0,0 +1,51 @@
|
|||
-- Neo-tree is a Neovim plugin to browse the file system
|
||||
-- https://github.com/nvim-neo-tree/neo-tree.nvim
|
||||
|
||||
return {
|
||||
'nvim-neo-tree/neo-tree.nvim',
|
||||
version = '*',
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended
|
||||
'MunifTanjim/nui.nvim',
|
||||
},
|
||||
lazy = false, -- neo-tree will lazily load itself
|
||||
cmd = 'Neotree',
|
||||
keys = {
|
||||
{ '\\', ':Neotree reveal<CR>', desc = 'NeoTree reveal', silent = true },
|
||||
},
|
||||
opts = {
|
||||
filesystem = {
|
||||
commands = {
|
||||
avante_add_files = function(state)
|
||||
local node = state.tree:get_node()
|
||||
local filepath = node:get_id()
|
||||
local relative_path = require('avante.utils').relative_path(filepath)
|
||||
|
||||
local sidebar = require('avante').get()
|
||||
|
||||
local open = sidebar:is_open()
|
||||
-- ensure avante sidebar is open
|
||||
if not open then
|
||||
require('avante.api').ask()
|
||||
sidebar = require('avante').get()
|
||||
end
|
||||
|
||||
sidebar.file_selector:add_selected_file(relative_path)
|
||||
|
||||
-- remove neo tree buffer
|
||||
if not open then
|
||||
sidebar.file_selector:remove_selected_file 'neo-tree filesystem [1]'
|
||||
end
|
||||
end,
|
||||
},
|
||||
hijack_netrw_behavior = 'open_default',
|
||||
window = {
|
||||
mappings = {
|
||||
['\\'] = 'close_window',
|
||||
['oa'] = 'avante_add_files',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue