From bdaf917c15fad138258776d351c6db47b42922f5 Mon Sep 17 00:00:00 2001 From: zackartz Date: Tue, 19 Mar 2024 16:22:46 -0400 Subject: [PATCH] 230 current 2024-03-19 16:10:01 24.05.20240316.c75037b 6.8.0-zen1 * --- modules/home-manager/vim.nix | 318 ------------------------ modules/home-manager/vim/config | 1 + modules/home-manager/vim/default.nix | 82 ++++++ modules/home-manager/vim/lazy-lock.json | 71 ++++++ 4 files changed, 154 insertions(+), 318 deletions(-) delete mode 100644 modules/home-manager/vim.nix create mode 160000 modules/home-manager/vim/config create mode 100644 modules/home-manager/vim/default.nix create mode 100644 modules/home-manager/vim/lazy-lock.json diff --git a/modules/home-manager/vim.nix b/modules/home-manager/vim.nix deleted file mode 100644 index 61ae5ae..0000000 --- a/modules/home-manager/vim.nix +++ /dev/null @@ -1,318 +0,0 @@ -{pkgs, ...}: { - config = { - enable = true; - - plugins = { - # lualine = { - # enable = true; - # sections.lualine_x = ["overseer"]; - # }; - telescope.enable = true; - treesitter.enable = true; - luasnip.enable = true; - rustaceanvim.enable = true; - comment-nvim.enable = true; - lsp-format.enable = true; - toggleterm.enable = true; - which-key.enable = true; - todo-comments.enable = true; - }; - - plugins.neo-tree = { - enable = true; - enableGitStatus = true; - closeIfLastWindow = true; - autoCleanAfterSessionRestore = true; - window = { - width = 30; - }; - filesystem = { - followCurrentFile.enabled = true; - hijackNetrwBehavior = "open_current"; - useLibuvFileWatcher = true; - }; - defaultComponentConfigs = { - icon = { - folderEmpty = ""; - default = "󰈙"; - }; - indent = { - padding = 0; - indentSize = 1; - }; - modified = { - symbol = "󰧞"; - }; - name = { - useGitStatusColors = true; - }; - gitStatus = { - symbols = { - deleted = "D"; - renamed = "R"; - modified = "M"; - added = "A"; - untracked = "U"; - ignored = ""; - staged = ""; - unstaged = "!"; - conflict = "C"; - }; - }; - diagnostics = { - symbols = { - hint = ""; - info = "󰋽"; - warn = ""; - error = "󰅚"; - }; - highlights = { - hint = "DiagnosticSignHint"; - info = "DiagnosticSignInfo"; - warn = "DiagnosticSignWarn"; - error = "DiagnosticSignError"; - }; - }; - }; - }; - - plugins.noice = { - enable = true; - lsp = { - override = { - "vim.lsp.util.convert_input_to_markdown_lines" = true; - "vim.lsp.util.stylize_markdown" = true; - "cmp.entry.get_documentation" = true; - }; - hover = { - opts = { - silent = true; - }; - }; - }; - presets = { - bottom_search = false; - command_palette = true; - long_message_to_split = true; - inc_rename = false; - lsp_doc_border = "rounded"; - }; - }; - - plugins.notify.enable = true; - - plugins.gitsigns.enable = true; - plugins.crates-nvim.enable = true; - - plugins.dap = { - enable = true; - extensions.dap-ui.enable = true; - }; - - # colorschemes.dracula.enable = true; - # colorschemes.catppuccin.enable = true; - # colorschemes.kanagawa.enable = true; - # colorschemes.oxocarbon.enable = true; - - options = { - number = true; - relativenumber = true; - clipboard = "unnamedplus"; - - tabstop = 2; - shiftwidth = 2; - expandtab = true; - softtabstop = 2; - }; - globals.mapleader = " "; - - plugins.bufferline = { - enable = true; - diagnostics = "nvim_lsp"; - diagnosticsUpdateInInsert = true; - diagnosticsIndicator = null; - offsets = [ - { - filetype = "neo-tree"; - text = " NeoTree"; - text_align = "left"; - separator = "│"; - } - { - filetype = "dapui_watches"; - text = " DapUI"; - text_align = "left"; - separator = "|"; - } - { - filetype = "dbui"; - text = " DbUI"; - text_align = "left"; - separator = "|"; - } - ]; - }; - - plugins.indent-blankline = { - enable = true; - extraOptions = { - exclude = { - buftypes = [ - "nofile" - "terminal" - ]; - filetypes = [ - "help" - "startify" - "aerial" - "alpha" - "dashboard" - "neogitstatus" - "neo-tree" - "TelescopePrompt" - ]; - }; - scope = { - show_start = false; - show_end = false; - highlight = ["@keyword"]; - char = "▏"; - include = { - node_type = { - lua = ["table_constructor"]; - }; - }; - }; - whitespace = { - remove_blankline_trail = true; - }; - indent = {char = "▏";}; - }; - }; - - # plugins.nvim-jdtls = { - # enable = true; - # - # cmd = [ - # "${pkgs.jdt-language-server}/bin/jdtls" - # "-data" - # "/home/zack/.cache/jdtls/workspace" - # "-configuration" - # "/home/zack/.cache/jdtls/config" - # ]; - # }; - - plugins.lsp = { - enable = true; - servers = { - tsserver.enable = true; - lua-ls.enable = true; - rust-analyzer = { - enable = true; - installRustc = false; - installCargo = false; - }; - svelte.enable = true; - tailwindcss.enable = true; - nil_ls.enable = true; - }; - keymaps = { - lspBuf = { - K = "hover"; - gD = "references"; - gd = "definition"; - gi = "implementation"; - gt = "type_definition"; - }; - }; - }; - - keymaps = [ - { - action = "Neotree"; - key = "fe"; - } - { - action = "lua _lazygit_toggle()"; - key = "gg"; - } - { - action = "ToggleTerm"; - key = "h"; - } - { - action = "OverseerRun"; - key = ""; - } - { - action = "OverseerToggle"; - key = ""; - } - ]; - - plugins.cmp = { - enable = true; - autoEnableSources = true; - settings = { - sources = [ - {name = "nvim_lsp";} - {name = "path";} - {name = "buffer";} - ]; - snippet = { - expand = '' function(args) - require('luasnip').lsp_expand(args.body) - end''; - }; - mappingPresets = ["insert"]; - mapping = { - "" = "cmp.mapping.complete()"; - "" = "cmp.mapping.scroll_docs(-4)"; - "" = "cmp.mapping.close()"; - "" = "cmp.mapping.scroll_docs(4)"; - "" = "cmp.mapping.confirm({ select = true })"; - "" = "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})"; - "" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})"; - }; - }; - }; - - extraPlugins = with pkgs.vimPlugins; [ - { - plugin = dressing-nvim; - config = ''lua require("dressing").setup()''; - } - { - plugin = overseer-nvim; - config = ''lua require('overseer').setup({ task_list = { direction = "bottom" } })''; - } - { - plugin = nui-nvim; - } - { - plugin = lualine-nvim; - } - { - plugin = base46; - } - ]; - - extraConfigLua = '' - local Terminal = require('toggleterm.terminal').Terminal - local lazygit = Terminal:new({ cmd = "lazygit", hidden = true, direction = "float" }) - - vim.g.base46_cache = vim.fn.stdpath('data') .. '/base46_cache/' - - function _lazygit_toggle() - lazygit:toggle() - end - - - local integrations = require("nvconfig").base46.integrations - - for _, name in ipairs(integrations) do - dofile(vim.g.base46_cache .. name) - end - ''; - }; -} diff --git a/modules/home-manager/vim/config b/modules/home-manager/vim/config new file mode 160000 index 0000000..87c72e7 --- /dev/null +++ b/modules/home-manager/vim/config @@ -0,0 +1 @@ +Subproject commit 87c72e79fcc9a2dda9fd04211a946bba78f9f70b diff --git a/modules/home-manager/vim/default.nix b/modules/home-manager/vim/default.nix new file mode 100644 index 0000000..77e5fe5 --- /dev/null +++ b/modules/home-manager/vim/default.nix @@ -0,0 +1,82 @@ +{ + config, + lib, + pkgs, + ... +}: { + programs.neovim = { + enable = true; + package = pkgs.neovim-nightly; + defaultEditor = true; + extraPackages = with pkgs; [ + # Formatters + alejandra # Nix + black # Python + prettierd # Multi-language + shfmt + isort + stylua + + # LSP + lua-language-server + nixd + + # Tools + git + cmake + fzf + gcc + gnumake + nodejs + fswatch # File watcher utility, replacing libuv.fs_event for neovim 10.0 + sqlite + vscode-extensions.vadimcn.vscode-lldb.adapter + ]; + plugins = [ + pkgs.vimPlugins.lazy-nvim # All other plugins are managed by lazy-nvim + ]; + }; + + xdg.configFile = { + # Raw symlink to the plugin manager lock file, so that it stays writeable + "nvim/lazy-lock.json".source = config.lib.file.mkOutOfStoreSymlink "${nvimDir}/lazy-lock.json"; + "nvim/lua/nix/palette.lua".text = "return ${lib.generators.toLua {} palette}"; + "nvim/lua/nix/tools.lua".text = '' + vim.g.sqlite_clib_path = '${pkgs.sqlite.out}/lib/libsqlite3.so' + + return { + gcc = '${lib.getExe pkgs.gcc}'; + } + ''; + "nvim" = { + source = ./config; + recursive = true; + }; + "${config.my.configDir}/.nixd.json".text = builtins.toJSON { + options = { + enable = true; + target.installable = ".#homeConfigurations.nixd.options"; + }; + }; + }; + + home.activation.neovim = lib.home-manager.hm.dag.entryAfter ["linkGeneration"] '' + #! /bin/bash + NVIM_WRAPPER=~/.nix-profile/bin/nvim + STATE_DIR=~/.local/state/nix/ + STATE_FILE=$STATE_DIR/lazy-lock-checksum + LOCK_FILE=~/.config/nvim/lazy-lock.json + HASH=$(nix-hash --flat $LOCK_FILE) + + [ ! -d $STATE_DIR ] && mkdir -p $STATE_DIR + [ ! -f $STATE_FILE ] && touch $STATE_FILE + + if [ "$(cat $STATE_FILE)" != "$HASH" ]; then + echo "Syncing neovim plugins" + PATH="$PATH:${pkgs.git}/bin" $DRY_RUN_CMD $NVIM_WRAPPER --headless "+Lazy! restore" +qa + $DRY_RUN_CMD echo $HASH >$STATE_FILE + else + $VERBOSE_ECHO "Neovim plugins already synced, skipping" + fi + ''; +} diff --git a/modules/home-manager/vim/lazy-lock.json b/modules/home-manager/vim/lazy-lock.json new file mode 100644 index 0000000..40cda11 --- /dev/null +++ b/modules/home-manager/vim/lazy-lock.json @@ -0,0 +1,71 @@ +{ + "Comment.nvim": { "branch": "master", "commit": "176e85eeb63f1a5970d6b88f1725039d85ca0055" }, + "LuaSnip": { "branch": "master", "commit": "0b4950a237ce441a6a3a947d501622453f6860ea" }, + "alpha-nvim": { "branch": "main", "commit": "234822140b265ec4ba3203e3e0be0e0bb826dff5" }, + "better-escape.nvim": { "branch": "master", "commit": "7031dc734add47bb71c010e0551829fa5799375f" }, + "bufferline.nvim": { "branch": "main", "commit": "d24378edc14a675c820a303b4512af3bbc5761e9" }, + "ccc.nvim": { "branch": "main", "commit": "4a0ddaf787cc82796e84ab8a7f70d086f250aeb6" }, + "clear-action.nvim": { "branch": "master", "commit": "e36fad3b9ebb85acdd5c41651b51a3cf70991323" }, + "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "cmp-cmdline": { "branch": "main", "commit": "8ee981b4a91f536f52add291594e89fb6645e451" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" }, + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" }, + "crates.nvim": { "branch": "main", "commit": "4ce7c51b881e58f1e2f8f437f30e4e583cbac319" }, + "document-color.nvim": { "branch": "main", "commit": "74c487f0e5accfaae033755451b9e367220693fd" }, + "dressing.nvim": { "branch": "master", "commit": "39611852fd7bbac117e939a26759bb37361f0c90" }, + "dropbar.nvim": { "branch": "master", "commit": "ee3a356254ab494c0e280b809969a7a3a7e38fb7" }, + "flash.nvim": { "branch": "main", "commit": "6d76c5dee65181ab55cbdfb0760260e800d643f4" }, + "friendly-snippets": { "branch": "main", "commit": "ea84a710262cb2c286d439070bad37d36fd3db25" }, + "gitsigns.nvim": { "branch": "main", "commit": "ff01d34daaed72f271a8ffa088a7e839a60c640f" }, + "guess-indent.nvim": { "branch": "main", "commit": "b8ae749fce17aa4c267eec80a6984130b94f80b2" }, + "indent-blankline.nvim": { "branch": "master", "commit": "877c1db2bf957300097dd5348a665666a4d900cb" }, + "lazy.nvim": { "branch": "main", "commit": "25beed5e2e935ebc00d7e3eed1dc502df3c40e39" }, + "lspkind-nvim": { "branch": "master", "commit": "57610d5ab560c073c465d6faf0c19f200cb67e6e" }, + "lualine.nvim": { "branch": "master", "commit": "05d78e9fd0cdfb4545974a5aa14b1be95a86e9c9" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "828a538ac8419f586c010996aefa5df6eb7c250b" }, + "mason-null-ls.nvim": { "branch": "main", "commit": "ae0c5fa57468ac65617f1bf821ba0c3a1e251f0c" }, + "mason-nvim-dap.nvim": { "branch": "main", "commit": "e4d56b400e9757b1dc77d620fd3069396e92d5fc" }, + "mason.nvim": { "branch": "main", "commit": "5ad3e113b0c3fde3caba8630599373046f6197e8" }, + "move.nvim": { "branch": "main", "commit": "d663b74b4e38f257aae757541c9076b8047844d6" }, + "neo-rename.nvim": { "branch": "master", "commit": "24ce4264971620d182c14fef1af46a20e8c90806" }, + "neo-tree.nvim": { "branch": "v2.x", "commit": "80dc74d081823649809f78370fa5b204aa9a853a" }, + "neodev.nvim": { "branch": "main", "commit": "f8592cc143a5512b98a2c3683aa43c73f98e34f7" }, + "neovim-session-manager": { "branch": "master", "commit": "df544e17798dd0e6e33ecf0991dfde9174367837" }, + "noice.nvim": { "branch": "main", "commit": "bf67d70bd7265d075191e7812d8eb42b9791f737" }, + "nui.nvim": { "branch": "main", "commit": "9e3916e784660f55f47daa6f26053ad044db5d6a" }, + "null-ls.nvim": { "branch": "main", "commit": "db09b6c691def0038c456551e4e2772186449f35" }, + "nvim-autopairs": { "branch": "master", "commit": "ae5b41ce880a6d850055e262d6dfebd362bb276e" }, + "nvim-bufdel": { "branch": "main", "commit": "96c4f7ab053ddab0025bebe5f7c71e4795430e47" }, + "nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" }, + "nvim-dap": { "branch": "master", "commit": "9d81c11fd185a131f81841e64941859305f6c42d" }, + "nvim-dap-ui": { "branch": "master", "commit": "85b16ac2309d85c88577cd8ee1733ce52be8227e" }, + "nvim-dap-virtual-text": { "branch": "master", "commit": "57f1dbd0458dd84a286b27768c142e1567f3ce3b" }, + "nvim-lspconfig": { "branch": "master", "commit": "fcf153fbbf1facd16a71d46b92be8be495123a9f" }, + "nvim-notify": { "branch": "master", "commit": "5371f4bfc1f6d3adf4fe9d62cd3a9d44356bfd15" }, + "nvim-surround": { "branch": "main", "commit": "10b20ca7d9da1ac8df8339e140ffef94f9ab3b18" }, + "nvim-treesitter": { "branch": "master", "commit": "143a342bd860d6e3d584edeb447fb49febab3355" }, + "nvim-ts-autotag": { "branch": "main", "commit": "6be1192965df35f94b8ea6d323354f7dc7a557e4" }, + "nvim-ts-context-commentstring": { "branch": "main", "commit": "7f625207f225eea97ef7a6abe7611e556c396d2f" }, + "nvim-ufo": { "branch": "main", "commit": "43e39ec74cd57c45ca9d8229a796750f6083b850" }, + "nvim-web-devicons": { "branch": "master", "commit": "efbfed0567ef4bfac3ce630524a0f6c8451c5534" }, + "playground": { "branch": "master", "commit": "2b81a018a49f8e476341dfcb228b7b808baba68b" }, + "plenary.nvim": { "branch": "master", "commit": "267282a9ce242bbb0c5dc31445b6d353bed978bb" }, + "promise-async": { "branch": "main", "commit": "e94f35161b8c5d4a4ca3b6ff93dd073eb9214c0e" }, + "rust-tools.nvim": { "branch": "master", "commit": "0cc8adab23117783a0292a0c8a2fbed1005dc645" }, + "schemastore.nvim": { "branch": "main", "commit": "43b2ef9a1b716752dcdcb9fafddfdb871a59051f" }, + "telescope-dap.nvim": { "branch": "master", "commit": "313d2ea12ae59a1ca51b62bf01fc941a983d9c9c" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "9bc8237565ded606e6c366a71c64c0af25cd7a50" }, + "telescope.nvim": { "branch": "master", "commit": "8c69f58427f98b2ca39a90a36db830c06e30351c" }, + "toggleterm.nvim": { "branch": "main", "commit": "00c13dccc78c09fa5da4c5edda990a363e75035e" }, + "tokyonight.nvim": { "branch": "main", "commit": "610179f7f12db3d08540b6cc61434db2eaecbcff" }, + "tree-sitter-icelang": { "branch": "master", "commit": "1473d5a547264ea024ca5c32dd52f4c0d2cbf493" }, + "treesj": { "branch": "main", "commit": "3203aa553217921fd4dcb79245f9df07278910b2" }, + "twilight.nvim": { "branch": "main", "commit": "a4843e6e67092a1e6fa9666f02bf0ab59174c1df" }, + "vim-dadbod": { "branch": "master", "commit": "7d80bbd11c407a09e0f7b869c38f3dec3902805f" }, + "vim-dadbod-completion": { "branch": "master", "commit": "fc7321a17f4c55db11fae89a884ddf4724020bae" }, + "vim-dadbod-ui": { "branch": "master", "commit": "95fd22469507e86b78aa55d868c14108adee2881" }, + "vim-illuminate": { "branch": "master", "commit": "a2907275a6899c570d16e95b9db5fd921c167502" }, + "vim-smoothie": { "branch": "master", "commit": "df1e324e9f3395c630c1c523d0555a01d2eb1b7e" }, + "which-key.nvim": { "branch": "main", "commit": "38b990f6eabf62014018b4aae70a97d7a6c2eb88" } +} \ No newline at end of file