{pkgs, ...}: { programs.nixvim = { enable = true; viAlias = true; vimAlias = true; withNodeJs = true; withRuby = true; extraPackages = with pkgs; [alejandra black stylua codespell]; luaLoader.enable = true; colorschemes.gruvbox.enable = true; opts = { showmode = false; }; globals = { mapleader = " "; }; keymaps = [ { # Unmap space (leader) action = ""; key = ""; options = { noremap = true; silent = true; }; mode = "n"; } { action = "sp"; key = "-"; options.silent = true; options.desc = "Split window horizontally"; } { action = "vsp"; key = "|"; options.silent = true; options.desc = "Split window vertically"; } { action = "ZenMode"; key = "wz"; options = { silent = true; noremap = true; desc = "Zen mode"; }; } { action = "h"; key = ""; options = { silent = true; noremap = true; desc = "Move to left window"; }; } { action = "j"; key = ""; options = { silent = true; noremap = true; desc = "Move to lower window"; }; } { action = "k"; key = ""; options = { silent = true; noremap = true; desc = "Move to upper window"; }; } { action = "l"; key = ""; options = { silent = true; noremap = true; desc = "Move to right window"; }; } { action = "close"; key = "wd"; options = { silent = true; noremap = true; desc = "Close current window"; }; } { action = "Telescope find_files"; key = "ff"; options = { silent = true; noremap = true; desc = "Find files"; }; } { action = "Telescope live_grep"; key = "/"; options = { silent = true; noremap = true; desc = "Live grep"; }; } { action = "Telescope buffers"; key = "fb"; options = { silent = true; noremap = true; desc = "List buffers"; }; } { action = "Telescope help_tags"; key = "fh"; options = { silent = true; noremap = true; desc = "Help tags"; }; } { action = "lua require'telescope.builtin'.lsp_definitions{}"; key = "gd"; options = { silent = true; noremap = true; desc = "Go to definition"; }; } { action = "lua require'telescope.builtin'.git_files{}"; key = " "; options = { silent = true; noremap = true; desc = "List Git files"; }; } { action = "lua require'telescope.builtin'.find_files{}"; key = "ff"; options = { silent = true; noremap = true; desc = "List all files"; }; } # { # action = "lua require'conform'.format({ bufnr = args.bf })"; # key = "cf"; # options = { # silent = true; # noremap = true; # desc = "Format buffer"; # }; # } ]; plugins = { lualine = { enable = true; globalstatus = true; }; lsp = { enable = true; inlayHints = true; servers = { bashls.enable = true; clangd.enable = true; hls.enable = true; pyright.enable = true; nixd.enable = true; nushell.enable = true; svelte.enable = true; tailwindcss.enable = true; typst-lsp.enable = true; rust-analyzer = { enable = true; installCargo = true; installRustc = true; }; marksman.enable = true; }; }; presence-nvim = { enable = true; editingText = "Hacking %s"; workspaceText = "The One True Text Editor"; buttons = [ { label = "GitHub"; url = "https://github.com/youwen5"; } { label = "Code Forge"; url = "https://code.youwen.dev/"; } ]; }; treesitter = { enable = true; settings = { highlight.enable = true; indent.enable = true; }; }; wakatime.enable = true; lazygit.enable = true; intellitab.enable = true; guess-indent.enable = true; indent-blankline.enable = true; which-key.enable = true; zen-mode.enable = true; markdown-preview.enable = true; yanky = { enable = true; enableTelescope = true; }; telescope = { enable = true; }; mini = { enable = true; modules = { surround = {}; pairs = {}; ai = {}; hipatterns = {}; notify = {}; tabline = {}; trailspace = {}; comment = {}; }; }; trouble.enable = true; direnv.enable = true; cmp = { enable = true; settings = { mapping = { "" = "cmp.mapping.complete()"; "" = "cmp.mapping.scroll_docs(-4)"; "" = "cmp.mapping.close()"; "" = "cmp.mapping.scroll_docs(4)"; "" = "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})"; "" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})"; "" = "cmp.mapping.confirm({ select = true })"; }; completion.autocomplete = [ "require('cmp.types').cmp.TriggerEvent.TextChanged" ]; }; }; cmp-async-path.enable = true; cmp-buffer.enable = true; cmp-conventionalcommits.enable = true; cmp-git.enable = true; cmp-nvim-lsp.enable = true; crates-nvim.enable = true; conform-nvim = { enable = true; formatOnSave = { timeoutMs = 500; lspFallback = true; }; formattersByFt = { lua = ["stylua"]; python = ["black"]; nix = ["alejandra"]; "*" = ["codespell"]; "_" = ["trim_whitespace"]; }; }; }; }; }