diff options
29 files changed, 489 insertions, 609 deletions
@@ -0,0 +1,31 @@ +{ + perSystem = { + config, + pkgs, + ... + }: { + devShells.default = pkgs.mkShell { + shellHook = config.pre-commit.installationScript; + + packages = with pkgs; [ + actionlint + self'.formatter + deadnix + nil + statix + stylua + ]; + }; + + formatter = pkgs.alejandra; + + pre-commit.settings.hooks = { + actionlint.enable = true; + alejandra.enable = true; + deadnix.enable = true; + nil.enable = true; + statix.enable = true; + stylua.enable = true; + }; + }; +} @@ -16,95 +16,42 @@ "type": "github" } }, - "gitignore": { - "inputs": { - "nixpkgs": [ - "pre-commit", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1660459072, - "narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=", - "owner": "hercules-ci", - "repo": "gitignore.nix", - "rev": "a20de23b925fd8264fd7fad6454652e142fd7f73", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "gitignore.nix", - "type": "github" - } - }, - "lazy-nvim": { - "flake": false, - "locked": { - "lastModified": 1678889456, - "narHash": "sha256-R+sfPOuWfwbrNXUiKQcb8MHYqK+o5Pw8gkEaYaidqp0=", - "owner": "folke", - "repo": "lazy.nvim", - "rev": "6b55862d2d264f0b48e0b9e42cc2d14f136bed55", - "type": "github" - }, - "original": { - "owner": "folke", - "repo": "lazy.nvim", - "type": "github" - } - }, - "neovim": { + "flake-utils": { "inputs": { - "flake-utils": [ - "utils" - ], - "nixpkgs": [ - "nixpkgs" - ] + "systems": "systems" }, "locked": { - "dir": "contrib", - "lastModified": 1697918051, - "narHash": "sha256-fMlw0rw3sO5GsjQVowSo79fSnZQAMT+w1gAkuKuNxw0=", - "owner": "neovim", - "repo": "neovim", - "rev": "3a3e0251267a99eec6cfb2a058f9e992d01107fd", + "lastModified": 1694529238, + "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", "type": "github" }, "original": { - "dir": "contrib", - "owner": "neovim", - "repo": "neovim", + "owner": "numtide", + "repo": "flake-utils", "type": "github" } }, - "neovim-nix": { + "gitignore": { "inputs": { - "flake-parts": [ - "parts" - ], - "lazy-nvim": "lazy-nvim", - "neovim": [ - "neovim" - ], "nixpkgs": [ + "pre-commit", "nixpkgs" - ], - "pre-commit-nix": [ - "pre-commit" ] }, "locked": { - "lastModified": 1690613475, - "narHash": "sha256-DyhvApZb/NBZ92dBgr0deJi4XQZ6lppIc92aDGrj8OY=", - "owner": "willruggiano", - "repo": "neovim.nix", - "rev": "b9ba181c5e20287aeeda4203e02c73f2cff370c4", + "lastModified": 1660459072, + "narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "a20de23b925fd8264fd7fad6454652e142fd7f73", "type": "github" }, "original": { - "owner": "willruggiano", - "repo": "neovim.nix", + "owner": "hercules-ci", + "repo": "gitignore.nix", "type": "github" } }, @@ -146,9 +93,7 @@ "pre-commit": { "inputs": { "flake-compat": "flake-compat", - "flake-utils": [ - "utils" - ], + "flake-utils": "flake-utils", "gitignore": "gitignore", "nixpkgs": [ "nixpkgs" @@ -173,12 +118,9 @@ }, "root": { "inputs": { - "neovim": "neovim", - "neovim-nix": "neovim-nix", "nixpkgs": "nixpkgs", "parts": "parts", - "pre-commit": "pre-commit", - "utils": "utils" + "pre-commit": "pre-commit" } }, "systems": { @@ -195,24 +137,6 @@ "repo": "default", "type": "github" } - }, - "utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1694529238, - "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } } }, "root": "root", @@ -9,40 +9,20 @@ inputs.nixpkgs-lib.follows = "nixpkgs"; }; - neovim = { - url = "github:neovim/neovim?dir=contrib"; - inputs.nixpkgs.follows = "nixpkgs"; - inputs.flake-utils.follows = "utils"; - }; - - neovim-nix = { - url = "github:willruggiano/neovim.nix"; - inputs = { - nixpkgs.follows = "nixpkgs"; - flake-parts.follows = "parts"; - pre-commit-nix.follows = "pre-commit"; - neovim.follows = "neovim"; - }; - }; - pre-commit = { url = "github:cachix/pre-commit-hooks.nix"; inputs = { nixpkgs.follows = "nixpkgs"; nixpkgs-stable.follows = "nixpkgs"; - flake-utils.follows = "utils"; }; }; - - # this is to prevent multiple versions in lockfile - utils.url = "github:numtide/flake-utils"; }; outputs = {parts, ...} @ inputs: parts.lib.mkFlake {inherit inputs;} { imports = [ inputs.pre-commit.flakeModule - inputs.neovim-nix.flakeModule + ./dev.nix ./neovim.nix ]; @@ -52,41 +32,5 @@ "x86_64-darwin" "aarch64-darwin" ]; - - perSystem = { - pkgs, - config, - self', - ... - }: { - packages = { - getchvim = config.neovim.final; - default = self'.packages.getchvim; - }; - - devShells.default = pkgs.mkShell { - shellHook = config.pre-commit.installationScript; - - packages = with pkgs; [ - actionlint - self'.formatter - deadnix - nil - statix - stylua - ]; - }; - - formatter = pkgs.alejandra; - - pre-commit.settings.hooks = { - actionlint.enable = true; - alejandra.enable = true; - deadnix.enable = true; - nil.enable = true; - statix.enable = true; - stylua.enable = true; - }; - }; }; } diff --git a/config/plugin/globals.lua b/lua/getchoo/globals.lua index 79db9e3..79db9e3 100644 --- a/config/plugin/globals.lua +++ b/lua/getchoo/globals.lua diff --git a/lua/getchoo/init.lua b/lua/getchoo/init.lua new file mode 100644 index 0000000..e7b816f --- /dev/null +++ b/lua/getchoo/init.lua @@ -0,0 +1,4 @@ +require("getchoo.globals") +require("getchoo.keymaps") +require("getchoo.options") +require("getchoo.plugins") diff --git a/config/plugin/keymaps.lua b/lua/getchoo/keymaps.lua index 8068db9..8068db9 100644 --- a/config/plugin/keymaps.lua +++ b/lua/getchoo/keymaps.lua diff --git a/config/plugin/options.lua b/lua/getchoo/options.lua index 7a13888..7a13888 100644 --- a/config/plugin/options.lua +++ b/lua/getchoo/options.lua diff --git a/lua/getchoo/plugins/bufferline.lua b/lua/getchoo/plugins/bufferline.lua new file mode 100644 index 0000000..b945a62 --- /dev/null +++ b/lua/getchoo/plugins/bufferline.lua @@ -0,0 +1,18 @@ +require("bufferline").setup({ + options = { + always_show_bufferline = false, + highlights = require("catppuccin.groups.integrations.bufferline").get(), + diagnostics = "nvim_lsp", + mode = "buffers", + numbers = "ordinal", + separator_style = "slant", + offsets = { + { + filetype = "neo-tree", + text = "neo-tree", + highlight = "Directory", + text_align = "left", + }, + }, + }, +}) diff --git a/lua/getchoo/plugins/catppuccin.lua b/lua/getchoo/plugins/catppuccin.lua new file mode 100644 index 0000000..853d283 --- /dev/null +++ b/lua/getchoo/plugins/catppuccin.lua @@ -0,0 +1,30 @@ +local compile_path = vim.fn.stdpath("cache") .. "/catppuccin-nvim" +vim.fn.mkdir(compile_path, "p") +vim.opt.runtimepath:append(compile_path) + +require("catppuccin").setup({ + compile_path = compile_path, + flavour = "mocha", -- mocha, macchiato, frappe, latte + integrations = { + cmp = true, + flash = true, + gitsigns = true, + indent_blankline = { + enabled = true, + }, + lsp_trouble = true, + native_lsp = { + enabled = true, + }, + neotree = true, + notify = true, + treesitter_context = true, + treesitter = true, + telescope = true, + which_key = true, + }, + + no_italic = true, +}) + +vim.cmd.colorscheme("catppuccin") diff --git a/lua/getchoo/plugins/cmp.lua b/lua/getchoo/plugins/cmp.lua new file mode 100644 index 0000000..323e342 --- /dev/null +++ b/lua/getchoo/plugins/cmp.lua @@ -0,0 +1,36 @@ +local cmp = require("cmp") +local luasnip = require("luasnip") +local mapping = cmp.mapping + +require("cmp").setup({ + completion = { + completeopt = "menu,menuone,noinsert", + }, + + snippet = { + expand = function(args) + luasnip.lsp_expand(args.body) + end, + }, + + mapping = mapping.preset.insert({ + ["<C-n>"] = mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }), + ["<C-p>"] = mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }), + ["<C-b>"] = mapping.scroll_docs(-4), + ["<C-f>"] = mapping.scroll_docs(4), + ["<C-Space>"] = mapping.complete(), + ["<C-e>"] = mapping.abort(), + ["<CR>"] = mapping.confirm({ select = true }), + ["<S-CR>"] = mapping.confirm({ + behavior = cmp.ConfirmBehavior.Replace, + select = true, + }), + }), + + sources = cmp.config.sources({ + { name = "nvim_lsp" }, + { name = "luasnip" }, + { name = "async_path" }, + { name = "buffer" }, + }), +}) diff --git a/lua/getchoo/plugins/general.lua b/lua/getchoo/plugins/general.lua new file mode 100644 index 0000000..e9806f3 --- /dev/null +++ b/lua/getchoo/plugins/general.lua @@ -0,0 +1,55 @@ +require("getchoo.plugins.bufferline") +require("getchoo.plugins.catppuccin") +require("getchoo.plugins.lualine") +require("getchoo.plugins.neo-tree") + +---- gitsigns +require("gitsigns").setup() + +---- indent-blankline.nvim +require("ibl").setup({ + exclude = { + filetypes = { + "help", + "neo-tree", + "Trouble", + "lazy", + "mason", + "notify", + "toggleterm", + }, + }, + + indent = { + char = "│", + tab_char = "│", + }, + + scope = { enabled = false }, +}) + +---- mini.nvim +require("mini.pairs").setup() +require("mini.indentscope").setup({ + options = { try_as_border = true }, +}) + +vim.api.nvim_create_autocmd("FileType", { + pattern = { + "help", + "neo-tree", + "Trouble", + "lazy", + "mason", + "notify", + "toggleterm", + }, + callback = function() + vim.b.miniindentscope_disable = true + end, +}) + +---- which-key +require("which-key").setup({ + plugins = { spelling = true }, +}) diff --git a/lua/getchoo/plugins/init.lua b/lua/getchoo/plugins/init.lua new file mode 100644 index 0000000..95883c7 --- /dev/null +++ b/lua/getchoo/plugins/init.lua @@ -0,0 +1,3 @@ +require("getchoo.plugins.general") +require("getchoo.plugins.lsp") +require("getchoo.plugins.ui") diff --git a/lua/getchoo/plugins/lsp.lua b/lua/getchoo/plugins/lsp.lua new file mode 100644 index 0000000..7ca1083 --- /dev/null +++ b/lua/getchoo/plugins/lsp.lua @@ -0,0 +1,29 @@ +require("getchoo.plugins.cmp") +require("getchoo.plugins.lspconfig") +require("getchoo.plugins.null-ls") + +require("gitsigns").setup() + +require("fidget").setup() + +require("mini.comment").setup({ + options = { + custom_commentstring = function() + return require("ts_context_commentstring.internal").calculate_commentstring() + or vim.bo.context_commentstring + end, + }, +}) + +require("nvim-treesitter.configs").setup({ + auto_install = false, + highlight = { enable = true }, + indent = { enable = true }, + context_commentstring = { + enable = true, + enable_autocmd = false, + }, +}) + +---- trouble +require("trouble").setup() diff --git a/lua/getchoo/plugins/lspconfig.lua b/lua/getchoo/plugins/lspconfig.lua new file mode 100644 index 0000000..8811e3f --- /dev/null +++ b/lua/getchoo/plugins/lspconfig.lua @@ -0,0 +1,47 @@ +local sources = { + ["bashls"] = "bash-language-server", + ["clangd"] = "clangd", + ["eslint"] = "eslint", + ["nil_ls"] = "nil", + ["pyright"] = "pyright-langserver", + ["rust_analyzer"] = "rust-analyzer", + ["tsserver"] = "typescript-language-server", +} + +local capabilities = vim.tbl_deep_extend( + "force", + require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities()), + { workspace = { didChangeWatchedFiles = { dynamicRegistration = true } } } +) + +local all_config = { + capabilities = capabilities, +} + +local servers = {} +for server, binary in pairs(sources) do + if vim.fn.executable(binary) == 1 then + servers[server] = all_config + end +end + +servers["lua_ls"] = { + capabilities = capabilities, + settings = { + Lua = { + runtime = { + version = "LuaJIT", + }, + diagnostics = { + globals = { "vim" }, + }, + workspace = { + library = vim.api.nvim_get_runtime_file("", true), + }, + }, + }, +} + +for server, settings in pairs(servers) do + require("lspconfig")[server].setup(settings) +end diff --git a/lua/getchoo/plugins/lualine.lua b/lua/getchoo/plugins/lualine.lua new file mode 100644 index 0000000..2727d75 --- /dev/null +++ b/lua/getchoo/plugins/lualine.lua @@ -0,0 +1,6 @@ +require("lualine").setup({ + options = { + theme = "catppuccin", + }, + extensions = { "neo-tree", "trouble" }, +}) diff --git a/lua/getchoo/plugins/neo-tree.lua b/lua/getchoo/plugins/neo-tree.lua new file mode 100644 index 0000000..1d6f7f5 --- /dev/null +++ b/lua/getchoo/plugins/neo-tree.lua @@ -0,0 +1,5 @@ +require("neo-tree").setup({ + filetype_exclude = { "help", "neo-tree", "Trouble", "lazy", "mason", "notify", "toggleterm" }, + show_current_context = false, + show_trailing_blankline_indent = false, +}) diff --git a/lua/getchoo/plugins/null-ls.lua b/lua/getchoo/plugins/null-ls.lua new file mode 100644 index 0000000..a4f86dc --- /dev/null +++ b/lua/getchoo/plugins/null-ls.lua @@ -0,0 +1,49 @@ +local null_ls = require("null-ls") +local diagnostics = null_ls.builtins.diagnostics +local formatting = null_ls.builtins.formatting + +local lsp_formatting = function(bufnr) + vim.lsp.buf.format({ + filter = function(client) + return client.name == "null-ls" + end, + bufnr = bufnr, + }) +end + +local augroup = vim.api.nvim_create_augroup("LspFormatting", {}) + +null_ls.setup({ + on_attach = function(client, bufnr) + if client.supports_method("textDocument/formatting") then + vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr }) + vim.api.nvim_create_autocmd("BufWritePre", { + group = augroup, + buffer = bufnr, + callback = function() + lsp_formatting(bufnr) + end, + }) + end + end, + + sources = { + diagnostics.actionlint, + diagnostics.alex, + diagnostics.codespell, + diagnostics.deadnix, + diagnostics.pylint, + diagnostics.shellcheck, + diagnostics.statix, + formatting.alejandra, + formatting.beautysh, + formatting.codespell, + formatting.just, + formatting.nimpretty, + formatting.prettier, + formatting.rustfmt, + formatting.shellharden, + formatting.stylua, + formatting.yapf, + }, +}) diff --git a/lua/getchoo/plugins/ui.lua b/lua/getchoo/plugins/ui.lua new file mode 100644 index 0000000..7a8c085 --- /dev/null +++ b/lua/getchoo/plugins/ui.lua @@ -0,0 +1,40 @@ +require("dressing") + +vim.ui.select = function(...) + return vim.ui.select(...) +end + +vim.ui.input = function(...) + return vim.ui.input(...) +end + +vim.notify = require("notify") + +require("noice").setup({ + lsp = { + override = { + ["vim.lsp.util.convert_input_to_markdown_lines"] = true, + ["vim.lsp.util.stylize_markdown"] = true, + ["cmp.entry.get_documentation"] = true, + }, + }, + routes = { + { + filter = { + event = "msg_show", + any = { + { find = "%d+L, %d+B" }, + { find = "; after #%d+" }, + { find = "; before #%d+" }, + }, + }, + view = "mini", + }, + }, + presets = { + bottom_search = true, + command_palette = true, + long_message_to_split = true, + inc_rename = true, + }, +}) @@ -1,40 +1,122 @@ -{ - perSystem = {pkgs, ...}: { - neovim = { - package = pkgs.neovim-unwrapped; - - paths = with pkgs; [ - # external tools - fd - git - ripgrep - just - - # lint - actionlint - codespell - deadnix - nodePackages.alex - shellcheck - statix - - # format - alejandra - beautysh - stylua +{self, ...}: { + perSystem = { + lib, + pkgs, + self', + ... + }: let + plugins = with pkgs.vimPlugins; + [ + # general + catppuccin-nvim + + # TODO: don't pin when deprecation notice + # is no longer in nixpkgs + (fidget-nvim.overrideAttrs (_: { + src = pkgs.fetchFromGitHub { + owner = "j-hui"; + repo = "fidget.nvim"; + rev = "41f327b53c7977d47aee56f05e0bdbb4b994c5eb"; + hash = "sha256-v9qARsW8Gozit4Z3+igiemjI467QgRhwM+crqwO9r6U="; + }; + })) + + flash-nvim + gitsigns-nvim + indent-blankline-nvim + lualine-nvim + neo-tree-nvim + nvim-web-devicons + mini-nvim + + # completion + nvim-cmp + cmp-nvim-lsp + cmp-buffer + cmp_luasnip + cmp-async-path + luasnip + + # ui + dressing-nvim + noice-nvim + nui-nvim + nvim-notify # lsp - nil - sumneko-lua-language-server - ]; + nvim-lspconfig + null-ls-nvim + + # utils + bufferline-nvim + plenary-nvim + telescope-nvim + trouble-nvim + which-key-nvim + + # treesitter + nvim-treesitter.withAllGrammars + nvim-ts-context-commentstring + + # main config + self'.packages.getchvim + ] + ++ lib.optional (pkgs ? vim-just) pkgs.vim-just; + + extraPrograms = with pkgs; [ + # external tools + fd + git + ripgrep + just + + # lint + actionlint + codespell + deadnix + nodePackages.alex + shellcheck + statix + + # format + alejandra + beautysh + stylua + + # lsp + nil + sumneko-lua-language-server + ]; + + customRC = '' + lua require("getchoo") + ''; + + config = pkgs.neovimUtils.makeNeovimConfig { + withPython3 = true; + withRuby = false; + inherit plugins; + inherit customRC; + }; + in { + packages = { + default = self'.packages.neovim; + + neovim = pkgs.wrapNeovimUnstable pkgs.neovim-unwrapped ( + config + // { + wrapperArgs = + (lib.escapeShellArgs config.wrapperArgs) + + " " + + ''--suffix PATH : "${lib.makeBinPath extraPrograms}"''; + } + ); - lazy = { - settings = { - performance.rtp.reset = true; - install.colorscheme = ["catppuccin"]; - }; + getchvim = pkgs.vimUtils.buildVimPlugin { + pname = "getchvim"; + version = builtins.substring 0 8 self.lastModifiedDate or "dirty"; - plugins = import ./plugins {inherit pkgs;}; + src = lib.cleanSource ./.; }; }; }; diff --git a/plugins/bufferline.lua b/plugins/bufferline.lua deleted file mode 100644 index 5ec89e5..0000000 --- a/plugins/bufferline.lua +++ /dev/null @@ -1,20 +0,0 @@ -return function() - require("bufferline").setup({ - options = { - always_show_bufferline = false, - highlights = require("catppuccin.groups.integrations.bufferline").get(), - diagnostics = "nvim_lsp", - mode = "buffers", - numbers = "ordinal", - separator_style = "slant", - offsets = { - { - filetype = "neo-tree", - text = "neo-tree", - highlight = "Directory", - text_align = "left", - }, - }, - }, - }) -end diff --git a/plugins/catppuccin.lua b/plugins/catppuccin.lua deleted file mode 100644 index 2679b48..0000000 --- a/plugins/catppuccin.lua +++ /dev/null @@ -1,28 +0,0 @@ -return function() - require("catppuccin").setup({ - compile_path = compile_path, - flavour = "mocha", -- mocha, macchiato, frappe, latte - integrations = { - cmp = true, - flash = true, - gitsigns = true, - indent_blankline = { - enabled = true, - }, - lsp_trouble = true, - native_lsp = { - enabled = true, - }, - neotree = true, - notify = true, - treesitter_context = true, - treesitter = true, - telescope = true, - which_key = true, - }, - - no_italic = true, - }) - - vim.cmd.colorscheme("catppuccin") -end diff --git a/plugins/cmp.lua b/plugins/cmp.lua deleted file mode 100644 index a61dc4a..0000000 --- a/plugins/cmp.lua +++ /dev/null @@ -1,38 +0,0 @@ -return function() - local cmp = require("cmp") - local luasnip = require("luasnip") - local mapping = cmp.mapping - - return { - completion = { - completeopt = "menu,menuone,noinsert", - }, - - snippet = { - expand = function(args) - luasnip.lsp_expand(args.body) - end, - }, - - mapping = mapping.preset.insert({ - ["<C-n>"] = mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }), - ["<C-p>"] = mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }), - ["<C-b>"] = mapping.scroll_docs(-4), - ["<C-f>"] = mapping.scroll_docs(4), - ["<C-Space>"] = mapping.complete(), - ["<C-e>"] = mapping.abort(), - ["<CR>"] = mapping.confirm({ select = true }), - ["<S-CR>"] = mapping.confirm({ - behavior = cmp.ConfirmBehavior.Replace, - select = true, - }), - }), - - sources = cmp.config.sources({ - { name = "nvim_lsp" }, - { name = "luasnip" }, - { name = "async_path" }, - { name = "buffer" }, - }), - } -end diff --git a/plugins/default.nix b/plugins/default.nix deleted file mode 100644 index df6d348..0000000 --- a/plugins/default.nix +++ /dev/null @@ -1,182 +0,0 @@ -{pkgs, ...}: let - inherit (pkgs) vimPlugins; -in rec { - config = { - src = ../config; - lazy = false; - priority = 1000; - }; - - catppuccin-nvim = { - package = vimPlugins.catppuccin-nvim; - - config = ./catppuccin.lua; - }; - - fidget-nvim = { - package = vimPlugins.fidget-nvim.overrideAttrs (_: { - src = pkgs.fetchFromGitHub { - owner = "j-hui"; - repo = "fidget.nvim"; - rev = "41f327b53c7977d47aee56f05e0bdbb4b994c5eb"; - hash = "sha256-v9qARsW8Gozit4Z3+igiemjI467QgRhwM+crqwO9r6U="; - }; - }); - }; - - flash-nvim = { - package = vimPlugins.flash-nvim; - event = "VeryLazy"; - }; - - gitsigns-nvim = { - package = vimPlugins.gitsigns-nvim; - event = ["BufReadPre" "BufNewFile"]; - }; - - ibl = { - package = vimPlugins.indent-blankline-nvim; - - event = ["BufReadPost" "BufNewFile"]; - - config = { - indent = { - char = "│"; - tab_char = "│"; - }; - - exclude.filetypes = [ - "help" - "neo-tree" - "Trouble" - "lazy" - "mason" - "notify" - "toggleterm" - ]; - - scope.enabled = false; - }; - }; - - lualine-nvim = { - package = vimPlugins.lualine-nvim; - - event = "VeryLazy"; - - dependencies = { - nvim-web-devicons.package = vimPlugins.nvim-web-devicons; - }; - - config = ./lualine.lua; - }; - - neo-tree-nvim = { - package = vimPlugins.neo-tree-nvim; - dependencies = { - plenary-nvim.package = vimPlugins.plenary-nvim; - inherit (lualine-nvim.dependencies) nvim-web-devicons; - inherit nui-nvim; - }; - - config = ./neo-tree.lua; - }; - - # TODO: configure mini.pairs, mini.indentscope, & mini.comment - mini-nvim.package = vimPlugins.mini-nvim; - - nvim-cmp = { - package = vimPlugins.nvim-cmp; - dependencies = { - cmp-nvim-lsp.package = vimPlugins.cmp-nvim-lsp; - cmp-buffer.package = vimPlugins.cmp-buffer; - cmp_luasnip.package = vimPlugins.cmp_luasnip; - cmp-async-path.package = vimPlugins.cmp-async-path; - luasnip.package = vimPlugins.luasnip; - }; - - event = "InsertEnter"; - config = ./cmp.lua; - }; - - dressing-nvim = { - package = vimPlugins.dressing-nvim; - lazy = true; - init = ./dressing.lua; - }; - - noice-nvim = { - package = vimPlugins.noice-nvim; - event = "VeryLazy"; - - config = ./noice.lua; - }; - - nui-nvim = { - package = vimPlugins.nui-nvim; - lazy = true; - }; - - nvim-lspconfig = { - package = vimPlugins.nvim-lspconfig; - - event = ["BufReadPre" "BufNewFile"]; - config = ./lspconfig.lua; - }; - - nvim-treesitter = { - package = vimPlugins.nvim-treesitter.withAllGrammars; - dependencies = { - nvim-ts-context-commentstring.package = vimPlugins.nvim-ts-context-commentstring; - }; - - event = ["BufReadPost" "BufNewFile"]; - config = { - auto_install = false; - highlight.enable = true; - indent.enable = true; - context_commentstring = { - enable = true; - enable_autocmd = false; - }; - }; - }; - - null-ls = { - package = vimPlugins.null-ls-nvim; - dependencies = { - inherit (neo-tree-nvim.dependencies) plenary-nvim; - }; - - config = ./null-ls.lua; - }; - - bufferline-nvim = { - package = vimPlugins.bufferline-nvim; - dependencies = { - inherit (lualine-nvim.dependencies) nvim-web-devicons; - inherit catppuccin-nvim; - }; - - config = ./bufferline.lua; - }; - - telescope-nvim.package = vimPlugins.telescope-nvim; - - trouble-nvim = { - package = vimPlugins.trouble-nvim; - dependencies = { - inherit (lualine-nvim.dependencies) nvim-web-devicons; - }; - }; - - which-key-nvim = { - package = vimPlugins.which-key-nvim; - event = "VeryLazy"; - config = { - plugins = { - spelling = true; - }; - }; - }; -} diff --git a/plugins/dressing.lua b/plugins/dressing.lua deleted file mode 100644 index 1f0e70a..0000000 --- a/plugins/dressing.lua +++ /dev/null @@ -1,11 +0,0 @@ -return function() - vim.ui.select = function(...) - require("lazy").load({ plugins = { "dressing-nvim" } }) - return vim.ui.select(...) - end - - vim.ui.input = function(...) - require("lazy").load({ plugins = { "dressing-nvim" } }) - return vim.ui.input(...) - end -end diff --git a/plugins/lspconfig.lua b/plugins/lspconfig.lua deleted file mode 100644 index a17d5ab..0000000 --- a/plugins/lspconfig.lua +++ /dev/null @@ -1,49 +0,0 @@ -return function() - local sources = { - ["bashls"] = "bash-language-server", - ["clangd"] = "clangd", - ["eslint"] = "eslint", - ["nil_ls"] = "nil", - ["pyright"] = "pyright-langserver", - ["rust_analyzer"] = "rust-analyzer", - ["tsserver"] = "typescript-language-server", - } - - local capabilities = vim.tbl_deep_extend( - "force", - require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities()), - { workspace = { didChangeWatchedFiles = { dynamicRegistration = true } } } - ) - - local all_config = { - capabilities = capabilities, - } - - local servers = {} - for server, binary in pairs(sources) do - if vim.fn.executable(binary) == 1 then - servers[server] = all_config - end - end - - servers["lua_ls"] = { - capabilities = capabilities, - settings = { - Lua = { - runtime = { - version = "LuaJIT", - }, - diagnostics = { - globals = { "vim" }, - }, - workspace = { - library = vim.api.nvim_get_runtime_file("", true), - }, - }, - }, - } - - for server, settings in pairs(servers) do - require("lspconfig")[server].setup(settings) - end -end diff --git a/plugins/lualine.lua b/plugins/lualine.lua deleted file mode 100644 index dbf8602..0000000 --- a/plugins/lualine.lua +++ /dev/null @@ -1,8 +0,0 @@ -return function() - require("lualine").setup({ - options = { - theme = "catppuccin", - }, - extensions = { "neo-tree", "trouble" }, - }) -end diff --git a/plugins/neo-tree.lua b/plugins/neo-tree.lua deleted file mode 100644 index 8d690d9..0000000 --- a/plugins/neo-tree.lua +++ /dev/null @@ -1,7 +0,0 @@ -return function() - require("neo-tree").setup({ - filetype_exclude = { "help", "neo-tree", "Trouble", "lazy", "mason", "notify", "toggleterm" }, - show_current_context = false, - show_trailing_blankline_indent = false, - }) -end diff --git a/plugins/noice.lua b/plugins/noice.lua deleted file mode 100644 index ac8879e..0000000 --- a/plugins/noice.lua +++ /dev/null @@ -1,30 +0,0 @@ -return function() - require("noice").setup({ - lsp = { - override = { - ["vim.lsp.util.convert_input_to_markdown_lines"] = true, - ["vim.lsp.util.stylize_markdown"] = true, - ["cmp.entry.get_documentation"] = true, - }, - }, - routes = { - { - filter = { - event = "msg_show", - any = { - { find = "%d+L, %d+B" }, - { find = "; after #%d+" }, - { find = "; before #%d+" }, - }, - }, - view = "mini", - }, - }, - presets = { - bottom_search = true, - command_palette = true, - long_message_to_split = true, - inc_rename = true, - }, - }) -end diff --git a/plugins/null-ls.lua b/plugins/null-ls.lua deleted file mode 100644 index a2a71f1..0000000 --- a/plugins/null-ls.lua +++ /dev/null @@ -1,50 +0,0 @@ -return function() - local null_ls = require("null-ls") - local diagnostics = null_ls.builtins.diagnostics - local formatting = null_ls.builtins.formatting - - local lsp_formatting = function(bufnr) - vim.lsp.buf.format({ - filter = function(client) - return client.name == "null-ls" - end, - bufnr = bufnr, - }) - end - - local augroup = vim.api.nvim_create_augroup("LspFormatting", {}) - - null_ls.setup({ - on_attach = function(client, bufnr) - if client.supports_method("textDocument/formatting") then - vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr }) - vim.api.nvim_create_autocmd("BufWritePre", { - group = augroup, - buffer = bufnr, - callback = function() - lsp_formatting(bufnr) - end, - }) - end - end, - sources = { - diagnostics.actionlint, - diagnostics.alex, - diagnostics.codespell, - diagnostics.deadnix, - diagnostics.pylint, - diagnostics.shellcheck, - diagnostics.statix, - formatting.alejandra, - formatting.beautysh, - formatting.codespell, - formatting.just, - formatting.nimpretty, - formatting.prettier, - formatting.rustfmt, - formatting.shellharden, - formatting.stylua, - formatting.yapf, - }, - }) -end |
