{ pkgs, ... }: { programs.nixvim = { enable = true; defaultEditor = true; viAlias = true; vimAlias = true; # =================== # Basic Options # =================== options = { number = true; cursorline = true; showmode = false; syntax = "enable"; hlsearch = true; incsearch = true; tabstop = 4; termguicolors = true; }; globals.mapleader = " "; keymaps = [ # Clipboard { mode = "n"; key = "y"; action = "\"+y"; options.desc = "Yank to clipboard"; } { mode = "v"; key = "y"; action = "\"+y"; options.desc = "Yank to clipboard"; } { mode = "n"; key = "Y"; action = "\"+Y"; options.desc = "Yank line to clipboard"; } { mode = "n"; key = "d"; action = "\"+d"; options.desc = "Delete to clipboard"; } { mode = "v"; key = "d"; action = "\"+d"; options.desc = "Delete to clipboard"; } { mode = "n"; key = "D"; action = "\"+D"; options.desc = "Delete line to clipboard"; } { mode = "n"; key = "p"; action = "\"+p"; options.desc = "Paste from clipboard"; } { mode = "v"; key = "p"; action = "\"+p"; options.desc = "Paste from clipboard"; } ]; # =================== # Plugins # =================== plugins = { # Treesitter treesitter = { enable = true; ensureInstalled = [ "lua" "nix" "python" "javascript" "rust" "rasi" ]; }; # Lint lint.enable = true; # Mason + LSP mason.enable = true; mason-lspconfig = { enable = true; ensureInstalled = [ "lua_ls" "nil_ls" "rust_analyzer" "pylsp" "stylelint_lsp" ]; }; lsp = { enable = true; servers = { lua_ls.settings.Lua = { runtime.version = "LuaJIT"; diagnostics.globals = [ "vim" ]; telemetry.enable = false; }; nil_ls.enable = true; rust_analyzer.enable = true; pylsp.enable = true; stylelint_lsp = { enable = true; filetypes = [ "css" "scss" "rasi" ]; cmd = [ "stylelint-lsp" "--stdio" ]; }; }; keymaps.lspBuf = { gd = "definition"; K = "hover"; "rn" = "rename"; "ca" = "code_action"; }; }; # Completion cmp = { enable = true; sources = [ { name = "nvim_lsp"; } { name = "luasnip"; } { name = "avante_commands"; } { name = "avante_mentions"; } { name = "buffer"; } { name = "path"; } ]; }; luasnip.enable = true; # Conform conform-nvim = { enable = true; formattersByFt = { lua = [ "stylua" ]; nix = [ "nixfmt" ]; python = [ "black" ]; rust = [ "rustfmt" ]; rasi = [ "prettierd" ]; }; formatOnSave = { timeoutMs = 500; lspFallback = true; }; }; # Telescope telescope = { enable = true; keymaps = { "ff" = "find_files"; "fg" = "live_grep"; "fb" = "buffers"; "fh" = "help_tags"; }; }; # Toggleterm toggleterm = { enable = true; settings = { size = 20; direction = "float"; float_opts = { border = "single"; width = 200; height = 40; }; }; }; # Statusline lualine = { enable = true; settings.options = { theme = "catppuccin"; component_separators = { left = "|"; right = "|"; }; section_separators = { left = ""; right = ""; }; }; }; # Dashboard (alpha) alpha = { enable = true; theme = "dashboard"; layout.dashboard = { section.header.val = [ "⣿⣿⣿⣿⣿⣿⣿⣿⣿⢿⣯⣿⠿⣟⣷⣯⣛⢿⣿⣿⣾⣟⣿⣿⣿⣿⣿⣿⣿⣿⣿" "⣿⣿⣿⣿⣿⣿⣿⡿⣵⣿⡿⣴⣽⡟⣳⢿⢽⣽⣕⣽⢿⡿⣿⣟⣿⣿⣿⣿⣿⣿⣿" "⣿⣿⣿⣷⣿⣿⢟⣫⣿⢟⢟⣾⣾⣿⣿⣞⢳⣻⢞⣎⠿⢞⣊⣿⣞⣿⣿⣿⣿⣿⢽" "⣿⣿⣿⣿⣿⣏⢯⣿⣏⣏⠔⢇⣿⢢⢆⢀⢆⣧⣼⢻⢰⡧⢻⣝⣏⡸⣧⣾⣿⣿⣿" "⣿⣿⣿⣿⡟⣻⣿⣿⡾⡿⡼⢸⡝⣝⡳⢢⣧⢳⣳⢷⡇⣗⢺⡺⣿⡧⣿⣿⣿⢿⢿" "⣿⡿⣿⣼⡼⣿⣿⡗⡧⣧⠁⡝⣧⣳⠅⡾⠈⣎⢮⣧⣿⣿⣗⣷⣻⢷⣏⣼⢏⣺⣿" "⣿⣿⣿⣻⣿⣿⣿⢧⣿⢹⠉⢷⢿⣧⣲⡏⡀⡈⢆⠳⣿⡿⢿⣿⣱⢿⢫⣷⣝⣿⣿" "⣿⣿⣿⡯⡟⣿⣿⢽⣡⠟⢿⣮⠁⠙⠛⠈⡴⢿⣿⡷⣬⣽⢽⠧⣷⡏⣿⡇⣧⣽⣿" "⣿⠟⢻⡧⡇⣿⡇⣇⣆⢄⡜⢃⡀⡀⡀⡀⡀⢎⣁⠁⣸⣗⣸⣿⣧⣼⡿⢹⢿⢾⣿" "⣿⣷⣾⣿⢻⣿⢧⢻⣽⡀⡀⡀⡀⢄⡀⡀⡀⡀⡀⢀⣷⡸⡟⣿⣶⣻⣧⡛⡱⢝⣿" "⣿⣿⣿⣿⢸⡿⢚⡜⣿⣇⡀⡀⡀⡀⡀⡀⡀⡀⠚⢁⢣⣜⡿⣿⡇⢼⣿⠨⣸⣿⣿" "⣿⣄⣿⣗⢾⢻⣧⢿⣾⣿⣦⡀⡀⠑⠚⠉⡀⡀⣤⣿⢨⣿⠗⣻⢣⣿⢹⢈⣽⣿⣿" "⣿⣿⣿⣿⢎⡄⢿⣞⡇⣿⠹⣿⣶⣀⡀⣀⡴⡩⢸⢏⣿⣿⣶⢻⣾⢏⡞⠡⢽⣇⣾" "⣿⣿⣿⣮⣼⢬⣦⢿⣳⣌⠧⡉⠈⣇⣛⣁⣈⣼⣿⡸⠫⠛⠐⠛⠕⣙⣻⣬⣼⣿⣿" "⢟⢿⣿⣿⣿⡢⣃⣪⣭⣡⣤⣶⠟⡿⠿⠿⠿⠛⢁⣿⣿⢩⠉⡀⠈⠓⡝⣿⣿⣿⣿" "⣾⣿⣿⣿⣿⠞⢔⡣⡴⣾⣿⠓⣤⢧⡼⣉⠠⢤⣿⣿⠇⠃⡀⡀⡀⡀⡸⢿⣾⣿⣿" "⣿⣿⣿⡿⣺⡸⢗⢠⣇⣿⣿⠊⠃⡀⠉⡀⢠⣿⣿⠟⡸⡀⡀⡀⡀⡀⣃⣬⠽⠿⣿" "⣿⣿⣿⣿⡇⡏⢸⣿⠟⣽⡇⡀⡀⡀⡀⣴⣟⢭⣾⣿⡇⠎⣠⠒⠉⠈⢀⡀⢨⡋⣿" "⠛⠛⠛⠋⠃⠓⠚⠛⠘⠛⠃⡀⠊⡀⠛⠛⠛⠂⠛⠛⠓⠁⠚⡀⠂⠒⠒⠐⠒⠋⠛" ]; section.buttons.val = [ { shortcut = "e"; text = "[+] New file"; command = ":ene startinsert "; } { shortcut = "f"; text = "[?] Find file"; command = ":Telescope find_files "; } { shortcut = "r"; text = "[~] Recent files"; command = ":Telescope oldfiles "; } { shortcut = "y"; text = "[Y] Yazi"; command = ":Yazi"; } { shortcut = "m"; text = "[M] Mason"; command = ":Mason"; } { shortcut = "q"; text = "[X] Quit"; command = ":qa"; } ]; section.footer.val = "Circuits hum in anticipation of your will."; }; }; # Colorscheme catppuccin = { enable = true; flavour = "mocha"; transparentBackground = true; integrations = { treesitter = true; mason = true; cmp = true; telescope = true; toggleterm = true; }; }; }; # =================== # Plugins not in nixvim # =================== extraPlugins = with pkgs.vimPlugins; [ yazi-nvim cheatsheet-nvim avante-nvim plenary-nvim nui-nvim dressing-nvim nvim-web-devicons img-clip-nvim render-markdown-nvim (pkgs.vimUtils.buildVimPlugin { name = "conform-nvim"; src = pkgs.fetchFromGitHub { owner = "stevearc"; repo = "conform.nvim"; rev = "stable"; sha256 = "sha256-pUF9F5QoDzCZuVRcJEF91M8Qjkh/xosMkf9tRavkmJs="; }; }) ]; }; home.packages = with pkgs; [ nixfmt-rfc-style stylua black nodePackages.prettier rustfmt nodejs prettierd stylelint-lsp lua-language-server nil rust-analyzer python3Packages.python-lsp-server curl cargo ]; }