Compare commits

...

6 commits

Author SHA1 Message Date
NotAShelf
ad4ed395a6
Merge a6bb6c3e91 into 894022228a 2024-04-23 23:49:54 +12:00
894022228a
flake: update inputs; build oxocarbon from main repository 2024-04-23 12:28:46 +03:00
29f55e258a
configuration.nix: disable assistant plugins in maximal mode
They require subscriptions to work as intended. If a user has a subscription, they may enable it explicitly.
2024-04-23 12:28:19 +03:00
a6bb6c3e91
plugins/filetree: rename module name; default to neo-tree 2024-04-18 22:16:38 +03:00
58a79e6364
filetree/neo-tree: add setup options until border styles 2024-04-18 20:05:07 +03:00
e9a672c9ce
plugins/neo-tree: init module 2024-04-18 20:05:06 +03:00
8 changed files with 285 additions and 60 deletions

View file

@ -132,9 +132,8 @@ inputs: let
};
filetree = {
nvimTree = {
enable = true;
};
nvimTree.enable = false;
neo-tree.enable = true;
};
tabline = {
@ -227,9 +226,9 @@ inputs: let
};
assistant = {
chatgpt.enable = isMaximal;
chatgpt.enable = false;
copilot = {
enable = isMaximal;
enable = false;
cmp.enable = isMaximal;
};
};

View file

