From c1cb314be12c3c4dd5c520c50699d2e5cc292c30 Mon Sep 17 00:00:00 2001 From: DashieTM Date: Wed, 17 Jul 2024 23:33:52 +0200 Subject: [PATCH] Remove nvim-lua --- nix/programs/coding.nix | 5 - nix/programs/nvim/default.nix | 212 -------------- nix/programs/nvim/flake.lock | 58 ---- nix/programs/nvim/flake.nix | 35 --- nix/programs/nvim/ftplugin/java.lua | 5 - nix/programs/nvim/lua/config/autocmds.lua | 15 - nix/programs/nvim/lua/config/keymaps.lua | 202 -------------- nix/programs/nvim/lua/config/lazy.lua | 55 ---- nix/programs/nvim/lua/config/lsp-keymap.lua | 126 --------- nix/programs/nvim/lua/config/options.lua | 34 --- nix/programs/nvim/lua/plugins/cmp.lua | 143 ---------- nix/programs/nvim/lua/plugins/dashboard.lua | 100 ------- nix/programs/nvim/lua/plugins/disabled.lua | 9 - nix/programs/nvim/lua/plugins/lsp.lua | 239 ---------------- nix/programs/nvim/lua/plugins/plugins.lua | 292 -------------------- 15 files changed, 1530 deletions(-) delete mode 100644 nix/programs/nvim/default.nix delete mode 100644 nix/programs/nvim/flake.lock delete mode 100644 nix/programs/nvim/flake.nix delete mode 100644 nix/programs/nvim/ftplugin/java.lua delete mode 100644 nix/programs/nvim/lua/config/autocmds.lua delete mode 100644 nix/programs/nvim/lua/config/keymaps.lua delete mode 100644 nix/programs/nvim/lua/config/lazy.lua delete mode 100644 nix/programs/nvim/lua/config/lsp-keymap.lua delete mode 100644 nix/programs/nvim/lua/config/options.lua delete mode 100644 nix/programs/nvim/lua/plugins/cmp.lua delete mode 100644 nix/programs/nvim/lua/plugins/dashboard.lua delete mode 100644 nix/programs/nvim/lua/plugins/disabled.lua delete mode 100644 nix/programs/nvim/lua/plugins/lsp.lua delete mode 100644 nix/programs/nvim/lua/plugins/plugins.lua diff --git a/nix/programs/coding.nix b/nix/programs/coding.nix index 305439d..5bb53d8 100644 --- a/nix/programs/coding.nix +++ b/nix/programs/coding.nix @@ -4,11 +4,6 @@ , ... }: { - imports = [ - # old neovim config - # (import ./nvim/default.nix { inherit lib pkgs; colorscheme = config.conf.colorscheme; }) - ]; - programs.dashvim = { enable = true; colorscheme = config.conf.colorscheme; diff --git a/nix/programs/nvim/default.nix b/nix/programs/nvim/default.nix deleted file mode 100644 index 43fdc23..0000000 --- a/nix/programs/nvim/default.nix +++ /dev/null @@ -1,212 +0,0 @@ -# please nixvim enable lazyloading -{ lib, pkgs, colorscheme, ... }: -{ - programs.neovim = { - enable = true; - extraPackages = with pkgs; [ - # Telescope - ripgrep - # lua - lua-language-server - stylua - # nix - nixd - # go - gopls - # jafuck - jdt-language-server - taplo - typst-lsp - sqls - shfmt - texlab - nixpkgs-fmt - crate2nix - ruff-lsp - pyright - lemminx - marksman - clang-tools_18 - ]; - - plugins = with pkgs.vimPlugins; [ - lazy-nvim - ]; - - extraLuaConfig = - let - plugins = with pkgs.vimPlugins; [ - # LazyVim - LazyVim - bufferline-nvim - cmp-buffer - cmp-nvim-lsp - cmp-path - cmp_luasnip - cmp-async-path - conform-nvim - dashboard-nvim - dressing-nvim - flash-nvim - friendly-snippets - gitsigns-nvim - git-conflict-nvim - ltex_extra-nvim - indent-blankline-nvim - lualine-nvim - neo-tree-nvim - neoconf-nvim - neodev-nvim - noice-nvim - nui-nvim - nvim-cmp - nvim-dap - nvim-dap-ui - nvim-dap-python - nvim-dap-go - nvim-dap-virtual-text - nvim-nio - nvim-lint - nvim-lspconfig - nvim-notify - #nvim-spectre - nvim-treesitter.withAllGrammars - nvim-treesitter-context - nvim-treesitter-textobjects - nvim-ts-autotag - nvim-ts-context-commentstring - nvim-web-devicons - nvim-jdtls - rustaceanvim - typst-vim - instant-nvim - git-blame-nvim - neoscroll-nvim - mason-nvim - neotest - neotest-zig - neotest-python - neotest-rust - neotest-java - neotest-haskell - neotest-go - neotest-dotnet - neotest-bash - neotest-dart - omnisharp-extended-lsp-nvim - neotest - neotest-java - neotest-rust - persistence-nvim - plenary-nvim - telescope-fzf-native-nvim - telescope-nvim - telescope-zoxide - telescope-file-browser-nvim - telescope-project-nvim - todo-comments-nvim - vimtex - inc-rename-nvim - headlines-nvim - diffview-nvim - crates-nvim - cmake-tools-nvim - clangd_extensions-nvim - alpha-nvim - vim-visual-multi - ts-comments-nvim - nvim-tree-lua - nvim-snippets - markdown-preview-nvim - tokyonight-nvim - trouble-nvim - vim-illuminate - vim-startuptime - which-key-nvim - haskell-tools-nvim - Ionide-vim - { name = "LuaSnip"; path = luasnip; } - { name = "mini.ai"; path = mini-nvim; } - { name = "mini.bufremove"; path = mini-nvim; } - { name = "mini.comment"; path = mini-nvim; } - { name = "mini.indentscope"; path = mini-nvim; } - { name = "mini.pairs"; path = mini-nvim; } - { name = "mini.surround"; path = mini-nvim; } - ]; - mkEntryFromDrv = drv: - if lib.isDerivation drv then - { name = "${lib.getName drv}"; path = drv; } - else - drv; - lazyPath = pkgs.linkFarm "lazy-plugins" (builtins.map mkEntryFromDrv plugins); - in - '' - require("lazy").setup({ - defaults = { - lazy = true, - }, - performance = { - rtp = { - disabled_plugins = { - "gzip", - "netrw", - "tarPlugin", - "tohtml", - "tutor", - "zipPlugin", - }, - }, - }, - dev = { - -- reuse files from pkgs.vimPlugins.* - path = "${lazyPath}", - patterns = { "." }, - -- fallback to download - fallback = true, - }, - spec = { - { "LazyVim/LazyVim", - opts = { - ${if colorscheme != "" then "colorscheme = '${colorscheme}'," else ""} - }, - import = "lazyvim.plugins" }, - { import = "lazyvim.plugins.extras.ui.alpha" }, - { import = "lazyvim.plugins.extras.lang.rust" }, - { import = "lazyvim.plugins.extras.lang.tailwind" }, - { import = "lazyvim.plugins.extras.lang.java" }, - { import = "lazyvim.plugins.extras.lang.go" }, - { import = "lazyvim.plugins.extras.lang.clangd" }, - { import = "lazyvim.plugins.extras.lang.markdown" }, - { import = "lazyvim.plugins.extras.lang.cmake" }, - { import = "lazyvim.plugins.extras.lang.omnisharp" }, - { import = "lazyvim.plugins.extras.lang.tex" }, - { import = "lazyvim.plugins.extras.util.dot" }, - { import = "lazyvim.plugins.extras.dap.core" }, - { import = "lazyvim.plugins.extras.test.core" }, - { "nvim-telescope/telescope-fzf-native.nvim", enabled = true }, - { "williamboman/mason-lspconfig.nvim", enabled = false }, - { import = "plugins" }, - { import = "plugins.plugins" }, - }, - - ${if colorscheme != "" then "install = { colorscheme = { '${colorscheme}' } }," else ""} - checker = { enabled = true, notify = false }, - change_detection = { enabled = true, notify = false }, - }) - ''; - }; - - # https://github.com/nvim-treesitter/nvim-treesitter#i-get-query-error-invalid-node-type-at-position - xdg.configFile."nvim/parser".source = - let - parsers = pkgs.symlinkJoin { - name = "treesitter-parsers"; - paths = (pkgs.vimPlugins.nvim-treesitter.withAllGrammars).dependencies; - }; - in - "${parsers}/parser"; - - # Normal LazyVim config here, see https://github.com/LazyVim/starter/tree/main/lua - xdg.configFile."nvim/lua".source = ./lua; - xdg.configFile."nvim/ftplugin".source = ./ftplugin; -} diff --git a/nix/programs/nvim/flake.lock b/nix/programs/nvim/flake.lock deleted file mode 100644 index 01dcb75..0000000 --- a/nix/programs/nvim/flake.lock +++ /dev/null @@ -1,58 +0,0 @@ -{ - "nodes": { - "flake-parts": { - "inputs": { - "nixpkgs-lib": "nixpkgs-lib" - }, - "locked": { - "lastModified": 1719994518, - "narHash": "sha256-pQMhCCHyQGRzdfAkdJ4cIWiw+JNuWsTX7f0ZYSyz0VY=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "9227223f6d922fee3c7b190b2cc238a99527bbb7", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "flake-parts", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1720542800, - "narHash": "sha256-ZgnNHuKV6h2+fQ5LuqnUaqZey1Lqqt5dTUAiAnqH0QQ=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "feb2849fdeb70028c70d73b848214b00d324a497", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-lib": { - "locked": { - "lastModified": 1719876945, - "narHash": "sha256-Fm2rDDs86sHy0/1jxTOKB1118Q0O3Uc7EC0iXvXKpbI=", - "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/5daf0514482af3f97abaefc78a6606365c9108e2.tar.gz" - }, - "original": { - "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/5daf0514482af3f97abaefc78a6606365c9108e2.tar.gz" - } - }, - "root": { - "inputs": { - "flake-parts": "flake-parts", - "nixpkgs": "nixpkgs" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/nix/programs/nvim/flake.nix b/nix/programs/nvim/flake.nix deleted file mode 100644 index 6b79831..0000000 --- a/nix/programs/nvim/flake.nix +++ /dev/null @@ -1,35 +0,0 @@ -{ - description = "A lazyvim configuration"; - - inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - flake-parts.url = "github:hercules-ci/flake-parts"; - }; - - outputs = - { flake-parts, ... }@inputs: - flake-parts.lib.mkFlake { inherit inputs; } { - systems = [ - "x86_64-linux" - "aarch64-linux" - "x86_64-darwin" - "aarch64-darwin" - ]; - - perSystem = - { pkgs, ... }: - let - colorscheme = "catppuccin-mocha"; - dashieVimModule = { - inherit pkgs colorscheme; - module = import ./default.nix; - nvim = pkgs.neovim; - }; - in - { - packages = { - default = dashieVimModule.nvim; - }; - }; - }; -} diff --git a/nix/programs/nvim/ftplugin/java.lua b/nix/programs/nvim/ftplugin/java.lua deleted file mode 100644 index 1a4f22e..0000000 --- a/nix/programs/nvim/ftplugin/java.lua +++ /dev/null @@ -1,5 +0,0 @@ -local config = { - cmd = { "jdtls" }, - root_dir = vim.fs.dirname(vim.fs.find({ "gradlew", ".git", "mvnw" }, { upward = true })[1]), -} -require("jdtls").start_or_attach(config) diff --git a/nix/programs/nvim/lua/config/autocmds.lua b/nix/programs/nvim/lua/config/autocmds.lua deleted file mode 100644 index e8da00f..0000000 --- a/nix/programs/nvim/lua/config/autocmds.lua +++ /dev/null @@ -1,15 +0,0 @@ --- nvimtree -local function open_nvim_tree(data) - local directory = vim.fn.isdirectory(data.file) == 1 - - if not directory then - return - end - -- change to the directory - vim.cmd.cd(data.file) - - -- open the tree - require("nvim-tree.api").tree.open() -end - -vim.api.nvim_create_autocmd({ "VimEnter" }, { callback = open_nvim_tree }) diff --git a/nix/programs/nvim/lua/config/keymaps.lua b/nix/programs/nvim/lua/config/keymaps.lua deleted file mode 100644 index b325537..0000000 --- a/nix/programs/nvim/lua/config/keymaps.lua +++ /dev/null @@ -1,202 +0,0 @@ -local Util = require("lazyvim.util") - -local function map(mode, lhs, rhs, opts) - local keys = require("lazy.core.handler").handlers.keys - ---@cast keys LazyKeysHandler - -- do not create the map if a lazy keys handler exists - if not keys.active[keys.parse({ lhs, mode = mode }).id] then - opts = opts or {} - opts.silent = opts.silent ~= false - vim.keymap.set(mode, lhs, rhs, opts) - end -end -local opts = { noremap = true, silent = true } -local term_opts = { silent = true } - --- crimes against humanity, but I don't care -map("n", "j", "h", opts) -map("n", "l", "k", opts) -map("n", "k", "j", opts) -map("n", ";", "l", opts) -map("v", "j", "h", opts) -map("v", "k", "j", opts) -map("v", "l", "k", opts) -map("v", ";", "l", opts) - --- test plugin -map("n", "OO", ':lua require("test_plugin").test()', { desc = "Toggle breakpoint" }) - --- debug -map("n", "db", ':lua require("dap").toggle_breakpoint()', { desc = "Toggle breakpoint" }) -map("n", "do", ':lua require("dap").step_over()', { desc = "Step over" }) -map("n", "di", ':lua require("dap").step_into()', { desc = "Step into" }) -map("n", "dc", ':lua require("dap").continue()', { desc = "Continue" }) -map("n", "du", function() - require("dapui").toggle() -end, { desc = "Toggle DAP UI" }) -map("n", "de", function() - require("dapui").eval() -end, { desc = "DAP Eval" }) - --- window movement -map("n", "", [[wincmd h]], opts) -map("n", "", [[wincmd l]], opts) -map("n", "", [[wincmd j]], opts) -map("i", "", [[wincmd h]], opts) -map("i", "", [[wincmd l]], opts) -map("i", "", [[wincmd j]], opts) - --- toggle terminal -local lazyterm = function() - Util.terminal(nil, { cwd = Util.root(), esc_esc = false, ctrl_hjkl = false }) -end -map("n", "", lazyterm, { desc = "Terminal (root dir)" }) -map("t", "", "close", { desc = "Hide Terminal" }) - --- semicolon thing --- map("i","" ,"A;", {desc = "add semi and newline"}) --- map("i","" ,"A;", {desc = "add semi"}) -map("n", "m", "$a;", { desc = "add semi and newline" }) -map("n", "n", "$a;", { desc = "add semi" }) - --- tab switching -map("n", "", ":BufferLineCyclePrev", opts) -map("n", "", ":BufferLineCycleNext", opts) - --- git -map("n", "gq", function() - require("telescope.builtin").git_commits() -end, { desc = "Commits" }) -map("n", "gw", function() - require("telescope.builtin").git_bcommits() -end, { desc = "Commits in branch" }) -map("n", "gb", function() - require("telescope.builtin").git_branches() -end, { desc = "Branches" }) -map("n", "gr", function() - require("telescope.builtin").git_status() -end, { desc = "Git status" }) -map("n", "ga", function() - require("telescope.builtin").git_stash() -end, { desc = "Git stash" }) -map("n", "gg", function() - Util.terminal({ "gitui" }, { cwd = Util.root() }) -end, { desc = "gitui (root dir)" }) -map("n", "gG", function() - Util.terminal({ "gitui" }) -end, { desc = "gitui (cwd)" }) -map("n", "gB", function() - require("gitblame") - vim.cmd(":GitBlameToggle") -end, { desc = "git blame" }) - --- harpoon man -map("n", "h1", function() - require("harpoon.ui").nav_file(1) -end, { desc = "First Harpoon File" }) -map("n", "h2", function() - require("harpoon.ui").nav_file(2) -end, { desc = "Second Harpoon File" }) -map("n", "h3", function() - require("harpoon.ui").nav_file(3) -end, { desc = "First Harpoon File" }) -map("n", "ha", function() - require("harpoon.mark").add_file() -end, { desc = "First Harpoon File" }) -map("n", "hd", function() - require("harpoon.mark").remove_file() -end, { desc = "First Harpoon File" }) -map("n", "hm", ":Telescope harpoon marks", { noremap = true, silent = true, desc = "Show harpoon marks" }) - --- telescope -map("n", "fb", function() - require("telescope").extensions.file_browser.file_browser({}) -end, { desc = "File Browser" }) -map("n", "ff", function() - require("telescope.builtin").find_files() -end, { desc = "Find Files" }) -map("n", "fg", function() - Live_grep_from_project_git_root() -end, { desc = "Live Grep (root)" }) -map("n", "fG", function() - require("telescope.builtin").live_grep() -end, { desc = "Live Grep (cwd)" }) -map("n", "fh", function() - require("telescope.builtin").help_tags() -end, { desc = "Help" }) -map("n", "fp", function() - require("telescope").extensions.project.project({}) -end, { noremap = true, silent = true, desc = "Projects" }) -map("n", "z", function() - require("telescope").extensions.zoxide.list({}) -end, { desc = "Zoxide" }) - --- neoscroll -local t = {} -t[""] = { "scroll", { "-vim.wo.scroll", "true", "250" } } -t[""] = { "scroll", { "vim.wo.scroll", "true", "250" } } -require("neoscroll.config").set_mappings(t) - --- trouble -map("n", "t", "TroubleToggle", term_opts) - --- format -map({ "n", "v" }, "", function() - Util.format({ force = true }) -end, { desc = "Format" }) - --- better yank -function Better_yank(opts) - local current_line = unpack(vim.api.nvim_win_get_cursor(0)) - vim.api.nvim_command(current_line .. "," .. (opts.count - (current_line - 1)) .. "y") -end - -vim.api.nvim_create_user_command("BetterYank", Better_yank, { count = 1 }) -map("n", "by", ":BetterYank", term_opts) - --- better delete -function Better_delete(opts) - local current_line = unpack(vim.api.nvim_win_get_cursor(0)) - vim.api.nvim_command(current_line .. "," .. (opts.count - (current_line - 1)) .. "d") -end - -vim.api.nvim_create_user_command("BetterDelete", Better_delete, { count = 1 }) -map("n", "bd", ":BetterDelete", term_opts) - --- neovide zoom -local change_scale_factor = function(delta) - vim.g.neovide_scale_factor = vim.g.neovide_scale_factor * delta -end -vim.keymap.set("n", "", function() - change_scale_factor(1.25) -end) -vim.keymap.set("n", "", function() - change_scale_factor(1 / 1.25) -end) - --- neovide paste -vim.g.neovide_input_use_logo = 1 -vim.api.nvim_set_keymap("i", "", "pI", { noremap = true, silent = true }) - -function Get_git_root() - local opts = {} - local function is_git_repo() - vim.fn.system("git rev-parse --is-inside-work-tree") - - return vim.v.shell_error == 0 - end - if is_git_repo() then - local dot_git_path = vim.fn.finddir(".git", ".;") - local root = vim.fn.fnamemodify(dot_git_path, ":h") - opts = { - cwd = root, - } - end - return opts -end - -function Live_grep_from_project_git_root() - local opts = Get_git_root() - require("telescope.builtin").live_grep(opts) -end - diff --git a/nix/programs/nvim/lua/config/lazy.lua b/nix/programs/nvim/lua/config/lazy.lua deleted file mode 100644 index de32dd1..0000000 --- a/nix/programs/nvim/lua/config/lazy.lua +++ /dev/null @@ -1,55 +0,0 @@ -local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not vim.loop.fs_stat(lazypath) then - vim.fn.system({ - "git", - "clone", - "--filter=blob:none", - "https://github.com/folke/lazy.nvim.git", - "--branch=stable", - lazypath, - }) -end -vim.opt.rtp:prepend(vim.env.LAZY or lazypath) - -require("lazy").setup({ - spec = { - { "LazyVim/LazyVim", import = "lazyvim.plugins" }, - { import = "lazyvim.plugins.extras.ui.alpha" }, - -- { import = "lazyvim.plugins.extras.ui.edgy" }, - { import = "plugins" }, - { import = "plugins.plugins" }, - { import = "lazyvim.plugins.extras.lang.rust" }, - { import = "lazyvim.plugins.extras.lang.tailwind" }, - { import = "lazyvim.plugins.extras.lang.java" }, - { import = "lazyvim.plugins.extras.lang.go" }, - { import = "lazyvim.plugins.extras.lang.clangd" }, - { import = "lazyvim.plugins.extras.lang.typescript" }, - { import = "lazyvim.plugins.extras.lang.python" }, - { import = "lazyvim.plugins.extras.lang.markdown" }, - { import = "lazyvim.plugins.extras.lang.cmake" }, - { import = "lazyvim.plugins.extras.lang.omnisharp" }, - { import = "lazyvim.plugins.extras.lang.json" }, - { import = "lazyvim.plugins.extras.lang.tex" }, - { import = "lazyvim.plugins.extras.util.dot" }, - { import = "lazyvim.plugins.extras.dap.core" }, - { import = "lazyvim.plugins.extras.test.core" }, - }, - defaults = { - lazy = true, - version = false, - }, - checker = { enabled = true, notify = false }, - change_detection = { enabled = true, notify = false }, - performance = { - rtp = { - disabled_plugins = { - "gzip", - "netrw", - "tarPlugin", - "tohtml", - "tutor", - "zipPlugin", - }, - }, - }, -}) diff --git a/nix/programs/nvim/lua/config/lsp-keymap.lua b/nix/programs/nvim/lua/config/lsp-keymap.lua deleted file mode 100644 index df316e9..0000000 --- a/nix/programs/nvim/lua/config/lsp-keymap.lua +++ /dev/null @@ -1,126 +0,0 @@ -local M = {} - ----@type PluginLspKeys -M._keys = nil - ----@return (LazyKeys|{has?:string})[] -function M.get() - local format = function() - require("lazyvim.util").format({ force = true }) - end - if not M._keys then - ---@class PluginLspKeys - M._keys = { - { "cld", vim.diagnostic.open_float, desc = "Line Diagnostics" }, - { "cl", "LspInfo", desc = "Lsp Info" }, - { "ca", "Telescope lsp_definitions", desc = "Goto Definition", has = "definition" }, - { "cs", "Telescope lsp_references", desc = "References" }, - { "cA", vim.lsp.buf.declaration, desc = "Goto Declaration" }, - { "cf", "Telescope lsp_implementations", desc = "Goto Implementation" }, - { "cd", "Telescope lsp_type_definitions", desc = "Goto Type Definition" }, - { "ce", vim.lsp.buf.hover, desc = "Hover" }, - { "cw", vim.lsp.buf.signature_help, desc = "Signature Help", has = "signatureHelp" }, - { "", vim.lsp.buf.signature_help, mode = "i", desc = "Signature Help", has = "signatureHelp" }, - { "]d", M.diagnostic_goto(true), desc = "Next Diagnostic" }, - { "[d", M.diagnostic_goto(false), desc = "Prev Diagnostic" }, - { "]e", M.diagnostic_goto(true, "ERROR"), desc = "Next Error" }, - { "[e", M.diagnostic_goto(false, "ERROR"), desc = "Prev Error" }, - { "]w", M.diagnostic_goto(true, "WARN"), desc = "Next Warning" }, - { "[w", M.diagnostic_goto(false, "WARN"), desc = "Prev Warning" }, - { "", format, desc = "Format Range", mode = "v", has = "documentRangeFormatting" }, - { "cr", ":IncRename ", desc = "Rename", has = "rename" }, - { - "cq", - function() - vim.lsp.buf.code_action({ - context = { - only = { - "quickfix", - "quickfix.ltex", - "source", - "source.fixAll", - "source.organizeImports", - "", - }, - }, - }) - end, - desc = "Fix", - mode = { "n", "v" }, - has = "codeAction", - }, - { - "cQ", - function() - vim.lsp.buf.code_action({ - context = { - only = { - "refactor", - "refactor.inline", - "refactor.extract", - "refactor.rewrite", - }, - }, - }) - end, - desc = "Refactor", - mode = { "n", "v" }, - has = "codeAction", - }, - } - end - return M._keys -end - ----@param method string -function M.has(buffer, method) - method = method:find("/") and method or "textDocument/" .. method - local clients = require("lazyvim.util").lsp.get_clients({ bufnr = buffer }) - for _, client in ipairs(clients) do - if client.supports_method(method) then - return true - end - end - return false -end - ----@return (LazyKeys|{has?:string})[] -function M.resolve(buffer) - local Keys = require("lazy.core.handler.keys") - if not Keys.resolve then - return {} - end - local spec = M.get() - local opts = require("lazyvim.util").opts("nvim-lspconfig") - local clients = require("lazyvim.util").lsp.get_clients({ bufnr = buffer }) - for _, client in ipairs(clients) do - local maps = opts.servers[client.name] and opts.servers[client.name].keys or {} - vim.list_extend(spec, maps) - end - return Keys.resolve(spec) -end - -function M.on_attach(_, buffer) - local Keys = require("lazy.core.handler.keys") - local keymaps = M.resolve(buffer) - - for _, keys in pairs(keymaps) do - if not keys.has or M.has(buffer, keys.has) then - local opts = Keys.opts(keys) - opts.has = nil - opts.silent = opts.silent ~= false - opts.buffer = buffer - vim.keymap.set(keys.mode or "n", keys.lhs, keys.rhs, opts) - end - end -end - -function M.diagnostic_goto(next, severity) - local go = next and vim.diagnostic.goto_next or vim.diagnostic.goto_prev - severity = severity and vim.diagnostic.severity[severity] or nil - return function() - go({ severity = severity }) - end -end - -return M diff --git a/nix/programs/nvim/lua/config/options.lua b/nix/programs/nvim/lua/config/options.lua deleted file mode 100644 index 7f5ec59..0000000 --- a/nix/programs/nvim/lua/config/options.lua +++ /dev/null @@ -1,34 +0,0 @@ --- Options are automatically loaded before lazy.nvim startup --- Default options that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/options.lua --- Add any additional options here -local options = { - fileencoding = "utf-8", - number = true, - showmode = true, - termguicolors = true, - spelllang = "en_us", - shell = "fish", - relativenumber = false, - scrolloff = 5, - scrolljump = 5, - wrap = false, -} -vim.filetype.add({ - extension = { - typst = "typst", - typ = "typst", - }, -}) -vim.o.guifont = "JetBrainsMono Nerd Font:h14" -vim.g.neovide_refresh_rate_idle = 180 -vim.g.neovide_refresh_rate_idle = 5 -vim.g.neovide_hide_mouse_when_typing = true -vim.g.mkdp_browser = "/usr/bin/firefox" -vim.g.mkdp_auto_start = 1 -vim.g.loaded_netrw = 1 -vim.g.loaded_netrwPlugin = 1 -vim.g.autoformat = false - -for k, v in pairs(options) do - vim.opt[k] = v -end diff --git a/nix/programs/nvim/lua/plugins/cmp.lua b/nix/programs/nvim/lua/plugins/cmp.lua deleted file mode 100644 index 4b4d467..0000000 --- a/nix/programs/nvim/lua/plugins/cmp.lua +++ /dev/null @@ -1,143 +0,0 @@ -return { - { - "L3MON4D3/LuaSnip", - build = (not jit.os:find("Windows")) - and "echo -e 'NOTE: jsregexp is optional, so not a big deal if it fails to build\n'; make install_jsregexp" - or nil, - dependencies = { - "rafamadriz/friendly-snippets", - config = function() - require("luasnip.loaders.from_vscode").lazy_load() - end, - }, - opts = { - history = true, - delete_check_events = "TextChanged", - updateevents = "TextChanged,TextChangedI", - enable_autosnippets = true, - }, - keys = function() - return {} - end, - config = function(_, opts) - require("luasnip").setup(opts) - end, - }, - { - "hrsh7th/nvim-cmp", - version = false, - event = "InsertEnter", - dependencies = { - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-buffer", - "FelipeLema/cmp-async-path", - "saadparwaiz1/cmp_luasnip", - "Saecki/crates.nvim", - }, - opts = function() - vim.api.nvim_set_hl(0, "CmpGhostText", { link = "Comment", default = true }) - local cmp = require("cmp") - local defaults = require("cmp.config.default")() - local luasnip = require("luasnip") - local compare = require("cmp.config.compare") - return { - preselect = cmp.PreselectMode.None, - completion = { - -- completeopt = "menu,menuone,noinsert", - }, - snippet = { - expand = function(args) - luasnip.lsp_expand(args.body) - end, - }, - mapping = { - [""] = cmp.mapping.scroll_docs(-4), - [""] = cmp.mapping.scroll_docs(4), - [""] = cmp.mapping.complete(), - [""] = cmp.mapping.abort(), - [""] = cmp.mapping.confirm({ select = false }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. - [""] = cmp.mapping.confirm({ - behavior = cmp.ConfirmBehavior.Replace, - select = false, - }), -- Accept cur - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item({ behavior = cmp.SelectBehavior.Insert }) - else - fallback() - end - end, { "i", "s" }), - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item({ behavior = cmp.SelectBehavior.Insert }) - else - fallback() - end - end, { - "i", - "s", - }), - [""] = cmp.mapping(function(fallback) - if luasnip.expandable() then - luasnip.expand() - elseif luasnip.expand_or_jumpable() then - luasnip.expand_or_jump() - else - fallback() - end - end, { - "i", - "s", - }), - [""] = cmp.mapping(function(fallback) - if luasnip.expand_or_jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, { - "i", - "s", - }), - }, - sources = cmp.config.sources({ - { name = "nvim_lsp", priority = 99 }, - { name = "luasnip", priority = 3, max_item_count = 3 }, - { name = "buffer", priority = 2, max_item_count = 2, keyword_length = 5 }, - { name = "async_path", priority = 1, max_item_count = 2, keyword_length = 3, trigger_characters = {} }, - { name = "crates" }, - }), - sorting = { - priority_weight = 90, - comparators = { - compare.exact, - compare.score, - compare.offset, - compare.kind, - }, - }, - formatting = { - preselect = cmp.PreselectMode.None, - format = function(entry, item) - local icons = require("lazyvim.config").icons.kinds - if icons[item.kind] then - item.kind = icons[item.kind] .. item.kind - end - return require("tailwindcss-colorizer-cmp").formatter(entry, item) - end, - }, - experimental = { - ghost_text = { - hl_group = "CmpGhostText", - }, - }, - } - end, - config = function(_, opts) - local cmp = require("cmp") - require("luasnip.loaders.from_lua").load({ paths = "~/.config/nvim/snippets" }) - cmp.setup(opts) - end, - }, -} - diff --git a/nix/programs/nvim/lua/plugins/dashboard.lua b/nix/programs/nvim/lua/plugins/dashboard.lua deleted file mode 100644 index 82715ad..0000000 --- a/nix/programs/nvim/lua/plugins/dashboard.lua +++ /dev/null @@ -1,100 +0,0 @@ -return { - { - "goolord/alpha-nvim", - event = "VimEnter", - opts = function() - local alpha = require("alpha") - local dashboard = require("alpha.themes.dashboard") - dashboard.section.header.val = { - [[ _______ ___ _______. __ __ __ _______ ]], - [[| \ / \ / || | | | | | | ____|]], - [[| .--. | / ^ \ | (----`| |__| | | | | |__ ]], - [[| | | | / /_\ \ \ \ | __ | | | | __| ]], - [[| '--' | / _____ \ .----) | | | | | | | | |____ ]], - [[|_______/ /__/ \__\ |_______/ |__| |__| |__| |_______|]], - [[ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⢤⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ]], - [[ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠪⣍⣒⠒⠦⠤⠤⠤⠄⠠⡜⡐⠁⠪⡢⡀⠀⠀⠀⠀⠀⠀⠀⠀⣀⠤⢄⠀⠀⠀⠀⠀⠀⠀ ]], - [[ ⠀⠀⠀⠈⠛⠯⣉⠁⣐⣂⠐⠮⠥⠟⣓⣲⣾⣿⣿⣿⣶⡃⠀⠀⠈⢞⢆⠀⠀⠀⠀⠀⠀⡰⢁⠂⠄⣇⠀⠀⠀⠀⠀⠀ ]], - [[ ⠀⠀⠀⠀⣠⠤⠤⠭⠷⠎⡡⠔⠒⠘⠀⢹⣿⣿⣿⣿⣿⠀⠈⠀⠀⠀⢢⢣⠀⠀⠀⠀⢀⡇⠈⠀⢰⢰⠀⠀⠀⠀⠀⠀ ]], - [[ ⠀⠀⠀⢸⢰⠀⠀⠀⡩⢋⣀⣤⣤⣤⣤⣤⣿⣿⠟⠿⣿⡀⠀⠀⠀⠀⠀⠆⢳⠀⠀⠀⢸⠀⠂⠀⠀⡈⡆⠀⠀⠀⠀⠀ ]], - [[ ⠀⠀⠀⠀⢣⢂⠀⠮⡪⠛⠉⢋⠝⠻⢿⢿⡿⢁⠔⢋⣸⠇⠀⠀⠀⠀⠀⡘⣆⢣⠀⠀⡼⠀⠀⠀⠀⡇⣇⠀⠀⠀⠀⠀ ]], - [[ ⠀⠀⠀⠀⠀⡣⢲⡊⠀⠀⠀⠀⠀⡴⠃⣼⠡⢪⠔⠋⠀⠀⠀⢀⠀⠀⠀⢸⣿⡄⢆⠀⡇⠀⠀⠀⠀⠁⢸⠀⠀⠀⠀⠀ ]], - [[ ⠀⠀⠀⠀⢰⢡⡇⠀⠀⢀⠔⠠⠊⣰⠞⡇⢠⠃⠀⣠⣶⣿⣷⣷⣷⠄⠀⠈⡟⣷⡸⡄⡇⠀⠀⠀⠀⠀⢸⠀⠀⠀⠀⠀ ]], - [[ ⠀⠀⠀⠀⡇⣾⠀⣀⠔⣁⣤⣦⢺⣿⡆⡆⡃⠀⢨⠃⢸⣿⣿⣿⠏⠀⠠⢀⢠⣿⡇⣧⡇⠀⠀⠀⠀⠀⢸⣆⢔⡲⡆⠀ ]], - [[ ⠀⠀⣠⠞⠼⠧⢙⡒⣾⣿⣿⡷⡘⣟⣷⣜⡃⠀⡼⠀⠀⠷⠗⠋⠀⠀⠀⢀⡟⣿⣿⢀⠓⠀⠀⠀⠀⠀⢸⢋⠊⠀⡇⠀ ]], - [[ ⠘⠛⠒⠒⠉⠉⠁⡇⣿⣽⣿⡇⠈⢹⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡀⣠⠟⠀⣷⣿⣇⠱⡀⠀⠀⠀⡄⢀⠃⠀⡄⡇⠀ ]], - [[ ⠀⠀⠀⠀⠀⠀⠀⡇⢸⣏⢀⣧⠀⠈⠆⠀⠀⠀⠀⠀⠀⠀⠀⡠⢊⡴⡟⠀⡼⢁⢸⡙⣠⠁⠀⠀⠀⢇⠆⠀⢀⢳⡇⠀ ]], - [[ ⠀⠀⠀⠀⠀⠀⠀⢳⢀⣵⢸⣯⣷⣤⣀⠀⠀⠀⠀⠀⢀⣐⠮⠔⡎⠘⠀⠈⢀⢮⣿⣷⠁⠇⠠⠀⢰⠎⠀⠀⡘⣸⠀⠀ ]], - [[ ⠀⠀⠀⠀⠀⠀⢀⠎⢬⢘⣯⠛⢻⠏⣿⣿⣶⣶⡶⠋⠉⠀⠀⢸⠀⠀⡔⠀⣪⣿⣿⢻⠀⠸⠈⡇⠛⠀⠠⢀⢃⡇⠀⠀ ]], - [[ ⠀⠀⠀⠀⠀⠈⡹⡡⣪⡏⠛⠀⠀⢠⡟⢻⣿⣿⡇⠀⠀⠀⠀⢼⡆⠠⡇⢰⣿⣿⣿⣻⡄⠀⡆⠁⠀⣠⠃⠌⠼⠤⠤⡀ ]], - [[ ⠀⠀⠀⣀⡠⢞⣳⣽⢸⡇⠀⡇⠀⠸⠀⣼⣿⣿⡇⠀⠀⠀⠀⠈⡇⣰⠃⣶⡍⣼⣿⣏⠃⠀⠁⢠⠊⣀⣜⠤⠐⢂⢆⠇ ]], - [[ ⠀⠀⠈⠉⠉⠁⠀⢇⢸⡟⠀⡇⠀⡇⢸⢷⣹⣿⡇⠀⠀⠀⠀⠀⢳⡽⠃⡞⣇⣿⣧⣿⠀⠀⢸⠃⢠⠃⠀⢀⠤⢢⠞⠀ ]], - [[ ⠀⠀⠀⠀⠀⠀⠀⢸⡀⡇⠀⠁⢠⠁⣿⠈⣿⣿⠇⠀⠀⠀⠀⠀⠀⠁⡆⡇⣾⠿⣹⣿⠀⠀⠃⡰⠃⡰⢔⣡⠞⠁⠀⠀ ]], - [[ ⠀⠀⠀⠀⠀⠀⠀⠀⢇⢠⠀⠂⡌⠀⢽⠁⣟⡟⠀⠀⠀⠀⠀⠀⠀⠀⣇⢶⢹⣤⣿⠇⠀⣀⣈⠝⡱⠒⠉⠀⠀⠀⠀⠀ ]], - [[ ⠀⠀⠀⠀⠀⠀⠀⠀⠈⣎⡄⠀⡷⠀⢸⠀⢹⠇⠀⠀⠀⠀⠀⠀⠀⠀⠫⣼⣾⣿⢋⠤⠤⠥⢆⡞⠀⠀⠀⠀⠀⠀⠀⠀ ]], - [[ ⠀⠀⠀⠀⠀⠀⠀⠀⢀⢫⣡⢸⠎⢃⢘⠀⢈⡄⠀⠀⠀⠀⠀⠀⠀⠀⢀⡽⣽⢀⡋⠉⠑⠉⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀ ]], - [[ ⠀⠀⠀⠀⠀⠀⠀⠀⠘⠉⠳⡯⣇⢆⠻⣆⠈⣤⠀⠀⠀⠀⣀⡀⠤⢚⡨⠷⣝⠗⠑⢄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ]], - [[ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠫⣗⠳⡜⠵⠀⡍⡥⠤⠤⠤⠄⠒⠉⠀⠀⠀⠉⠉⠉⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ]], - [[ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⠫⡆⣇⠇⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ]], - [[ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢰⡙⡰⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ]], - [[ ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣦⠞⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ]], - } - dashboard.section.buttons.val = { - dashboard.button("f", " Find file", ":lua require('telescope.builtin').find_files()"), - dashboard.button("y", " Yazi", ":lua require('yazi').yazi()"), - dashboard.button("p", " Find project", ":lua require('telescope').extensions.project.project{}"), - dashboard.button("t", " Zoxide", ":lua require('telescope').extensions.zoxide.list{}"), - dashboard.button("c", " Configuration", ":e ~/.config/nvim/init.lua "), - dashboard.button("q", " Quit Neovim", ":qa"), - } - - local function footer() - return "dashie@dashie.org" - end - - dashboard.section.footer.val = footer() - - dashboard.section.footer.opts.hl = "Type" - dashboard.section.header.opts.hl = "Include" - dashboard.section.buttons.opts.hl = "Keyword" - - dashboard.opts.opts.noautocmd = true - - -- alpha.pad_margin(dashboard.section.header.val, dashboard.opts , 0, 0) - alpha.setup(dashboard.opts) - end, - config = function(_, dashboard) - -- close Lazy and re-open when the dashboard is ready - if vim.o.filetype == "lazy" then - vim.cmd.close() - vim.api.nvim_create_autocmd("User", { - pattern = "AlphaReady", - callback = function() - require("lazy").show() - end, - }) - end - - require("alpha").setup({ - layout = { - { type = "padding", val = 1 }, - dashboard.section.header, - { type = "padding", val = 1 }, - dashboard.section.buttons, - { type = "padding", val = 1 }, - dashboard.section.footer, - }, - }) - - vim.api.nvim_create_autocmd("User", { - pattern = "LazyVimStarted", - callback = function() - local stats = require("lazy").stats() - local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100) - dashboard.section.footer.val = "⚡ Neovim loaded " .. stats.count .. " plugins in " .. ms .. "ms" - pcall(vim.cmd.AlphaRedraw) - end, - }) - end, - }, -} diff --git a/nix/programs/nvim/lua/plugins/disabled.lua b/nix/programs/nvim/lua/plugins/disabled.lua deleted file mode 100644 index 76dc307..0000000 --- a/nix/programs/nvim/lua/plugins/disabled.lua +++ /dev/null @@ -1,9 +0,0 @@ -return { - { - { "rcarriga/nvim-notify", enabled = false }, - }, - { { "folke/noice.nvim", enabled = false } }, - { { "nvimtools/none-ls.nvim", enabled = false } }, - { { "nvimdev/dashboard-nvim", enabled = false } }, - { { "nvim-neo-tree/neo-tree.nvim", enabled = false } }, -} diff --git a/nix/programs/nvim/lua/plugins/lsp.lua b/nix/programs/nvim/lua/plugins/lsp.lua deleted file mode 100644 index 984fdd1..0000000 --- a/nix/programs/nvim/lua/plugins/lsp.lua +++ /dev/null @@ -1,239 +0,0 @@ -return { - { - "williamboman/mason.nvim", - }, - { - "neovim/nvim-lspconfig", - ---@class PluginLspOpts - opts = function(_, opts) - local path = vim.fn.stdpath("config") .. "/spell/ltex.dictionary.en-US.txt" - local words = {} - - local file, err = io.open(path, "r") - if err ~= nil then - os.execute("mkdir " .. vim.fn.stdpath("config") .. "/spell") - file = io.open(path, "w") - file:write("") - file:close() - file = io.open(path, "r") - end - for word in file:lines() do - table.insert(words, word) - end - local new_opts = { - format_notify = false, - -- LSP Server Settings - ---@type lspconfig.options - servers = { - marksman = { - mason = false, - }, - clangd = { - mason = false, - }, - jdtls = { - mason = false, - }, - gopls = { - mason = false, - }, - pyright = { - mason = false, - }, - ruff_lsp = { - mason = false, - }, - texlab = { - mason = false, - }, - taplo = { - keys = { - { - "K", - function() - if vim.fn.expand("%:t") == "Cargo.toml" and require("crates").popup_available() then - require("crates").show_popup() - else - vim.lsp.buf.hover() - end - end, - desc = "Show Crate Documentation", - }, - }, - mason = false, - }, - bashls = { - mason = false, - }, - ansiblels = { - mason = false, - }, - omnisharp = { - mason = false, - handlers = { - ["textDocument/definition"] = function(...) - return require("omnisharp_extended").handler(...) - end, - }, - keys = { - { - "oe", - function() - require("omnisharp_extended").telescope_lsp_definitions() - end, - desc = "Goto Definition", - }, - }, - cmd = { - -- no comment - "OmniSharp", - "-z", - "--hostPID", - tostring(vim.fn.getpid()), - "DotNet:enablePackageRestore=false", - "--encoding", - "utf-8", - "--languageserver", - "FormattingOptions:EnableEditorConfigSupport=true", - "FormattingOptions:OrganizeImports=true", - "RoslynExtensionsOptions:EnableAnalyzersSupport=true", - "RoslynExtensionsOptions:EnableImportCompletion=true", - -- inlay hints are bugged until next release..... - -- "RoslynExtensionsOptions:InlayHintsOptions:EnableForParameters=true", - -- "RoslynExtensionsOptions:InlayHintsOptions:ForLiteralParameters=true", - -- "RoslynExtensionsOptions:InlayHintsOptions:ForIndexerParameters=true", - -- "RoslynExtensionsOptions:InlayHintsOptions:ForObjectCreationParameters=true", - -- "RoslynExtensionsOptions:InlayHintsOptions:ForOtherParameters=true", - -- "RoslynExtensionsOptions:InlayHintsOptions:SuppressForParametersThatDifferOnlyBySuffix=false", - -- "RoslynExtensionsOptions:InlayHintsOptions:SuppressForParametersThatMatchMethodIntent=false", - -- "RoslynExtensionsOptions:InlayHintsOptions:SuppressForParametersThatMatchArgumentName=false", - -- "RoslynExtensionsOptions:InlayHintsOptions:EnableForTypes=true", - -- "RoslynExtensionsOptions:InlayHintsOptions:ForImplicitVariableTypes=true", - -- "RoslynExtensionsOptions:InlayHintsOptions:ForLambdaParameterTypes=true", - -- "RoslynExtensionsOptions:InlayHintsOptions:ForImplicitObjectCreation=true", - "Sdk:IncludePrereleases=true", - }, - }, - tinymist = { - settings = { - formatterMode = "typstyle", - exportPdf = "onSave", - }, - mason = false, - }, - nixd = { - settings = { - ["nixd"] = { - formatting = { - command = { "nixpkgs-fmt" }, - }, - }, - }, - mason = false, - }, - ltex = { - settings = { - ltex = { - checkFrequency = "save", - dictionary = { - ["en-US"] = words, - }, - }, - }, - filetypes = { - "bib", - "gitcommit", - "markdown", - "org", - "plaintex", - "rst", - "rnoweb", - "tex", - "pandoc", - "typst", - "typ", - "text", - }, - mason = false, - }, - sqls = { - mason = false, - }, - lemminx = { - mason = false, - }, - opencl_ls = { - mason = false, - }, - yamlls = { - mason = false, - }, - zls = { - mason = false, - }, - jsonls = { - mason = false, - cmd = { "vscode-json-languageserver", "--stdio" }, - }, - cssls = { - mason = false, - cmd = { "css-languageserver", "--stdio" }, - }, - lua_ls = { - mason = false, - { - Lua = { - workspace = { - checkThirdParty = false, - }, - completion = { - callSnippet = "Replace", - }, - }, - }, - }, - }, - } - return vim.tbl_deep_extend("keep", new_opts, opts) - end, - init = function() - local keys = require("lazyvim.plugins.lsp.keymaps").get() - local my_keys = require("config.lsp-keymap").get() - local count = 0 - for _ in pairs(my_keys) do - keys[#keys + 1] = my_keys[count] - count = count + 1 - end - end, - }, - { - "stevearc/conform.nvim", - opts = { - keys = { - { - "cF", - function() - require("conform").format({ async = true, lsp_fallback = true }) - end, - mode = "", - numberdesc = "Format buffer", - }, - }, - formatters = { - mdformat = { - prepend_args = { "--number" }, - }, - }, - formatters_by_ft = { - nix = { "nixpkgs-fmt" }, - lua = { "stylua" }, - sh = { "shfmt" }, - cs = { "dotnet-csharpier" }, - markdown = { "mdformat" }, - sql = { "sql-formatter" }, - json = { "jq" }, - yaml = { "yamlfmt" }, - }, - }, - }, -} diff --git a/nix/programs/nvim/lua/plugins/plugins.lua b/nix/programs/nvim/lua/plugins/plugins.lua deleted file mode 100644 index 833d72f..0000000 --- a/nix/programs/nvim/lua/plugins/plugins.lua +++ /dev/null @@ -1,292 +0,0 @@ -return { - { - "nvim-telescope/telescope.nvim", - cmd = "Telescope", - keys = function() - return {} - end, - opts = { - defaults = { - layout_strategy = "flex", - layout_config = { - flex = { - height = 0.95, - width = 0.95, - flip_columns = 100, - }, - vertical = { preview_height = 0.5, preview_cutoff = 5 }, - horizontal = { preview_width = 0.7, preview_cutoff = 99 }, - }, - }, - }, - }, - { - "nvim-telescope/telescope-project.nvim", - lazy = true, - }, - { - "nvim-telescope/telescope-file-browser.nvim", - lazy = true, - config = function() - require("telescope").load_extension("file_browser") - end, - }, - { - "jvgrootveld/telescope-zoxide", - lazy = true, - config = function() - local z_utils = require("telescope._extensions.zoxide.utils") - local t = require("telescope") - -- Configure the extension - t.setup({ - extensions = { - zoxide = { - prompt_title = "[ Queries ]", - mappings = { - default = { - after_action = function(selection) - print("Update to (" .. selection.z_score .. ") " .. selection.path) - end, - }, - [""] = { - before_action = function(selection) - print("before C-s") - end, - action = function(selection) - vim.cmd("edit " .. selection.path) - end, - }, - [""] = { action = z_utils.create_basic_command("split") }, - }, - }, - }, - }) - - -- Load the extension - t.load_extension("zoxide") - end, - }, - { - "lervag/vimtex", - config = function() - vim.cmd("let g:vimtex_quickfix_mode=0") - vim.cmd("let g:vimtex_view_general_viewer = 'evince'") - vim.cmd("let g:vimtex_compiler_method = 'latexmk'") - vim.cmd( - "let g:vimtex_compiler_latexmk = {'options': ['-pdf', '-shell-escape', '-file-line-error', '--extra-mem-bot=10000000', '-synctex=1', '-interaction=nonstopmode',],}" - ) - end, - }, - { - "jbyuki/instant.nvim", - config = function() - vim.cmd("let g:instant_username = 'dashie'") - end, - }, - { - "nvim-treesitter/nvim-treesitter", - config = function(_, _) - local opts = { - ensure_installed = {}, - -- parser_install_dir = "~/.config/nvim", - textobjects = { - select = { - enable = true, - lookahead = true, - keymaps = { - -- You can use the capture groups defined in textobjects.scm - ["af"] = "@function.outer", - ["if"] = "@function.inner", - ["ac"] = "@class.outer", - ["ic"] = "@class.inner", - }, - }, - }, - } - require("nvim-treesitter.configs").setup(opts) - end, - }, - { - "karb94/neoscroll.nvim", - config = function() - require("neoscroll").setup() - end, - }, - { - "kaarmu/typst.vim", - lazy = true, - event = "FileType typst", - }, - { - "folke/which-key.nvim", - event = "VeryLazy", - opts = { - plugins = { spelling = true }, - defaults = { - mode = { "n", "v" }, - ["g"] = { name = "+goto" }, - ["gz"] = { name = "+surround" }, - ["]"] = { name = "+next" }, - ["["] = { name = "+prev" }, - [""] = { name = "+tabs" }, - ["b"] = { name = "+buffer" }, - ["c"] = { name = "+code" }, - ["f"] = { name = "+file/find" }, - ["g"] = { name = "+git" }, - ["gh"] = { name = "+hunks" }, - ["q"] = { name = "+quit/session" }, - ["s"] = { name = "+search" }, - ["u"] = { name = "+ui" }, - ["w"] = { name = "+windows" }, - ["x"] = { name = "+diagnostics/quickfix" }, - ["h"] = { name = "+harpoon" }, - ["d"] = { name = "+DAP" }, - }, - }, - config = function(_, opts) - local wk = require("which-key") - wk.setup(opts) - wk.register(opts.defaults) - end, - }, - { - "f-person/git-blame.nvim", - lazy = true, - }, - { - "mg979/vim-visual-multi", - }, - { - "barreiroleo/ltex_extra.nvim", - ft = { "tex", "typst", "typ" }, - lazy = true, - }, - { - "smjonas/inc-rename.nvim", - lazy = true, - event = "BufEnter", - config = function() - require("inc_rename").setup({ - cmd_name = "IncRename", -- the name of the command - hl_group = "Substitute", -- the highlight group used for highlighting the identifier's new name - preview_empty_name = true, -- whether an empty new name should be previewed; if false the command preview will be cancelled instead - show_message = true, -- whether to display a `Renamed m instances in n files` message after a rename operation - input_buffer_type = nil, -- the type of the external input buffer to use (the only supported value is currently "dressing") - post_hook = nil, -- callback to run after renaming, receives the result table (from LSP handler) as an argument - }) - end, - }, - { - "nvim-tree/nvim-tree.lua", - dependencies = { "nvim-tree/nvim-web-devicons" }, - config = function() - require("nvim-tree").setup({ - renderer = { - group_empty = true, - }, - view = { - side = "right", - }, - diagnostics = { - enable = true, - }, - }) - end, - keys = { - { - "fe", - function() - require("nvim-tree.api").tree.toggle() - end, - desc = "Explorer NvimTree (root dir)", - }, - { - "fE", - function() - require("nvim-tree.api").tree.toggle() - end, - desc = "Explorer NvimTree (cwd)", - }, - { "", "fe", desc = "Explorer NvimTree (root dir)", remap = true }, - { "", "fE", desc = "Explorer NvimTree (cwd)", remap = true }, - }, - }, - { - "rcarriga/nvim-dap-ui", - keys = { - { - "dk", - function() - require("dap").down() - end, - desc = "Down", - }, - { - "dl", - function() - require("dap").up() - end, - desc = "Up", - }, - { - "d;", - function() - require("dap").run_last() - end, - desc = "Run Last", - }, - }, - }, - { - "nvim-neotest/neotest", - dependencies = { - "rcasia/neotest-java", - }, - opts = { - adapters = { - ["neotest-java"] = { - ignore_wrapper = false, -- whether to ignore maven/gradle wrapper - junit_jar = "/home/dashie/.local/share/nvim/mason/bin/junit-standalone.jar", - -- default: .local/share/nvim/neotest-java/junit-platform-console-standalone-[version].jar - }, - }, - }, - }, - { - "DreamMaoMao/yazi.nvim", - dependencies = { - "nvim-telescope/telescope.nvim", - "nvim-lua/plenary.nvim", - }, - keys = { - { "fy", "Yazi", desc = "Toggle Yazi" }, - }, - }, - { - "sindrets/diffview.nvim", - keys = { - { "gd", "DiffviewOpen", desc = "Toggle Difftool" }, - }, - }, - { "akinsho/git-conflict.nvim", version = "*", config = true }, - { "Hoffs/omnisharp-extended-lsp.nvim" }, - { - "barreiroleo/ltex_extra.nvim", - branch = "dev", - ft = { "tex", "typst", "text" }, - -- this causes an error with fsharp since - -- they use markdown to show lsp messages - config = function() - require("ltex_extra").setup({ - load_langs = { "en-US" }, - path = vim.fn.stdpath("config") .. "/spell", - }) - end, - }, - { "ionide/Ionide-vim", ft = "fsharp" }, - { - "mrcjkb/haskell-tools.nvim", - version = "^3", - lazy = false, - }, -}