Tree plugin for Neovim.

This commit is contained in:
Andrey Parhomenko 2023-08-26 10:50:49 +03:00
parent 1497439646
commit 9595610e7a
3 changed files with 56 additions and 0 deletions

View file

@ -8,9 +8,49 @@ vim.api.nvim_cmd({
args = {'slate'},
}, {})
-- Plugin manager "Lazy"
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
-- Plugins
plugins = {
require("plugin.tree")
}
require("lazy").setup(plugins, opts)
-- File tree plugin configuration
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
vim.opt.termguicolors = true
require("nvim-tree").setup()
require("nvim-tree").setup({
sort_by = "case_sensitive",
view = {
width = 30,
},
renderer = {
group_empty = true,
},
filters = {
dotfiles = false,
},
})
-- Key mapping
local map = vim.api.nvim_set_keymap
local opts = {noremap = true, silent = true}
map('n', 'confr', ':source $HOME/lib/nvim/init.lua\n', opts)
map('n', 'confe', ':e $HOME/lib/nvim/init.lua\n', opts)
map('n', '\\ft', ':NvimTreeToggle\n', opts)
map('n', '\\fT', ':NvimTreeOpen .\n', opts)

5
nvim/lazy-lock.json Normal file
View file

@ -0,0 +1,5 @@
{
"lazy.nvim": { "branch": "main", "commit": "dac844ed617dda4f9ec85eb88e9629ad2add5e05" },
"nvim-tree.lua": { "branch": "master", "commit": "00741206c2df9c4b538055def19b99790f0c95c8" },
"nvim-web-devicons": { "branch": "master", "commit": "cfc8824cc1db316a276b36517f093baccb8e799a" }
}

11
nvim/lua/plugin/tree.lua Normal file
View file

@ -0,0 +1,11 @@
return {
"nvim-tree/nvim-tree.lua",
version = "*",
lazy = false,
dependencies = {
"nvim-tree/nvim-web-devicons",
},
config = function()
require("nvim-tree").setup {}
end,
}