From 445ee242fc7e40ceee5a8a9feeb1deb50cdfd387 Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Wed, 25 Dec 2024 19:53:53 +0100 Subject: [PATCH] Add oil --- flake.lock | 17 +++++++++++++++++ flake.nix | 5 +++++ nvim/default.nix | 11 ++++++++++- nvim/lua/plugins/colors.lua | 7 ++++--- nvim/lua/plugins/mini.lua | 11 +++++++++++ nvim/lua/plugins/oil.lua | 23 +++++++++++++++++++++++ 6 files changed, 70 insertions(+), 4 deletions(-) create mode 100644 nvim/lua/plugins/mini.lua create mode 100644 nvim/lua/plugins/oil.lua diff --git a/flake.lock b/flake.lock index f00670a..522d510 100644 --- a/flake.lock +++ b/flake.lock @@ -292,6 +292,22 @@ "type": "github" } }, + "lz-nvim": { + "flake": false, + "locked": { + "lastModified": 1735151625, + "narHash": "sha256-XROyv0DgH+1ZWA7Z+OdNd41ufqtl8PoAfwZtSjPFem0=", + "owner": "zoriya", + "repo": "lz.n", + "rev": "e9ee565439706d86b4dd63e20aef1fc231e0570b", + "type": "github" + }, + "original": { + "owner": "zoriya", + "repo": "lz.n", + "type": "github" + } + }, "neovim-nightly": { "inputs": { "flake-compat": "flake-compat", @@ -451,6 +467,7 @@ "ghostty": "ghostty", "home-manager": "home-manager", "impermanence": "impermanence", + "lz-nvim": "lz-nvim", "neovim-nightly": "neovim-nightly", "nix-darwin": "nix-darwin", "nix-index-database": "nix-index-database", diff --git a/flake.nix b/flake.nix index 289905b..b1b53f3 100644 --- a/flake.nix +++ b/flake.nix @@ -44,6 +44,11 @@ url = "github:youwen5/zen-browser-flake"; inputs.nixpkgs.follows = "nixpkgs"; }; + + lz-nvim = { + url = "github:zoriya/lz.n"; + flake = false; + }; }; outputs = { diff --git a/nvim/default.nix b/nvim/default.nix index 098846d..ae86440 100644 --- a/nvim/default.nix +++ b/nvim/default.nix @@ -1,9 +1,16 @@ { pkgs, neovim-nightly, + lz-nvim, ... }: let mkNvim = pkgs.callPackage ./mknvim.nix {inherit pkgs;}; + + mkPlugin = src: pname: + pkgs.vimUtils.buildVimPlugin { + inherit pname src; + version = src.lastModifiedDate; + }; in mkNvim { withNodeJs = false; @@ -16,10 +23,12 @@ in plugins = with pkgs.vimPlugins; { start = [ - lz-n + (mkPlugin lz-nvim "lz-n") catppuccin-nvim nvim-treesitter.withAllGrammars + oil-nvim plenary-nvim + mini-nvim ]; opts = [ telescope-nvim diff --git a/nvim/lua/plugins/colors.lua b/nvim/lua/plugins/colors.lua index 2c59b4b..845b9fb 100644 --- a/nvim/lua/plugins/colors.lua +++ b/nvim/lua/plugins/colors.lua @@ -1,9 +1,10 @@ return { { "catppuccin-nvim", - -- colorscheme = "catppuccin", - load = function() end, + colorscheme = "catppuccin", + lazy = false, priority = 1000, + load = function() end, opt = { integrations = { telescope = { @@ -14,7 +15,7 @@ return { }, after = function(plug) require("catppuccin").setup(plug.opt) - vim.cmd.colorscheme "catppuccin" + vim.cmd.colorscheme("catppuccin") end, }, } diff --git a/nvim/lua/plugins/mini.lua b/nvim/lua/plugins/mini.lua new file mode 100644 index 0000000..2409338 --- /dev/null +++ b/nvim/lua/plugins/mini.lua @@ -0,0 +1,11 @@ +return { + { + "mini.nvim", + lazy = false, + load = function() end, + after = function() + require("mini.icons").setup(); + MiniIcons.mock_nvim_web_devicons() + end, + }, +} diff --git a/nvim/lua/plugins/oil.lua b/nvim/lua/plugins/oil.lua new file mode 100644 index 0000000..3104f6a --- /dev/null +++ b/nvim/lua/plugins/oil.lua @@ -0,0 +1,23 @@ +return { + { + "oil.nvim", + lazy = false, + load = function() end, + keys = { + { "-", "Oil", desc = "Open parent directory" }, + { "", "Oil", desc = "Open parent directory" }, + }, + opts = { + skip_confirm_for_simple_edits = true, + view_options = { + show_hidden = true, + }, + keymaps = { + [""] = "actions.parent", + }, + }, + after = function(plug) + require("oil").setup(plug.opts) + end + } +}