{ config, inputs, pkgs, lib, ... }: let cfg = config.modules.nixvim; in { options.modules.nixvim = { enable = lib.mkEnableOption "Nixvim"; }; imports = [ inputs.nixvim.homeModules.nixvim ./plugins ]; config.home.packages = with pkgs; [ # formatters nixfmt rustfmt # misc ripgrep # misc nixd ]; config.programs.nixvim = lib.mkIf cfg.enable { enable = true; defaultEditor = true; colorschemes.tokyonight.enable = true; performance.byteCompileLua = { enable = true; plugins = true; nvimRuntime = true; luaLib = true; configs = true; }; plugins = { todo-comments.enable = true; lsp-status.enable = true; transparent.enable = true; lsp = { enable = true; servers = { qmlls = { enable = true; config = { cmd = "-E"; }; }; rust_analyzer = { enable = true; installCargo = false; installRustc = false; }; nixd = { enable = true; }; astro = { enable = true; }; }; }; lsp-format = { enable = true; # lspServersToEnable = [ "qmlls" ]; }; notify.enable = true; mini-cursorword.enable = true; # mini-statusline.enable = true; lualine = { enable = true; settings = { sections = { lualine_a = [ "mode" ]; lualine_b = [ "branch" "diff" "diagnostics" ]; lualine_c = [ "filename" ]; lualine_x = [ "encoding" "fileformat" "filetype" ]; lualine_y = [ "lsp_status" ]; lualine_z = [ "location" ]; }; inactive_sections = { lualine_a = [ ]; lualine_b = [ ]; lualine_c = [ "filename" ]; lualine_x = [ "location" ]; lualine_y = [ ]; lualine_z = [ ]; }; }; }; web-devicons.enable = true; vim-dadbod-completion.enable = true; telescope.enable = true; lazygit.enable = true; mini-indentscope = { enable = true; settings = { draw = { delay = 10; }; }; }; mini-files = { enable = true; settings = { windows = { preview = true; }; }; }; trouble.enable = true; cmp = { enable = true; autoEnableSources = true; settings = { sources = [ { name = "nvim_lsp"; } { name = "path"; } { name = "buffer"; } ]; 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'})"; }; }; }; lspkind.enable = true; tiny-inline-diagnostic.enable = true; # persisted.enable = true; auto-session = { enable = true; settings = { enabled = true; auto_save = true; auto_restore = true; }; }; wakatime.enable = true; treesitter = { enable = true; grammarPackages = with pkgs.vimPlugins.nvim-treesitter.builtGrammars; [ bash json lua make markdown nix regex toml vim vimdoc xml yaml ]; settings = { highlight.enable = true; }; }; }; extraPlugins = with pkgs; [ # vimPlugins.mini-completion vimPlugins.mini-comment vimPlugins.melange-nvim vimPlugins.telescope-file-browser-nvim vimPlugins.lsp-progress-nvim ]; opts = { number = true; bg = "dark"; tabstop = 2; shiftwidth = 2; termguicolors = true; }; globals = { mapleader = " "; }; keymaps = [ { action = "Telescope persisted"; key = "fs"; options = { silent = true; }; } { action = "Telescope find_files"; key = "ff"; options = { silent = true; }; } { action = ":lua MiniFiles.open()"; key = "fv"; options = { silent = true; }; } { action = "LazyGit"; key = "lg"; options = { silent = true; }; } { action = "Telescope buffers"; key = "fb"; options = { silent = true; }; } { action = "Telescope live_grep"; key = "fg"; options = { silent = true; }; } { action = "Trouble diagnostics toggle"; key = "fd"; options = { silent = true; }; } ]; }; }