diff options
| -rw-r--r-- | flake.nix | 19 | ||||
| -rw-r--r-- | init.lua | 1 | ||||
| -rw-r--r-- | lua/config/init.lua | 6 | ||||
| -rw-r--r-- | lua/config/options.lua | 54 | ||||
| -rw-r--r-- | lua/config/plugins/extra.lua | 13 | ||||
| -rw-r--r-- | lua/config/plugins/init.lua | 8 | ||||
| -rw-r--r-- | lua/config/plugins/telescope.lua | 26 | ||||
| -rw-r--r-- | lua/config/plugins/treesitter.lua | 1 | 
8 files changed, 126 insertions, 2 deletions
| @@ -104,14 +104,25 @@        # This is for plugins that will load at startup without using packadd:        startupPlugins = {          gitPlugins = with pkgs.neovimPlugins; [ ]; -        general = with pkgs.vimPlugins; [ ]; + +        general = with pkgs.vimPlugins; { +          always = [ lze lzextras ]; +        }; + +        theme = with pkgs.vimPlugins; (builtins.getAttr (categories.colorscheme or "catppuccin-mocha") { +          "catppuccin-mocha" = catppuccin-nvim; +        });        };        # not loaded automatically at startup.        # use with packadd and an autocommand in config to achieve lazy loading        optionalPlugins = {          gitPlugins = with pkgs.neovimPlugins; [ ]; -        general = with pkgs.vimPlugins; [ ]; + +        general = with pkgs.vimPlugins; { +          telescope = [ telescope-nvim ]; +          extra = [ which-key-nvim ]; +        };        };        # shared libraries to be added to LD_LIBRARY_PATH @@ -180,9 +191,13 @@          # and a set of categories that you want          # (and other information to pass to lua)          categories = { +          theme = true; +          colorscheme = "catppuccin-mocha"; +            general = true;            gitPlugins = true;            customPlugins = true; +            test = true;            example = {              youCan = "add more than just booleans"; diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..dbc863e --- /dev/null +++ b/init.lua @@ -0,0 +1 @@ +require("config") diff --git a/lua/config/init.lua b/lua/config/init.lua new file mode 100644 index 0000000..0c5bcb6 --- /dev/null +++ b/lua/config/init.lua @@ -0,0 +1,6 @@ +require("config.options") + +-- require("lze").register_handlers(require("nixCatsUtils.lzUtils").for_cat) +require("lze").register_handlers(require("lzextras").lsp) + +require("config.plugins") diff --git a/lua/config/options.lua b/lua/config/options.lua new file mode 100644 index 0000000..4bdfe21 --- /dev/null +++ b/lua/config/options.lua @@ -0,0 +1,54 @@ +-- Leader keys (must be set before loading plugins) +vim.g.mapleader = " " +vim.g.maplocalleader = "," + +-- Setup clipboard on Wayland +if os.getenv("WAYLAND_DISPLAY") and vim.fn.exepath("wl-copy") ~= "" then +  vim.g.clipboard = { +    name = "wl-clipboard", +    copy = { +      ["+"] = "wl-copy", +      ["*"] = "wl-copy", +    }, +    paste = { +      ["+"] = "wl-paste", +      ["*"] = "wl-paste", +    }, +    cache_enabled = 1, +  } +end + +-- Terminal colors +vim.opt.termguicolors = true + +-- Enable undo history +vim.opt.undofile = true + +-- Line numbers +vim.opt.number = true +vim.opt.relativenumber = true +vim.opt.signcolumn = 'yes' + +-- Keep N lines above and below cursor +vim.opt.scrolloff = 5 + +-- Indentation +vim.opt.cpoptions:append("I") +vim.opt.expandtab = true +vim.opt.tabstop = 2 +vim.opt.softtabstop = 2 +vim.opt.shiftwidth = 2 + +-- Keymaps +local map = vim.keymap.set + +-- Helix-like keymaps, as they are SO CONVENIENT +map({ "n", "v" }, "ge", "G", { desc = "Last line" }) +map({ "n", "v" }, "gh", "^", { desc = "First non-whitespace char in line" }) +map({ "n", "v" }, "gH", "0", { desc = "First char in line" }) +map({ "n", "v" }, "gl", "$", { desc = "Last char in line" }) +map({ "n", "v" }, "gm", "%", { desc = "Matching bracket" }) + +-- Make NeoVim open folds when searching +map("n", "n", "nzzzv", { desc = 'Next Search Result' }) +map("n", "N", "Nzzzv", { desc = 'Previous Search Result' }) diff --git a/lua/config/plugins/extra.lua b/lua/config/plugins/extra.lua new file mode 100644 index 0000000..8cf9e70 --- /dev/null +++ b/lua/config/plugins/extra.lua @@ -0,0 +1,13 @@ +return { +	{ +		"which-key.nvim", +		event = "DeferredUIEnter", +		after = function(_) +			require("which-key").setup() + +			require("which-key").add({ +				{ "<leader>s", group = "search" }, +			}) +		end, +	}, +} diff --git a/lua/config/plugins/init.lua b/lua/config/plugins/init.lua new file mode 100644 index 0000000..7f254ae --- /dev/null +++ b/lua/config/plugins/init.lua @@ -0,0 +1,8 @@ +-- Setup colorscheme +vim.cmd.colorscheme(nixCats("colorscheme")) + +require("lze").load({ +	{ import = "config.plugins.telescope" }, +	{ import = "config.plugins.treesitter" }, +	{ import = "config.plugins.extra" }, +}) diff --git a/lua/config/plugins/telescope.lua b/lua/config/plugins/telescope.lua new file mode 100644 index 0000000..3f1ee9d --- /dev/null +++ b/lua/config/plugins/telescope.lua @@ -0,0 +1,26 @@ +return { +	{ +		"telescope.nvim", +		keys = { +			{ +				"<leader><leader>", +				function() +					require("telescope.builtin").find_files() +				end, +				mode = { "n" }, +				desc = "Search Files", +			}, +			{ +				"<leader>sf", +				function() +					require("telescope.builtin").find_files() +				end, +				mode = { "n" }, +				desc = "[S]earch [F]iles", +			}, +		}, +		after = function(_) +			require("telescope").setup({}) +		end, +	}, +} diff --git a/lua/config/plugins/treesitter.lua b/lua/config/plugins/treesitter.lua new file mode 100644 index 0000000..a564707 --- /dev/null +++ b/lua/config/plugins/treesitter.lua @@ -0,0 +1 @@ +return {} | 
