stable kickstart config
This commit is contained in:
62
lua/kickstart/plugins/neo-tree.lua
Normal file
62
lua/kickstart/plugins/neo-tree.lua
Normal file
@@ -0,0 +1,62 @@
|
||||
-- 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',
|
||||
},
|
||||
cmd = 'Neotree',
|
||||
keys = {
|
||||
{ '\\', ':Neotree reveal<CR>', desc = 'NeoTree reveal', silent = true },
|
||||
},
|
||||
opts = {
|
||||
filesystem = {
|
||||
window = {
|
||||
mappings = {
|
||||
['\\'] = 'close_window',
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
buffers = {
|
||||
follow_current_file = {
|
||||
enabled = true,
|
||||
},
|
||||
},
|
||||
|
||||
window = {
|
||||
mappings = {
|
||||
['Y'] = function(state)
|
||||
local node = state.tree:get_node()
|
||||
local filepath = node:get_id()
|
||||
local filename = node.name
|
||||
|
||||
local results = {
|
||||
vim.fn.fnamemodify(filepath, ':.'),
|
||||
filename,
|
||||
filepath,
|
||||
}
|
||||
|
||||
local i = vim.fn.inputlist {
|
||||
'Choose what to copy:',
|
||||
'1. ' .. results[1],
|
||||
'2. ' .. results[2],
|
||||
'3. ' .. results[3],
|
||||
}
|
||||
|
||||
if i > 0 then
|
||||
local result = results[i]
|
||||
if not result then
|
||||
return print('Invalid choice: ' .. i)
|
||||
end
|
||||
vim.fn.setreg('"', result)
|
||||
end
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user