diff --git a/flake.lock b/flake.lock index f982b9a..e3b1e41 100644 --- a/flake.lock +++ b/flake.lock @@ -258,27 +258,6 @@ "type": "github" } }, - "genebean-neovim": { - "inputs": { - "nix-wrapper-modules": "nix-wrapper-modules", - "nixpkgs": [ - "nixpkgs-unstable" - ] - }, - "locked": { - "lastModified": 1775875603, - "narHash": "sha256-U3pv5uw/V0STc+osvb+QOlAuQ4ROZ5nu83i5yyj6WWo=", - "owner": "genebean", - "repo": "neovim-flake", - "rev": "baf7503fe8f4f8749253033d01620ff5dd52641b", - "type": "github" - }, - "original": { - "owner": "genebean", - "repo": "neovim-flake", - "type": "github" - } - }, "genebean-omp-themes": { "flake": false, "locked": { @@ -501,27 +480,6 @@ "type": "github" } }, - "nix-wrapper-modules": { - "inputs": { - "nixpkgs": [ - "genebean-neovim", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1775724285, - "narHash": "sha256-/ukfzDYzcuz7i+unH7XioPS3Acam6FC935XsOCaJDmY=", - "owner": "BirdeeHub", - "repo": "nix-wrapper-modules", - "rev": "d79d2f910dd0d8bffd11113865923199cb304f86", - "type": "github" - }, - "original": { - "owner": "BirdeeHub", - "repo": "nix-wrapper-modules", - "type": "github" - } - }, "nixos-cosmic": { "inputs": { "flake-compat": "flake-compat_2", @@ -719,7 +677,6 @@ "deadnix": "deadnix", "disko": "disko", "flox": "flox", - "genebean-neovim": "genebean-neovim", "genebean-omp-themes": "genebean-omp-themes", "home-manager": "home-manager", "nix-auth": "nix-auth", diff --git a/flake.nix b/flake.nix index 09233ef..6492435 100644 --- a/flake.nix +++ b/flake.nix @@ -27,11 +27,6 @@ url = "github:flox/flox/v1.4.4"; }; - genebean-neovim = { - url = "github:genebean/neovim-flake"; - inputs.nixpkgs.follows = "nixpkgs-unstable"; - }; - # My oh-my-posh theme genebean-omp-themes = { url = "github:genebean/my-oh-my-posh-themes"; diff --git a/lib/mkDarwinHost.nix b/lib/mkDarwinHost.nix index d4d46eb..cbe6f87 100644 --- a/lib/mkDarwinHost.nix +++ b/lib/mkDarwinHost.nix @@ -38,7 +38,6 @@ ../modules/hosts/darwin/home.nix ../modules/hosts/darwin/${hostname}/home-${username}.nix - inputs.genebean-neovim.homeManagerModules.default inputs.private-flake.homeManagerModules.private.git (inputs.private-flake.homeManagerModules.private.${hostname} or { }) inputs.sops-nix.homeManagerModule # user-level secrets management diff --git a/lib/mkHomeConfig.nix b/lib/mkHomeConfig.nix index 76d62ee..1ab768a 100644 --- a/lib/mkHomeConfig.nix +++ b/lib/mkHomeConfig.nix @@ -34,7 +34,6 @@ }; } - inputs.genebean-neovim.homeManagerModules.default inputs.nix-flatpak.homeManagerModules.nix-flatpak inputs.private-flake.homeManagerModules.private.git inputs.sops-nix.homeManagerModules.sops diff --git a/lib/mkNixosHost.nix b/lib/mkNixosHost.nix index 6e852f9..a1ab80c 100644 --- a/lib/mkNixosHost.nix +++ b/lib/mkNixosHost.nix @@ -30,7 +30,6 @@ ../modules/shared/home/linux ../modules/hosts/nixos/${hostname}/home-${username}.nix - inputs.genebean-neovim.homeManagerModules.default inputs.private-flake.homeManagerModules.private.git (inputs.private-flake.homeManagerModules.private.${hostname} or { }) ]; diff --git a/modules/shared/files/nvim/lua/config/vim-options.lua b/modules/shared/files/nvim/lua/config/vim-options.lua new file mode 100644 index 0000000..eeff266 --- /dev/null +++ b/modules/shared/files/nvim/lua/config/vim-options.lua @@ -0,0 +1,31 @@ +vim.g.mapleader = " " +vim.g.maplocalleader = " " + +-- make sure vim know I always have a dark terminal +vim.opt.background = "dark" + +-- use spaces for tabs and whatnot +vim.opt.expandtab = true +vim.opt.tabstop = 2 +vim.opt.softtabstop = 2 +vim.opt.shiftwidth = 2 +vim.opt.shiftround = true + +-- make sure all the mouse stuff is on. +-- pressing alt to hightlight + copy/paste works like it does outside of nvim +vim.opt.mouse = "a" + +vim.keymap.set("n", "h", ":nohlsearch") + +vim.wo.number = true + +vim.o.termguicolors = true + +-- Tips from https://github.com/folke/edgy.nvim +-- views can only be fully collapsed with the global statusline +vim.opt.laststatus = 3 + +-- Default splitting will cause your main splits to jump when opening an edgebar. +-- To prevent this, set `splitkeep` to either `screen` or `topline`. +vim.opt.splitkeep = "screen" + diff --git a/modules/shared/files/nvim/lua/disabled/barbar.lua b/modules/shared/files/nvim/lua/disabled/barbar.lua new file mode 100644 index 0000000..b3d6668 --- /dev/null +++ b/modules/shared/files/nvim/lua/disabled/barbar.lua @@ -0,0 +1,14 @@ +return {'romgrk/barbar.nvim', + dependencies = { + 'lewis6991/gitsigns.nvim', -- OPTIONAL: for git status + 'nvim-tree/nvim-web-devicons', -- OPTIONAL: for file icons + }, + init = function() vim.g.barbar_auto_setup = false end, + opts = { + -- lazy.nvim will automatically call setup for you. put your options here, anything missing will use the default: + -- animation = true, + -- insert_at_start = true, + -- …etc. + }, +} + diff --git a/modules/shared/files/nvim/lua/disabled/cheatsheet.lua b/modules/shared/files/nvim/lua/disabled/cheatsheet.lua new file mode 100644 index 0000000..e478932 --- /dev/null +++ b/modules/shared/files/nvim/lua/disabled/cheatsheet.lua @@ -0,0 +1,9 @@ +return { + "sudormrfbin/cheatsheet.nvim", + dependencies = { + 'nvim-telescope/telescope.nvim', + 'nvim-lua/popup.nvim', + 'nvim-lua/plenary.nvim', + }, + config = true, +} diff --git a/modules/shared/files/nvim/lua/disabled/nvim-tree.lua b/modules/shared/files/nvim/lua/disabled/nvim-tree.lua new file mode 100644 index 0000000..fd61629 --- /dev/null +++ b/modules/shared/files/nvim/lua/disabled/nvim-tree.lua @@ -0,0 +1,11 @@ +return{ + "nvim-tree/nvim-tree.lua", + config = function () + vim.g.loaded_netrw = 1 + vim.g.loaded_netrwPlugin = 1 + + require('nvim-tree').setup() + + vim.keymap.set('n', '', ':NvimTreeFindFileToggle') + end +} \ No newline at end of file diff --git a/modules/shared/files/nvim/lua/disabled/themes/dracula.lua b/modules/shared/files/nvim/lua/disabled/themes/dracula.lua new file mode 100644 index 0000000..59a11d2 --- /dev/null +++ b/modules/shared/files/nvim/lua/disabled/themes/dracula.lua @@ -0,0 +1,8 @@ +return { + "Mofiqul/dracula.nvim", + lazy = false, + priority = 1000, + config = function() + vim.cmd.colorscheme("dracula") + end, +} diff --git a/modules/shared/files/nvim/lua/disabled/themes/gruvbox.lua b/modules/shared/files/nvim/lua/disabled/themes/gruvbox.lua new file mode 100644 index 0000000..5959325 --- /dev/null +++ b/modules/shared/files/nvim/lua/disabled/themes/gruvbox.lua @@ -0,0 +1,11 @@ +return { + "ellisonleao/gruvbox.nvim", + priority = 1000 , + config = function () + require("gruvbox").setup() + + vim.o.background = "dark" + vim.o.termguicolors = true + vim.cmd.colorscheme "gruvbox" + end +} diff --git a/modules/shared/files/nvim/lua/disabled/themes/kanagawa.lua b/modules/shared/files/nvim/lua/disabled/themes/kanagawa.lua new file mode 100644 index 0000000..9bb8090 --- /dev/null +++ b/modules/shared/files/nvim/lua/disabled/themes/kanagawa.lua @@ -0,0 +1,8 @@ +return { + "rebelot/kanagawa.nvim", + lazy = false, + priority = 1000, + config = function() + vim.cmd.colorscheme "kanagawa" + end, +} diff --git a/modules/shared/files/nvim/lua/disabled/themes/oxocarbon.lua b/modules/shared/files/nvim/lua/disabled/themes/oxocarbon.lua new file mode 100644 index 0000000..9249ddd --- /dev/null +++ b/modules/shared/files/nvim/lua/disabled/themes/oxocarbon.lua @@ -0,0 +1,8 @@ +return { + "nyoom-engineering/oxocarbon.nvim", + config = function () + vim.o.background = "dark" + vim.o.termguicolors = true + vim.cmd.colorscheme "oxocarbon" + end +} diff --git a/modules/shared/files/nvim/lua/disabled/themes/tokyonight.lua b/modules/shared/files/nvim/lua/disabled/themes/tokyonight.lua new file mode 100644 index 0000000..d12df83 --- /dev/null +++ b/modules/shared/files/nvim/lua/disabled/themes/tokyonight.lua @@ -0,0 +1,10 @@ +return { + -- the colorscheme should be available when starting Neovim + "folke/tokyonight.nvim", + lazy = false, -- make sure we load this during startup if it is your main colorscheme + priority = 1000, -- make sure to load this before all the other start plugins + config = function() + -- load the colorscheme here + vim.cmd.colorscheme "tokyonight-storm" + end, +} \ No newline at end of file diff --git a/modules/shared/files/nvim/lua/plugins/alpha.lua b/modules/shared/files/nvim/lua/plugins/alpha.lua new file mode 100644 index 0000000..61c763e --- /dev/null +++ b/modules/shared/files/nvim/lua/plugins/alpha.lua @@ -0,0 +1,33 @@ +return { + "goolord/alpha-nvim", + dependencies = { + "nvim-tree/nvim-web-devicons", + }, + + config = function() + local alpha = require("alpha") + local dashboard = require("alpha.themes.startify") + + dashboard.section.header.val = { + [[ ]], + [[ ]], + [[ ]], + [[ ]], + [[  ]], + [[ ████ ██████ █████ ██ ]], + [[ ███████████ █████  ]], + [[ █████████ ███████████████████ ███ ███████████ ]], + [[ █████████ ███ █████████████ █████ ██████████████ ]], + [[ █████████ ██████████ █████████ █████ █████ ████ █████ ]], + [[ ███████████ ███ ███ █████████ █████ █████ ████ █████ ]], + [[ ██████ █████████████████████ ████ █████ █████ ████ ██████ ]], + [[ ]], + [[ ]], + [[ ]], + } + + alpha.setup(dashboard.opts) + + vim.cmd('autocmd User AlphaReady Neotree show') + end, +} diff --git a/modules/shared/files/nvim/lua/plugins/bufferline.lua b/modules/shared/files/nvim/lua/plugins/bufferline.lua new file mode 100644 index 0000000..3c2bc72 --- /dev/null +++ b/modules/shared/files/nvim/lua/plugins/bufferline.lua @@ -0,0 +1,49 @@ +return { + "akinsho/bufferline.nvim", + after = "catppuccin", + dependencies = { "nvim-tree/nvim-web-devicons" }, + version = "*", + config = function() + -- Get the color pallet of the theme flavor I am using + local color_palette = require("catppuccin.palettes").get_palette("frappe") + + -- Set variables to use the color they'd use if the background was not transparent + local bg_highlight = color_palette.crust + local separator_fg = color_palette.crust + + require("bufferline").setup({ + highlights = require("catppuccin.groups.integrations.bufferline").get({ + -- Copy settings from Catppuccin bufferline integration and override just the + -- part that is needed to make it look like it would if the background was not + -- set to transparent in catppuccin.lua + -- https://github.com/catppuccin/nvim/blob/main/lua/catppuccin/groups/integrations/bufferline.lua + custom = { + all = { + -- this makes the background behind the tabs contrast with the tabs themselves + fill = { bg = bg_highlight }, + + -- separators + -- I am only overriding the foreground as that is what makes the tabs look correct + separator = { fg = separator_fg }, + separator_visible = { fg = separator_fg }, + separator_selected = { fg = separator_fg }, + offset_separator = { fg = separator_fg }, + }, + }, + }), + options = { + mode = "buffers", + separator_style = "slant", + offsets = { + { + filetype = "neo-tree", + text = "File Explorer", + highlight = "Directory", + separator = true, + }, + }, + diagnostics = "nvim_lsp", + }, + }) + end, +} diff --git a/modules/shared/files/nvim/lua/plugins/catppuccin.lua b/modules/shared/files/nvim/lua/plugins/catppuccin.lua new file mode 100644 index 0000000..ce011c5 --- /dev/null +++ b/modules/shared/files/nvim/lua/plugins/catppuccin.lua @@ -0,0 +1,57 @@ +return { + "catppuccin/nvim", + name = "catppuccin", + flavour = "frappe", -- latte, frappe, macchiato, mocha + lazy = false, + priority = 1000, + config = function() + require("catppuccin").setup({ + transparent_background = true, + color_overrides = { + frappe = { + base = "#07042B", + mantle = "#0c0746", + crust = "#10095d", + rosewater = "#FF7F7F", -- used for cursor + }, + }, + custom_highlights = function(colors) + return { + Comment = { fg = colors.subtext0 }, + LineNr = { fg = colors.subtext0 }, + } + end, + }) + vim.cmd.colorscheme("catppuccin") + end, + + --[[ + -- original palette from frappe: + rosewater = "#f2d5cf", + flamingo = "#eebebe", + pink = "#f4b8e4", + mauve = "#ca9ee6", + red = "#e78284", + maroon = "#ea999c", + peach = "#ef9f76", + yellow = "#e5c890", + green = "#a6d189", + teal = "#81c8be", + sky = "#99d1db", + sapphire = "#85c1dc", + blue = "#8caaee", + lavender = "#babbf1", + text = "#c6d0f5", + subtext1 = "#b5bfe2", + subtext0 = "#a5adce", + overlay2 = "#949cbb", + overlay1 = "#838ba7", + overlay0 = "#737994", + surface2 = "#626880", + surface1 = "#51576d", + surface0 = "#414559", + base = "#303446", + mantle = "#292c3c", + crust = "#232634", + --]] +} diff --git a/modules/shared/files/nvim/lua/plugins/completions.lua b/modules/shared/files/nvim/lua/plugins/completions.lua new file mode 100644 index 0000000..0318318 --- /dev/null +++ b/modules/shared/files/nvim/lua/plugins/completions.lua @@ -0,0 +1,49 @@ +return { + { + "hrsh7th/nvim-cmp", + config = function() + local cmp = require("cmp") + require("luasnip.loaders.from_vscode").lazy_load() + + cmp.setup({ + snippet = { + expand = function(args) + require("luasnip").lsp_expand(args.body) + end, + }, + window = { + completion = cmp.config.window.bordered(), + documentation = cmp.config.window.bordered(), + }, + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.complete(), + [""] = cmp.mapping.abort(), + [""] = cmp.mapping.confirm({ select = true }), + }), + sources = cmp.config.sources({ + { + name = "nvim_lsp", + entry_filter = function(entry) + return require("cmp.types").lsp.CompletionItemKind[entry:get_kind()] ~= "Text" + end, + }, + { name = "luasnip" }, + }, { + { name = "buffer" }, + }), + }) + end, + }, + { + "hrsh7th/cmp-nvim-lsp", + }, + { + "L3MON4D3/LuaSnip", + dependencies = { + "saadparwaiz1/cmp_luasnip", + "rafamadriz/friendly-snippets", + }, + }, +} diff --git a/modules/shared/files/nvim/lua/plugins/edgy.lua b/modules/shared/files/nvim/lua/plugins/edgy.lua new file mode 100644 index 0000000..0163df4 --- /dev/null +++ b/modules/shared/files/nvim/lua/plugins/edgy.lua @@ -0,0 +1,65 @@ +return { + "folke/edgy.nvim", + event = "VeryLazy", + opts = { + exit_when_last = false, + bottom = { + -- toggleterm / lazyterm at the bottom with a height of 40% of the screen + { + ft = "toggleterm", + size = { height = 0.2 }, + -- exclude floating windows + filter = function(buf, win) + return vim.api.nvim_win_get_config(win).relative == "" + end, + }, + "Trouble", + { ft = "qf", title = "QuickFix" }, + { + ft = "help", + size = { height = 20 }, + -- only show help buffers + filter = function(buf) + return vim.bo[buf].buftype == "help" + end, + }, + { ft = "spectre_panel", size = { height = 0.4 } }, + }, + left = { + -- Neo-tree filesystem always takes half the screen height + { + title = "Neo-Tree", + ft = "neo-tree", + filter = function(buf) + return vim.b[buf].neo_tree_source == "filesystem" + end, + size = { height = 0.5 }, + }, + { + title = "Neo-Tree Git", + ft = "neo-tree", + filter = function(buf) + return vim.b[buf].neo_tree_source == "git_status" + end, + pinned = true, + open = "Neotree position=right git_status", + }, + { + title = "Neo-Tree Buffers", + ft = "neo-tree", + filter = function(buf) + return vim.b[buf].neo_tree_source == "buffers" + end, + pinned = true, + open = "Neotree position=top buffers", + }, + { + ft = "Outline", + pinned = true, + open = "SymbolsOutlineOpen", + }, + -- any other neo-tree windows + "neo-tree", + }, + }, +} diff --git a/modules/shared/files/nvim/lua/plugins/git-stuff.lua b/modules/shared/files/nvim/lua/plugins/git-stuff.lua new file mode 100644 index 0000000..3211630 --- /dev/null +++ b/modules/shared/files/nvim/lua/plugins/git-stuff.lua @@ -0,0 +1,38 @@ +return { + { + "lewis6991/gitsigns.nvim", + config = function() + require("gitsigns").setup({ + current_line_blame = true, + }) + + vim.keymap.set("n", "", {}) + end, + }, + { + "tpope/vim-fugitive", + }, + { + "kdheepak/lazygit.nvim", + cmd = { + "LazyGit", + "LazyGitConfig", + "LazyGitCurrentFile", + "LazyGitFilter", + "LazyGitFilterCurrentFile", + }, + -- optional for floating window border decoration + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-telescope/telescope.nvim", + }, + -- setting the keybinding for LazyGit with 'keys' is recommended in + -- order to load the plugin when the command is run for the first time + keys = { + { "lg", "LazyGit", desc = "LazyGit" }, + }, + config = function() + require("telescope").load_extension("lazygit") + end, + }, +} diff --git a/modules/shared/files/nvim/lua/plugins/lsp-config.lua b/modules/shared/files/nvim/lua/plugins/lsp-config.lua new file mode 100644 index 0000000..b665c2a --- /dev/null +++ b/modules/shared/files/nvim/lua/plugins/lsp-config.lua @@ -0,0 +1,65 @@ +return { + { + "williamboman/mason.nvim", + config = true, + }, + { + "williamboman/mason-lspconfig.nvim", + config = function() + require("mason-lspconfig").setup({ + ensure_installed = { + "lemminx", -- xml + "lua_ls", -- lua + "nil_ls", -- nix + "puppet", -- puppet + "ruff", -- python + }, + }) + end, + }, + { + "neovim/nvim-lspconfig", + config = function() + local on_attach = function(_, _) + vim.keymap.set("n", "rn", vim.lsp.buf.rename, {}) + vim.keymap.set("n", "ca", vim.lsp.buf.code_action, {}) + + vim.keymap.set("n", "gd", vim.lsp.buf.definition, {}) + vim.keymap.set("n", "gi", vim.lsp.buf.implementation, {}) + vim.keymap.set("n", "gr", require("telescope.builtin").lsp_references, {}) + vim.keymap.set("n", "K", vim.lsp.buf.hover, {}) + end + + local lspconfig = require("lspconfig") + local capabilities = require("cmp_nvim_lsp").default_capabilities() + + lspconfig.lemminx.setup({ + capabilities = capabilities, + on_attach = on_attach, + }) + + lspconfig.lua_ls.setup({ + capabilities = capabilities, + on_attach = on_attach, + settings = { Lua = { diagnostics = { globals = { "vim" } } } }, + }) + + lspconfig.nil_ls.setup({ + capabilities = capabilities, + on_attach = on_attach, + }) + + local puppet_languageserver = vim.fn.expand( + "$HOME/.local/share/nvim/mason/packages/puppet-editor-services/libexec/puppet-languageserver" + ) + + lspconfig.puppet.setup({ + capabilities = capabilities, + on_attach = on_attach, + cmd = { puppet_languageserver, "--feature-flags=puppetstrings" }, + settings = { puppet = { editorServices = { formatOnType = { enable = true } } } }, + }) + lspconfig.ruff.setup({ on_attach = on_attach }) + end, + }, +} diff --git a/modules/shared/files/nvim/lua/plugins/lualine.lua b/modules/shared/files/nvim/lua/plugins/lualine.lua new file mode 100644 index 0000000..757df1f --- /dev/null +++ b/modules/shared/files/nvim/lua/plugins/lualine.lua @@ -0,0 +1,19 @@ +return { + "nvim-lualine/lualine.nvim", + config = function() + require("lualine").setup({ + options = { + icons_enabled = true, + -- theme = "dracula-nvim", + }, + sections = { + lualine_a = { + { + "filename", + path = 1, + }, + }, + }, + }) + end, +} diff --git a/modules/shared/files/nvim/lua/plugins/neo-tree.lua b/modules/shared/files/nvim/lua/plugins/neo-tree.lua new file mode 100644 index 0000000..ad2938c --- /dev/null +++ b/modules/shared/files/nvim/lua/plugins/neo-tree.lua @@ -0,0 +1,24 @@ +return { + "nvim-neo-tree/neo-tree.nvim", + lazy = false, + branch = "v3.x", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-tree/nvim-web-devicons", + "MunifTanjim/nui.nvim", + }, + config = function() + vim.g.loaded_netrw = 1 + vim.g.loaded_netrwPlugin = 1 + vim.keymap.set("n", "", ":Neotree toggle", {}) + require("neo-tree").setup({ + filesystem = { + follow_current_file = { + enabled = true, + }, + hijack_netrw_behavior = "open_default", + }, + follow_current_file = { enabled = true }, + }) + end, +} diff --git a/modules/shared/files/nvim/lua/plugins/noice.lua b/modules/shared/files/nvim/lua/plugins/noice.lua new file mode 100644 index 0000000..cdd3c45 --- /dev/null +++ b/modules/shared/files/nvim/lua/plugins/noice.lua @@ -0,0 +1,61 @@ +return { + "folke/noice.nvim", + event = "VeryLazy", + opts = { + -- add any options here + }, + dependencies = { + -- if you lazy-load any plugin below, make sure to add proper `module="..."` entries + "MunifTanjim/nui.nvim", + -- OPTIONAL: + -- `nvim-notify` is only needed, if you want to use the notification view. + -- If not available, we use `mini` as the fallback + -- "rcarriga/nvim-notify", + }, + config = function() + require("noice").setup({ + cmdline = { enabled = true }, + messages = { enabled = false }, + + lsp = { + -- override markdown rendering so that **cmp** and other plugins use **Treesitter** + override = { + ["vim.lsp.util.convert_input_to_markdown_lines"] = true, + ["vim.lsp.util.stylize_markdown"] = true, + ["cmp.entry.get_documentation"] = true, + }, + }, + + views = { + cmdline_popup = { + position = { + row = "50%", + col = "50%", + }, + size = { + width = 60, + height = "auto", + }, + }, + popupmenu = { + relative = "editor", + position = { + row = "61%", + col = "50%", + }, + size = { + width = 60, + height = 10, + }, + border = { + style = "rounded", + padding = { 0, 1 }, + }, + win_options = { + winhighlight = { Normal = "Normal", FloatBorder = "DiagnosticInfo" }, + }, + }, + }, + }) + end, +} diff --git a/modules/shared/files/nvim/lua/plugins/none-ls.lua b/modules/shared/files/nvim/lua/plugins/none-ls.lua new file mode 100644 index 0000000..c829989 --- /dev/null +++ b/modules/shared/files/nvim/lua/plugins/none-ls.lua @@ -0,0 +1,40 @@ +return { + { + "jay-babu/mason-null-ls.nvim", + event = { "BufReadPre", "BufNewFile" }, + dependencies = { + "williamboman/mason.nvim", + "nvimtools/none-ls.nvim", + }, + config = function() + require("mason-null-ls").setup({ + ensure_installed = { + "prettier", -- HTML, JS, JSON, etc. + "stylua", -- LUA + }, + }) + end, + }, + { + -- none-ls replaces null_ls... it's weird + "nvimtools/none-ls.nvim", + dependencies = { "nvim-lua/plenary.nvim" }, + config = function() + local null_ls = require("null-ls") + + null_ls.setup({ + sources = { + null_ls.builtins.completion.spell, + null_ls.builtins.diagnostics.puppet_lint, + null_ls.builtins.diagnostics.rubocop, + null_ls.builtins.formatting.prettier, + null_ls.builtins.formatting.puppet_lint, + null_ls.builtins.formatting.rubocop, + null_ls.builtins.formatting.stylua, + }, + }) + + vim.keymap.set("n", "gf", vim.lsp.buf.format, {}) + end, + }, +} diff --git a/modules/shared/files/nvim/lua/plugins/nvim-web-devicons.lua b/modules/shared/files/nvim/lua/plugins/nvim-web-devicons.lua new file mode 100644 index 0000000..952c910 --- /dev/null +++ b/modules/shared/files/nvim/lua/plugins/nvim-web-devicons.lua @@ -0,0 +1,4 @@ +return { + "nvim-tree/nvim-web-devicons", + config = true, +} diff --git a/modules/shared/files/nvim/lua/plugins/telescope.lua b/modules/shared/files/nvim/lua/plugins/telescope.lua new file mode 100644 index 0000000..8fb81ae --- /dev/null +++ b/modules/shared/files/nvim/lua/plugins/telescope.lua @@ -0,0 +1,40 @@ +return { + { + "nvim-telescope/telescope.nvim", + tag = "0.1.5", + dependencies = { "nvim-lua/plenary.nvim" }, + config = function() + -- This is your opts table + require("telescope").setup({ + extensions = { + ["ui-select"] = { + require("telescope.themes").get_dropdown({ + -- even more opts + }), + }, + }, + }) + + -- load_extension, somewhere after setup function: + require("telescope").load_extension("cheat") + require("telescope").load_extension("ui-select") + + local builtin = require("telescope.builtin") + + vim.keymap.set("n", "ts", ":Telescope") + vim.keymap.set("n", "", builtin.find_files, {}) + vim.keymap.set("n", "", builtin.oldfiles, {}) + vim.keymap.set("n", "fg", builtin.live_grep, {}) + vim.keymap.set("n", "fh", builtin.help_tags, {}) + end, + }, + { + "nvim-telescope/telescope-cheat.nvim", + dependencies = { + "kkharji/sqlite.lua", + "nvim-telescope/telescope.nvim", + }, + }, + { "nvim-telescope/telescope-symbols.nvim" }, + { "nvim-telescope/telescope-ui-select.nvim" }, +} diff --git a/modules/shared/files/nvim/lua/plugins/todo-comments.lua b/modules/shared/files/nvim/lua/plugins/todo-comments.lua new file mode 100644 index 0000000..52e52b6 --- /dev/null +++ b/modules/shared/files/nvim/lua/plugins/todo-comments.lua @@ -0,0 +1,9 @@ +return { + "folke/todo-comments.nvim", + dependencies = { "nvim-lua/plenary.nvim" }, + opts = { + -- your configuration comes here + -- or leave it empty to use the default settings + -- refer to the configuration section below + }, +} diff --git a/modules/shared/files/nvim/lua/plugins/toggleterm.lua b/modules/shared/files/nvim/lua/plugins/toggleterm.lua new file mode 100644 index 0000000..22121c0 --- /dev/null +++ b/modules/shared/files/nvim/lua/plugins/toggleterm.lua @@ -0,0 +1,5 @@ +return { + "akinsho/toggleterm.nvim", + version = "*", + config = true, +} diff --git a/modules/shared/files/nvim/lua/plugins/treesitter.lua b/modules/shared/files/nvim/lua/plugins/treesitter.lua new file mode 100644 index 0000000..7a7cc8b --- /dev/null +++ b/modules/shared/files/nvim/lua/plugins/treesitter.lua @@ -0,0 +1,53 @@ +return { + "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate", + config = function() + local config = require("nvim-treesitter.configs") + config.setup({ + auto_install = true, + highlight = { enable = true }, + indent = { enable = true }, + sync_install = false, + ensure_installed = { + "bash", + "css", + "csv", + "diff", + "dockerfile", + "git_config", + "git_rebase", + "gitattributes", + "gitignore", + "go", + "hcl", + "hocon", + "html", + "javascript", + "json", + "lua", + "make", + "markdown", + "markdown_inline", + "nix", + "passwd", + "promql", + "puppet", + "python", + "regex", + --"pip_requirements", + "ruby", + "sql", + "ssh_config", + "terraform", + "toml", + "tsv", + "typescript", + "udev", + "vim", + "vimdoc", + "xml", + "yaml", + }, + }) + end, +} diff --git a/modules/shared/files/nvim/lua/plugins/trouble.lua b/modules/shared/files/nvim/lua/plugins/trouble.lua new file mode 100644 index 0000000..de1f2e4 --- /dev/null +++ b/modules/shared/files/nvim/lua/plugins/trouble.lua @@ -0,0 +1,5 @@ +return { + "folke/trouble.nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + config = true, +} diff --git a/modules/shared/files/nvim/lua/plugins/vim-tmux-navigator.lua b/modules/shared/files/nvim/lua/plugins/vim-tmux-navigator.lua new file mode 100644 index 0000000..07ec90a --- /dev/null +++ b/modules/shared/files/nvim/lua/plugins/vim-tmux-navigator.lua @@ -0,0 +1,3 @@ +return { + "christoomey/vim-tmux-navigator", +} diff --git a/modules/shared/files/nvim/lua/plugins/which-key.lua b/modules/shared/files/nvim/lua/plugins/which-key.lua new file mode 100644 index 0000000..60cf348 --- /dev/null +++ b/modules/shared/files/nvim/lua/plugins/which-key.lua @@ -0,0 +1,4 @@ +return { + "folke/which-key.nvim", + config = true, +} diff --git a/modules/shared/home/general/default.nix b/modules/shared/home/general/default.nix index 1395417..a0f2b2f 100644 --- a/modules/shared/home/general/default.nix +++ b/modules/shared/home/general/default.nix @@ -4,6 +4,18 @@ pkgs, ... }: +let + sqlite_lib = + if + builtins.elem pkgs.stdenv.hostPlatform.system [ + "aarch64-darwin" + "x86_64-darwin" + ] + then + "libsqlite3.dylib" + else + "libsqlite3.so"; +in { home = { packages = with pkgs; [ @@ -62,6 +74,14 @@ PAGER = "less"; }; file = { + ".config/nvim/lua/config" = { + source = ../../files/nvim/lua/config; + recursive = true; + }; + ".config/nvim/lua/plugins" = { + source = ../../files/nvim/lua/plugins; + recursive = true; + }; ".config/powershell/Microsoft.PowerShell_profile.ps1".source = ../../files/Microsoft.PowerShell_profile.ps1; ".config/powershell/Microsoft.VSCode_profile.ps1".source = @@ -110,7 +130,6 @@ }; eza.enable = true; fzf.enable = true; - genebean-neovim.enable = true; gh.enable = true; git = { enable = true; @@ -151,6 +170,38 @@ }; # end git irssi.enable = true; jq.enable = true; + neovim = { + enable = true; + defaultEditor = true; + extraLuaConfig = '' + -- NOTE: This will get the OS from Lua: + -- print(vim.loop.os_uname().sysname) + + -- setup lazy.nvim + local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" + vim.opt.rtp:prepend(lazypath) + + -- hack to deal with bug in telescope-cheat.nvim + -- https://github.com/nvim-telescope/telescope-cheat.nvim/issues/7 + local cheat_dbdir = vim.fn.stdpath "data" .. "/databases" + if not vim.loop.fs_stat(cheat_dbdir) then + vim.loop.fs_mkdir(cheat_dbdir, 493) + end + + -- load additional settings + require("config.vim-options") + require("lazy").setup("plugins") + + -- tell sqlite.lua where to find the bits it needs + vim.g.sqlite_clib_path = '${pkgs.sqlite.out}/lib/${sqlite_lib}' + + ''; + extraPackages = with pkgs; [ + gcc # needed so treesitter can do compiling + sqlite # needed by sqlite.lua used by telescope-cheat + ]; + plugins = [ pkgs.vimPlugins.lazy-nvim ]; # let lazy.nvim manage every other plugin + }; nh = { enable = true; flake = "${config.home.homeDirectory}/repos/dots";