{ inputs, config, lib, pkgs, ... }: let cfg = config.hm.editors.nixvim; in { imports = [ inputs.nixvim.homeModules.nixvim ]; options.hm.editors.nixvim.enable = lib.mkEnableOption "enables nixvim config framework"; config = lib.mkIf cfg.enable { programs.nixvim = { diagnostics.virtual_text = false; enable = true; package = inputs.neovim-nightly-overlay.packages.${pkgs.stdenv.hostPlatform.system}.default; viAlias = true; vimAlias = true; defaultEditor = true; waylandSupport = true; colorschemes.gruvbox.enable = true; globals.mapleader = " "; clipboard = { providers.wl-copy.enable = true; register = "unnamedplus"; }; opts = { number = true; relativenumber = true; termguicolors = true; ignorecase = true; smartcase = true; expandtab = true; shiftwidth = 2; encoding = "utf-8"; fileencoding = "utf-8"; undofile = true; swapfile = true; backup = false; autoread = true; cursorline = true; ruler = true; gdefault = true; scrolloff = 5; }; keymaps = [ { mode = [ "" ]; key = ""; action = ""; options.silent = true; } { mode = "n"; key = "gs"; action = "Neogit"; options.desc = "Neogit Status"; } { mode = "n"; key = "ff"; action = "Telescope find_files"; options.desc = "Find Files"; } { mode = "n"; key = "gd"; action = "lua vim.lsp.buf.definition()"; options.desc = "Go to Definition"; } { mode = "n"; key = "K"; action = "lua vim.lsp.buf.hover()"; options.desc = "Hover Docs"; } { mode = "n"; key = "ca"; action = "lua vim.lsp.buf.code_action()"; options.desc = "Code Actions"; } { mode = "n"; key = "rn"; action = "lua vim.lsp.buf.rename()"; options.desc = "Rename Symbol"; } { mode = "n"; key = "fs"; action = "Telescope lsp_document_symbols"; options.desc = "Find Symbols (Functions/Variables)"; } { mode = "n"; key = "fg"; action = "Telescope live_grep"; options.desc = "Live Grep"; } { mode = "n"; key = "ma"; action = "MCpattern"; options.desc = "Select all matches of pattern"; } { mode = "n"; key = "ha"; action = ''lua require("harpoon.mark").add_file()''; options.desc = "Harpoon: Mark File"; } { mode = "n"; key = "hh"; action = ''lua require("harpoon.ui").toggle_quick_menu()''; options.desc = "Harpoon: Show Menu"; } { mode = "n"; key = "xx"; action = "Trouble diagnostics toggle"; options.desc = "Toggle Trouble (Diagnostics)"; } { mode = "n"; key = "p"; action = "Telescope yank_history"; options.desc = "Open Yank History"; } ]; plugins = { overseer.enable = true; neotest.enable = true; tiny-inline-diagnostic = { enable = true; settings = { preset = "minimal"; show_all_diags_on_cursorline = true; options = { multilines = { enabled = true; always_show = true; }; }; }; }; comment.enable = true; flash = { enable = true; settings = { search.enabled = true; jump.autojump = true; }; }; notify = { enable = true; settings.topDown = false; }; yanky = { enable = true; settings.ring.history_length = 100; settings.system_clipboard.sync_with_ring = true; }; lualine = { enable = true; settings = { options.theme = "gruvbox-material"; sections = { lualine_b = [ "diagnostics" ]; lualine_c = [ "filename" ]; lualine_x = [ "filetype" ]; }; }; }; treesitter-context = { enable = true; settings = { max_lines = 2; trim_scope = "outer"; }; }; oil.enable = true; nvim-autopairs.enable = true; neoscroll.enable = true; bufferline.enable = true; web-devicons.enable = true; lsp-kind.enable = true; blink-cmp = { enable = true; settings = { keymap = { preset = "default"; "" = [ "show" "show_documentation" "hide" ]; "" = [ "accept" "fallback" ]; "" = [ "select_next" "fallback" ]; "" = [ "select_prev" "fallback" ]; }; }; }; gitsigns.enable = true; which-key.enable = true; harpoon = { enable = true; enableTelescope = true; }; toggleterm.enable = true; treesitter.enable = true; telescope = { enable = true; extensions.fzf-native.enable = true; }; noice.enable = true; dressing.enable = true; conform-nvim = { enable = true; settings = { formatters_by_ft = { nix = [ "alejandra" ]; }; format_on_save = { lsp_fallback = true; timeout_ms = 500; }; }; }; lsp = { enable = true; servers = { zls.enable = true; zls.package = pkgs.zls; nil_ls.enable = true; clangd.enable = true; }; }; }; }; }; }