add nvim-tree to flake

This commit is contained in:
Noah Masur 2022-11-28 22:11:57 -07:00
parent dee7c7302a
commit 3438446347
3 changed files with 79 additions and 0 deletions

View File

@ -179,6 +179,7 @@
./modules/neovim/plugins/lsp.nix
./modules/neovim/plugins/completion.nix
./modules/neovim/plugins/toggleterm.nix
./modules/neovim/plugins/tree.nix
./modules/colorscheme/gruvbox/neovim-gruvbox.nix
];
};

View File

@ -6,9 +6,12 @@
pkgs.vimPlugins.vim-repeat # Better repeat using .
pkgs.vimPlugins.comment-nvim # Smart comment commands
pkgs.vimPlugins.impatient-nvim # Faster load times
pkgs.vimPlugins.glow-nvim # Markdown preview popup
pkgs.vimPlugins.nvim-colorizer-lua # Hex color previews
];
setup.Comment = { };
setup.colorizer = { };
vim.o.termguicolors = true; # Set to truecolor
vim.o.hidden = true; # Don't unload buffers when leaving them

View File

@ -0,0 +1,75 @@
{ pkgs, dsl, ... }: {
plugins = [ pkgs.vimPlugins.nvim-tree-lua pkgs.vimPlugins.nvim-web-devicons ];
# Disable netrw eagerly
# https://github.com/kyazdani42/nvim-tree.lua/commit/fb8735e96cecf004fbefb086ce85371d003c5129
vim.g.loaded = 1;
vim.g.loaded_netrwPlugin = 1;
setup.nvim-tree = {
disable_netrw = true;
hijack_netrw = true;
update_focused_file = {
enable = true;
update_cwd = true;
ignore_list = { };
};
diagnostics = {
enable = true;
icons = {
hint = "";
info = "";
warning = "";
error = "";
};
};
renderer = {
icons = {
glyphs = {
git = {
unstaged = "~";
staged = "+";
unmerged = "";
renamed = "";
deleted = "";
untracked = "?";
ignored = "";
};
};
};
};
view = {
width = 30;
hide_root_folder = false;
side = "left";
mappings = {
custom_only = false;
list = [
{
key = [ "l" "<CR>" "o" ];
cb = dsl.rawLua
"require('nvim-tree.config').nvim_tree_callback('edit')";
}
{
key = "h";
cb = dsl.rawLua
"require('nvim-tree.config').nvim_tree_callback('close_node')";
}
{
key = "v";
cb = dsl.rawLua
"require('nvim-tree.config').nvim_tree_callback('vsplit')";
}
];
};
number = false;
relativenumber = false;
};
};
lua = ''
vim.keymap.set("n", "<Leader>e", ":NvimTreeFindFileToggle<CR>", { silent = true })
'';
}