@ -131,11 +131,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1713537308,
"narHash": "sha256-XtTSSIB2DA6tOv+l0FhvfDMiyCmhoRbNB+0SeInZkbk=",
"lastModified": 1713714899,
"narHash": "sha256-+z/XjO3QJs5rLE5UOf015gdVauVRQd2vZtsFkaXBq2Y=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "5c24cf2f0a12ad855f444c30b2421d044120c66f",
"rev": "6143fc5eeb9c4f00163267708e26191d1e918932",
"type": "github"
},
"original": {
@ -307,6 +307,22 @@
"type": "github"
}
},
"plugin-chatgpt": {
"flake": false,
"locked": {
"lastModified": 1709721561,
"narHash": "sha256-vD3NEsYmPRWlxBSOxyIMIQiJXQXxx0hhsw4zIxxXB3o=",
"owner": "jackMort",
"repo": "ChatGPT.nvim",
"rev": "df53728e05129278d6ea26271ec086aa013bed90",
"type": "github"
},
"original": {
"owner": "jackMort",
"repo": "ChatGPT.nvim",
"type": "github"
}
},
"plugin-cheatsheet-nvim": {
"flake": false,
"locked": {
@ -566,11 +582,11 @@
"plugin-elixir-ls": {
"flake": false,
"locked": {
"lastModified": 1713432893,
"narHash": "sha256-4xIX5j920uKYHvwH+Ftid4UixMa274a/37CZIw6dg6M=",
"lastModified": 1713724318,
"narHash": "sha256-1kLMxznNRRJ7M10zkuWexA/sPFaN449M0SKUjLrnc8c=",
"owner": "elixir-lsp",
"repo": "elixir-ls",
"rev": "df03608f11700ece5c8f8202ccd4d7f296df54df",
"rev": "8486de473a219dcdb72408702f8d56d0227c7366",
"type": "github"
},
"original": {
@ -630,11 +646,11 @@
"plugin-gesture-nvim": {
"flake": false,
"locked": {
"lastModified": 1704802204,
"narHash": "sha256-vAky7yvPw2ZmS0i268eKCpUp75bylNGA+ckvhuWVKgc=",
"lastModified": 1713827672,
"narHash": "sha256-YsE4mqM5hBsv4uaCYEpqcA6ZhVKgWWQ4/oHVVdX+vnA=",
"owner": "notomo",
"repo": "gesture.nvim",
"rev": "5124a05debd62326cc899a35a09862a675d7f3da",
"rev": "547f9b50b87e2ec40e72465fc2f975bb6b6232ff",
"type": "github"
},
"original": {
@ -694,11 +710,11 @@
"plugin-highlight-undo": {
"flake": false,
"locked": {
"lastModified": 1695227852,
"narHash": "sha256-I1AwVYqpJNA3K1AwGy/VgPnbrYvX19qfI9bQFZNu1SU=",
"lastModified": 1713721901,
"narHash": "sha256-5zYUpfSR56gCufR+Y18qo8ZpMRg8N3ejkRZNJswJ4wQ=",
"owner": "tzachar",
"repo": "highlight-undo.nvim",
"rev": "50a6884a8476be04ecce8f1c4ed692c5000ef0a1",
"rev": "a0dbc6afa19b438ca5a6f54bc7f1a10399f21a15",
"type": "github"
},
"original": {
@ -915,14 +931,30 @@
"type": "github"
}
},
"plugin-neo-tree-nvim": {
"flake": false,
"locked": {
"lastModified": 1713050882,
"narHash": "sha256-cZwOVpdMT0NCtp6Ha592QA2RzKVS6LhXXcjfDBCQ+0k=",
"owner": "nvim-neo-tree",
"repo": "neo-tree.nvim",
"rev": "22e566aeb075c94f670f34077e05ba95190dfb4a",
"type": "github"
},
"original": {
"owner": "nvim-neo-tree",
"repo": "neo-tree.nvim",
"type": "github"
}
},
"plugin-neocord": {
"flake": false,
"locked": {
"lastModified": 1713035039,
"narHash": "sha256-XAHKXxueUeUMdlAMiVTWyDLkICcKvCU7JJnjGL8exPs=",
"lastModified": 1713646638,
"narHash": "sha256-lcARsc0JxnzYbucRP0pY/bRMsSfm4P4Cpc5A6EoY3Lc=",
"owner": "IogaMaster",
"repo": "neocord",
"rev": "878866dc7882b34c750fcb6ceee9e347cb244567",
"rev": "014e78cff9f1fc7b3b46ec67fdca68a91a9b7c65",
"type": "github"
},
"original": {
@ -1015,11 +1047,11 @@
"plugin-nvim-bufferline-lua": {
"flake": false,
"locked": {
"lastModified": 1713525468,
"narHash": "sha256-28ZkN2o6xumhvXGbxRl3/eODhMOgJfOig/+svi/uAZk=",
"lastModified": 1713769392,
"narHash": "sha256-bHlmaNXfZTlTm/8v48FwCde9ljZFLv25efYF5355bnw=",
"owner": "akinsho",
"repo": "nvim-bufferline.lua",
"rev": "f6f00d9ac1a51483ac78418f9e63126119a70709",
"rev": "73540cb95f8d95aa1af3ed57713c6720c78af915",
"type": "github"
},
"original": {
@ -1031,11 +1063,11 @@
"plugin-nvim-cmp": {
"flake": false,
"locked": {
"lastModified": 1712041554,
"narHash": "sha256-DBxQTmwuEGj2g7LP7d1PJk/SyO0iJq2CIIHsFh0QJ4I=",
"lastModified": 1713837627,
"narHash": "sha256-rz+JMd/hsUEDNVan2sCuEGtbsOVi6oRmPtps+7qSXQE=",
"owner": "hrsh7th",
"repo": "nvim-cmp",
"rev": "ce16de5665c766f39c271705b17fff06f7bcb84f",
"rev": "8f3c541407e691af6163e2447f3af1bd6e17f9a3",
"type": "github"
},
"original": {
@ -1159,11 +1191,11 @@
"plugin-nvim-lspconfig": {
"flake": false,
"locked": {
"lastModified": 1713507075,
"narHash": "sha256-/SqLT0PG2RUWyknYpcXlcU/aUyKWZMBs35s1sPRkEmc=",
"lastModified": 1713863504,
"narHash": "sha256-q82z4V3718/XvrCB9zRL5VwMFgkt3KS5olICSV0UUHo=",
"owner": "neovim",
"repo": "nvim-lspconfig",
"rev": "ed8b8a15acc441aec669f97d75f2c1f2ac8c8aa5",
"rev": "ee3d635692451bc3ef0e5d4b30ea2fbfdeefc373",
"type": "github"
},
"original": {
@ -1287,11 +1319,11 @@
"plugin-nvim-tree-lua": {
"flake": false,
"locked": {
"lastModified": 1712366921,
"narHash": "sha256-6pbOeklf+otsJIjt9IUyUfuTAedShnwERYq1IfhyrJs=",
"lastModified": 1713668329,
"narHash": "sha256-QEvHQcEAGkm5UKVLc1DYvEqs5/JFNrkEFKHFZpe5ZDE=",
"owner": "nvim-tree",
"repo": "nvim-tree.lua",
"rev": "81eb8d519233c105f30dc0a278607e62b20502fd",
"rev": "ae8e46e8fabb32fa3ae5319383ea2c8763f14caa",
"type": "github"
},
"original": {
@ -1335,11 +1367,11 @@
"plugin-nvim-web-devicons": {
"flake": false,
"locked": {
"lastModified": 1713596748,
"narHash": "sha256-yxsKBCP0ICMiH23tcLoTfZJ3VqNMhgkjOzynjPSRb8Q=",
"lastModified": 1713675782,
"narHash": "sha256-AW2W6H7OTv52hfZCcYQc5UjFArBWKLeVclrwMt13HOM=",
"owner": "nvim-tree",
"repo": "nvim-web-devicons",
"rev": "31ba3c489e56a7f20881cee013cea1269b6b2f2d",
"rev": "beb6367ab8496c9e43f22e0252735fdadae1872d",
"type": "github"
},
"original": {
@ -1399,16 +1431,15 @@
"plugin-oxocarbon": {
"flake": false,
"locked": {
"lastModified": 1687168305,
"narHash": "sha256-2o++5aRDULfI35d+7psa6bk0eSXH2HwfuGjGtYGjR4w=",
"owner": "glyh",
"lastModified": 1701119822,
"narHash": "sha256-++JALLPklok9VY2ChOddTYDvDNVadmCeB98jCAJYCZ0=",
"owner": "nyoom-engineering",
"repo": "oxocarbon.nvim",
"rev": "7591d2e18df05374d612acba2b2573c7ff44dce4",
"rev": "c5846d10cbe4131cc5e32c6d00beaf59cb60f6a2",
"type": "github"
},
"original": {
"owner": "glyh",
"ref": "lualine-support",
"owner": "nyoom-engineering",
"repo": "oxocarbon.nvim",
"type": "github"
}
@ -1416,11 +1447,11 @@
"plugin-plenary-nvim": {
"flake": false,
"locked": {
"lastModified": 1711369325,
"narHash": "sha256-wM/FuK24NPEyaWntwT+mi2SuPExC/abXDK9c2WvgUBk=",
"lastModified": 1713788468,
"narHash": "sha256-orGs1npIGIk7MUYadatYrcEXygK7JTj6OqQwy2TLDn0=",
"owner": "nvim-lua",
"repo": "plenary.nvim",
"rev": "8aad4396840be7fc42896e3011751b7609ca4119",
"rev": "5129a3693c482fcbc5ab99a7706ffc4360b995a0",
"type": "github"
},
"original": {
@ -1560,11 +1591,11 @@
"plugin-telescope": {
"flake": false,
"locked": {
"lastModified": 1713586895,
"narHash": "sha256-3mrcol36HmY31pMAadirDdZqJtD0f+m8V0Lz8FnBx0M=",
"lastModified": 1713665692,
"narHash": "sha256-wlRiwT1TCtwPXnIwnzqa6ZABUzJYn+lSRyvkqe6Dbsw=",
"owner": "nvim-telescope",
"repo": "telescope.nvim",
"rev": "a4432dfb9b0b960c4cbc8765a42dc4fe2e029e8f",
"rev": "7d1698f3d88b448e0639974248cc17f49b7b8acf",
"type": "github"
},
"original": {
@ -1592,11 +1623,11 @@
"plugin-toggleterm-nvim": {
"flake": false,
"locked": {
"lastModified": 1713526392,
"narHash": "sha256-liy+AE8a+jll1fhROBKpJaTE9YZHQvYosOW4euGZNYc=",
"lastModified": 1713792255,
"narHash": "sha256-mM5bGgAemsRJD9U6U5K6ia5qb8NaTusM99x6xrtEBfw=",
"owner": "akinsho",
"repo": "toggleterm.nvim",
"rev": "dca1c80fb8ec41c97e7c3ef308719d8143fbbb05",
"rev": "066cccf48a43553a80a210eb3be89a15d789d6e6",
"type": "github"
},
"original": {
@ -1608,11 +1639,11 @@
"plugin-tokyonight": {
"flake": false,
"locked": {
"lastModified": 1711665767,
"narHash": "sha256-ItCmSUMMTe8iQeneIJLuWedVXsNgm+FXNtdrrdJ/1oE=",
"lastModified": 1713855116,
"narHash": "sha256-vUEPbgDen3ubcyJZdWCgnChOo1T0LFvZI++8RgGGx1Y=",
"owner": "folke",
"repo": "tokyonight.nvim",
"rev": "9bf9ec53d5e87b025e2404069b71e7ebdc3a13e5",
"rev": "67afeaf7fd6ebba000633e89f63c31694057edde",
"type": "github"
},
"original": {
@ -1797,6 +1828,7 @@
"plugin-catppuccin": "plugin-catppuccin",
"plugin-ccc": "plugin-ccc",
"plugin-cellular-automaton": "plugin-cellular-automaton",
"plugin-chatgpt": "plugin-chatgpt",
"plugin-cheatsheet-nvim": "plugin-cheatsheet-nvim",
"plugin-cinnamon-nvim": "plugin-cinnamon-nvim",
"plugin-cmp-buffer": "plugin-cmp-buffer",
@ -1835,6 +1867,7 @@
"plugin-mind-nvim": "plugin-mind-nvim",
"plugin-minimap-vim": "plugin-minimap-vim",
"plugin-modes-nvim": "plugin-modes-nvim",
"plugin-neo-tree-nvim": "plugin-neo-tree-nvim",
"plugin-neocord": "plugin-neocord",
"plugin-neodev-nvim": "plugin-neodev-nvim",
"plugin-noice-nvim": "plugin-noice-nvim",
@ -2095,11 +2128,11 @@
"nixpkgs": "nixpkgs_4"
},
"locked": {
"lastModified": 1713572548,
"narHash": "sha256-bYNsY9HwrV8+eJGRYvfLEP6/Sgf2Kr9qNbnB91OYMMM=",
"lastModified": 1713745451,
"narHash": "sha256-j5/bimg/wI14yTDUXZcSQRosV1LIOYuxYkZjvVJC/yg=",
"owner": "mitchellh",
"repo": "zig-overlay",
"rev": "76bccd85db6a182dfcbf8a5f4b540953f029a12c",
"rev": "2c86c36e7fe65faac08bdf85d041cf7b798f8ee8",
"type": "github"
},
"original": {

View file

@ -93,8 +93,6 @@
# LSP plugins
plugin-nvim-lspconfig = {
# url = "github:neovim/nvim-lspconfig?ref=v0.1.3";
# Use master for nil_ls
url = "github:neovim/nvim-lspconfig";
flake = false;
};
@ -225,6 +223,11 @@
flake = false;
};
plugin-neo-tree-nvim = {
url = "github:nvim-neo-tree/neo-tree.nvim";
flake = false;
};
# Tablines
plugin-nvim-bufferline-lua = {
url = "github:akinsho/nvim-bufferline.lua";
@ -345,7 +348,7 @@
};
plugin-oxocarbon = {
url = "github:glyh/oxocarbon.nvim/lualine-support";
url = "github:nyoom-engineering/oxocarbon.nvim";
flake = false;
};

View file

@ -1,5 +1,6 @@
{
imports = [
./nvimtree
./neo-tree
];
}

View file

@ -0,0 +1,28 @@
{
config,
lib,
...
}: let
inherit (lib.modules) mkIf;
inherit (lib.nvim.dag) entryAnywhere;
inherit (lib.nvim.lua) toLuaObject;
cfg = config.vim.filetree.neo-tree;
in {
config = mkIf cfg.enable {
vim = {
startPlugins = [
# dependencies
"plenary-nvim" # commons library
"image-nvim" # optional for image previews
"nui-nvim" # ui library
# neotree
"neo-tree-nvim"
];
luaConfigRC.neo-tree = entryAnywhere ''
require("neo-tree").setup(${toLuaObject cfg.setupOpts})
'';
};
};
}

View file

@ -0,0 +1,6 @@
{
imports = [
./config.nix
./neo-tree.nix
];
}

View file

@ -0,0 +1,155 @@
{lib, ...}: let
inherit (lib.types) bool str int submodule enum either listOf;
inherit (lib.options) mkOption mkEnableOption literalExpression;
inherit (lib.nvim.types) mkPluginSetupOption;
in {
options.vim.filetree.neo-tree = {
enable = mkEnableOption "filetree via neo-tree.nvim";
# Permalink:
# https://github.com/nvim-neo-tree/neo-tree.nvim/blob/22e566aeb075c94f670f34077e05ba95190dfb4a/lua/neo-tree/defaults.lua
setupOpts = mkPluginSetupOption "neo-tree" {
add_blank_line_at_top = mkOption {
type = bool;
default = false;
description = ''
Whether to add a blank line at the top of the tree
'';
};
auto_clean_after_session_restore = mkOption {
type = bool;
default = false;
description = ''
Whether to automatically clean up broken neo-tree buffers
saved in sessions
'';
};
default_source = mkOption {
type = str;
default = "filesystem";
description = ''
You can choose a specific source.
`last` here which indicates the last used source
'';
};
enable_diagnostics = mkEnableOption "diagnostics" // {default = true;};
enable_git_status = mkEnableOption "git status" // {default = true;};
enable_modified_markers = mkEnableOption "markers for files with unsaved changes." // {default = true;};
enable_opened_markers =
mkEnableOption ''
tracking of opened files.
Required for `components.name.highlight_opened_files`
''
// {default = true;};
enable_refresh_on_write =
mkEnableOption ''
Refresh the tree when a file is written.
Only used if `use_libuv_file_watcher` is false.
''
// {default = true;};
enable_cursor_hijack = mkEnableOption ''
cursor hijacking.
If enabled neotree will keep the cursor on the first letter of the filename when moving in the tree
'';
git_status_async = mkEnableOption ''
async git status.
This will make the git status check async and will not block the UI.
'';
/*
git_status_async_options = mkOption {
description = "These options are for people with VERY large git repos";
type = submodule {
batch_size = mkOption {
type = int;
default = 1000;
description = "How many lines of git status results to process at a time";
};
batch_delay = mkOption {
type = int;
default = 10;
description = "Delay, in ms, between batches. Spreads out the workload to let other processes run";
};
max_lines = mkOption {
type = int;
default = 10000;
description = ''
How many lines of git status results to process.
Anything after this will be dropped. Anything before this will be used.
The last items to be processed are the untracked files.
'';
};
};
};
*/
hide_root_node = mkOption {
type = bool;
default = false;
description = ''
Whether to hide the root node of the tree
'';
};
retain_hidden_root_indent = mkOption {
type = bool;
default = false;
description = ''
Whether to retain the indent of the hidden root node
IF the root node is hidden, keep the indentation anyhow.
This is needed if you use expanders because they render in the indent.
'';
};
log_level = mkOption {
type = enum ["trace" "debug" "info" "warn" "error" "fatal"];
default = "info";
description = "Log level for the plugin.";
};
log_to_file = mkOption {
type = either bool str;
default = false;
example = literalExpression "/tmp/neo-tree.log";
description = ''
Must be either a boolean or a path to your log file.
Use :NeoTreeLogs to show the file
'';
};
open_files_in_last_window = mkOption {
type = bool;
default = true;
description = ''
Whether to open files in the last window
If disabled, neo-tree will open files in top left window
'';
};
open_files_do_not_replace_types = mkOption {
type = listOf str;
default = ["terminal" "Trouble" "qf" "edgy"];
description = ''
A list of filetypes that should not be replaced when opening a file
'';
};
};
};
}

View file

@ -1,4 +1,4 @@
_: {
{
imports = [
./config.nix
./nvimtree.nix