66 lines
1.3 KiB
Nix
66 lines
1.3 KiB
Nix
{ ... }:
|
|
{
|
|
programs.nixvim = {
|
|
|
|
extraFiles = {
|
|
"lua/treeutils.lua" = {
|
|
source = ./treeutils.lua;
|
|
};
|
|
};
|
|
|
|
keymaps = [
|
|
## Go to current buffer's file in nvim-tree
|
|
{
|
|
mode = [ "n" ];
|
|
key = ",n";
|
|
action = ":NvimTreeFindFile<CR>";
|
|
}
|
|
## Toggle nvim-tree visibility
|
|
{
|
|
mode = [ "n" ];
|
|
key = ",m";
|
|
action = ":NvimTreeToggle<CR>";
|
|
}
|
|
## Search current path
|
|
{
|
|
mode = [ "n" ];
|
|
key = "<c-f>";
|
|
action = "<cmd>lua require('treeutils').launch_find_files()<CR>";
|
|
options = { noremap = true; };
|
|
}
|
|
{
|
|
mode = [ "n" ];
|
|
key = "<c-g>";
|
|
action = "<cmd>lua require('treeutils').launch_live_grep()<CR>";
|
|
options = { noremap = true; };
|
|
}
|
|
];
|
|
|
|
plugins.nvim-tree = {
|
|
enable = true;
|
|
actions = {
|
|
removeFile = {
|
|
closeWindow = false;
|
|
};
|
|
};
|
|
## Keep tree open if already open when opening a tab
|
|
tab = {
|
|
sync = {
|
|
open = true;
|
|
close = true;
|
|
};
|
|
};
|
|
view = {
|
|
width = 30;
|
|
};
|
|
renderer = {
|
|
groupEmpty = true;
|
|
};
|
|
git = {
|
|
enable = true;
|
|
ignore = false;
|
|
timeout = 500;
|
|
};
|
|
};
|
|
};
|
|
}
|