From 553ef00fa92a53c99f2236073008b4c94c50893c Mon Sep 17 00:00:00 2001 From: 0xrsydn Date: Tue, 28 Oct 2025 20:32:32 +0700 Subject: [PATCH] feat: nvim new configs --- .gitignore | 3 + devshells/default.nix | 53 +++++++ modules/darwin/homebrew.nix | 3 +- modules/home/rsydn/programs/neovim.nix | 36 ++++- modules/home/rsydn/programs/nvim/init.lua | 4 + .../rsydn/programs/nvim/lua/config/lazy.lua | 9 ++ .../programs/nvim/lua/config/lazyvim/init.lua | 53 +++++++ .../programs/nvim/lua/config/lazyvim/lsp.lua | 150 +++++++++++------- .../programs/nvim/lua/plugins/coding.lua | 6 +- .../programs/nvim/lua/plugins/colorscheme.lua | 8 +- .../programs/nvim/lua/plugins/completion.lua | 8 +- .../nvim/lua/plugins/file-explorer.lua | 8 +- .../programs/nvim/lua/plugins/formatting.lua | 59 +++++++ .../programs/nvim/lua/plugins/linting.lua | 34 ++-- .../programs/nvim/lua/plugins/treesitter.lua | 27 ++-- .../programs/nvim/lua/plugins/which-key.lua | 78 +++++++++ modules/home/rsydn/shell/tmux.nix | 4 + 17 files changed, 447 insertions(+), 96 deletions(-) create mode 100644 modules/home/rsydn/programs/nvim/lua/config/lazyvim/init.lua create mode 100644 modules/home/rsydn/programs/nvim/lua/plugins/formatting.lua create mode 100644 modules/home/rsydn/programs/nvim/lua/plugins/which-key.lua diff --git a/.gitignore b/.gitignore index de431d1..78e7022 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,6 @@ # Nix build results result result-* + +# Neovim +modules/home/rsydn/programs/nvim/lazy-lock.json diff --git a/devshells/default.nix b/devshells/default.nix index c0c3b43..47cdfc5 100644 --- a/devshells/default.nix +++ b/devshells/default.nix @@ -35,15 +35,65 @@ let echo "Restart Claude Code and Codex to apply changes." ''; + # Helper that builds the wrapped Neovim from the flake and runs it with repo-scoped XDG dirs + previewNvim = pkgs.writeShellScriptBin "preview-nvim" '' + set -euo pipefail + + root="''${DOTFILES_ROOT:-$PWD}" + cache_base="$root/.cache" + nvim_cache="$cache_base/nvim-preview" + xdg_state="$cache_base/xdg-state" + xdg_data="$cache_base/xdg-data" + xdg_config="$root/modules/home/rsydn/programs" + + mkdir -p "$nvim_cache" "$xdg_state" "$xdg_data" + + attr="''${NVIM_ATTR:-}" + if [ "$#" -gt 0 ]; then + attr="$1" + shift + fi + + if [ -z "$attr" ]; then + case "$(uname -s)" in + Darwin) + attr=".#darwinConfigurations.macbook-pro.config.home-manager.users.rasyidanakbar.programs.neovim.finalPackage" + ;; + Linux) + attr=".#nixosConfigurations.dev-vm.config.home-manager.users.rasyidanakbar.programs.neovim.finalPackage" + ;; + *) + echo "error: unsupported system; pass flake attribute as first argument or set NVIM_ATTR" >&2 + exit 1 + ;; + esac + fi + + out_link="$nvim_cache/result" + + echo "Building Neovim package: $attr" + XDG_CACHE_HOME="$nvim_cache" nix build "$attr" --out-link "$out_link" + + echo "Launching Neovim..." + XDG_CACHE_HOME="$nvim_cache" \ + XDG_STATE_HOME="$xdg_state" \ + XDG_DATA_HOME="$xdg_data" \ + XDG_CONFIG_HOME="$xdg_config" \ + NVIM_APPNAME="nvim" \ + "$out_link/bin/nvim" "$@" + ''; + in pkgs.mkShell { name = "default"; packages = with pkgs; [ git + nix nixfmt-classic uv python3 mcpNixosWrapper installMcpConfigs + previewNvim ]; shellHook = '' export DOTFILES_ROOT="$PWD" @@ -63,5 +113,8 @@ in pkgs.mkShell { echo "" echo "To install MCP configs for Claude Code and Codex, run:" echo " install-mcp-configs" + echo "" + echo "To preview the Neovim config without switching, run:" + echo " preview-nvim [flakeAttr] [-- extra args]" ''; } diff --git a/modules/darwin/homebrew.nix b/modules/darwin/homebrew.nix index 72cbf5e..b6637b4 100644 --- a/modules/darwin/homebrew.nix +++ b/modules/darwin/homebrew.nix @@ -16,7 +16,7 @@ in { }; brews = mkOption { type = types.listOf types.str; - default = [ "curl" "yt-dlp" "ruff" "libmagic" "ghostscript" "infisical" ]; + default = [ "curl" "yt-dlp" "ruff" "libmagic" "infisical" ]; description = "Homebrew formulae to install."; }; casks = mkOption { @@ -24,6 +24,7 @@ in { default = [ "bitwarden" "brave-browser" + "firefox" "pgadmin4" "docker-desktop" "spotify" diff --git a/modules/home/rsydn/programs/neovim.nix b/modules/home/rsydn/programs/neovim.nix index cc1a9fc..fecf477 100644 --- a/modules/home/rsydn/programs/neovim.nix +++ b/modules/home/rsydn/programs/neovim.nix @@ -9,16 +9,48 @@ withPython3 = true; withRuby = true; + plugins = with pkgs.vimPlugins; [ + # Native extensions that need building + telescope-fzf-native-nvim + blink-cmp # Pre-built with Rust backend for fast fuzzy matching + ]; + extraPackages = with pkgs; [ + # LSP Servers + lua-language-server + nil # Nix LSP + pyright + nodePackages.typescript-language-server + rust-analyzer + gopls + clang-tools # provides clangd + # Formatters - stylua - nixfmt + stylua # Lua + nixfmt-classic # Nix (matches your fmt command) + ruff # Python (formatter + linter) + prettierd # JS/TS/JSON/YAML/Markdown + rustfmt # Rust + gofumpt # Go (stricter than gofmt) + shfmt # Shell scripts + + # Linters + nodePackages.eslint # JavaScript/TypeScript + shellcheck # Shell scripts # Tools ripgrep fd git ast-grep + + # Additional tools for LazyVim features + tree-sitter # Required for treesitter parser compilation + imagemagick # Image conversion for snacks.nvim + ghostscript # PDF rendering support + tectonic # LaTeX math rendering + luarocks # Lua package manager for plugins + nodePackages.mermaid-cli # Mermaid diagram rendering ]; }; diff --git a/modules/home/rsydn/programs/nvim/init.lua b/modules/home/rsydn/programs/nvim/init.lua index 0ebd480..40f66c5 100644 --- a/modules/home/rsydn/programs/nvim/init.lua +++ b/modules/home/rsydn/programs/nvim/init.lua @@ -2,4 +2,8 @@ require("config.options") require("config.keymaps") require("config.autocmds") + +-- Load LazyVim utilities before lazy plugin manager +require("config.lazyvim") + require("config.lazy") diff --git a/modules/home/rsydn/programs/nvim/lua/config/lazy.lua b/modules/home/rsydn/programs/nvim/lua/config/lazy.lua index c24f16f..1364ca1 100644 --- a/modules/home/rsydn/programs/nvim/lua/config/lazy.lua +++ b/modules/home/rsydn/programs/nvim/lua/config/lazy.lua @@ -17,12 +17,21 @@ vim.g.mapleader = " " vim.g.maplocalleader = "\\" require("lazy").setup({ spec = { + { + "LazyVim/LazyVim", + import = "lazyvim.plugins", + }, { import = "plugins" }, { import = "config.lazyvim" }, }, + defaults = { + lazy = false, + version = false, + }, + install = { colorscheme = { "gruvbox", "habamax" } }, checker = { enabled = false }, diff --git a/modules/home/rsydn/programs/nvim/lua/config/lazyvim/init.lua b/modules/home/rsydn/programs/nvim/lua/config/lazyvim/init.lua new file mode 100644 index 0000000..6e5fe14 --- /dev/null +++ b/modules/home/rsydn/programs/nvim/lua/config/lazyvim/init.lua @@ -0,0 +1,53 @@ +-- LazyVim utilities module +-- Provides helper functions for plugin configuration + +local M = {} + +-- Mini module utilities +M.mini = {} + +-- Setup mini.pairs with given options +function M.mini.pairs(opts) + require("mini.pairs").setup(opts) +end + +-- Text object for entire buffer +M.mini.ai_buffer = function(ai) + local n_lines = vim.fn.line("$") + local start_line, end_line = 1, n_lines + if n_lines == 0 then + return { from = { line = 0, col = 0 } } + end + local start_col, end_col = 1, math.max(vim.fn.getline(end_line):len(), 1) + return { + from = { line = start_line, col = start_col }, + to = { line = end_line, col = end_col }, + } +end + +-- Text object hints are now handled by mini.clue + +-- Run callback when plugin is loaded +function M.on_load(name, fn) + local Config = require("lazy.core.config") + if Config.plugins[name] and Config.plugins[name]._.loaded then + vim.schedule(function() + fn(name) + end) + else + vim.api.nvim_create_autocmd("User", { + pattern = "LazyLoad", + callback = function(event) + if event.data == name then + fn(name) + return true + end + end, + }) + end +end + +-- Make LazyVim global +_G.LazyVim = M + +return M diff --git a/modules/home/rsydn/programs/nvim/lua/config/lazyvim/lsp.lua b/modules/home/rsydn/programs/nvim/lua/config/lazyvim/lsp.lua index db6ab11..ea48081 100644 --- a/modules/home/rsydn/programs/nvim/lua/config/lazyvim/lsp.lua +++ b/modules/home/rsydn/programs/nvim/lua/config/lazyvim/lsp.lua @@ -1,70 +1,106 @@ --- Enable language servers defined in nvim-lspconfig using the Nvim 0.11 API. +-- LSP configuration using Nix-managed servers return { - { - "mason-org/mason.nvim", - opts = function(_, opts) - opts.ensure_installed = opts.ensure_installed or {} - local ensure = { - "clangd", - "gopls", - "lua-language-server", - "nil", - "pyright", - "rust-analyzer", - "typescript-language-server", - } - for _, tool in ipairs(ensure) do - if not vim.tbl_contains(opts.ensure_installed, tool) then - table.insert(opts.ensure_installed, tool) - end - end - end, - }, + -- Disable Mason plugins (we use Nix-managed servers instead) + { "mason-org/mason.nvim", enabled = false }, + { "mason-org/mason-lspconfig.nvim", enabled = false }, + { "jay-babu/mason-null-ls.nvim", enabled = false }, + { "jay-babu/mason-nvim-dap.nvim", enabled = false }, + { "neovim/nvim-lspconfig", event = { "BufReadPre", "BufNewFile" }, - opts = function(_, opts) - opts.servers = vim.tbl_deep_extend( - "force", - { - lua_ls = {}, - nil_ls = {}, - pyright = {}, - ts_ls = {}, - rust_analyzer = {}, - gopls = {}, - clangd = {}, + dependencies = { + "saghen/blink.cmp", -- For LSP capabilities + }, + config = function() + -- Get blink.cmp capabilities + local capabilities = require("blink.cmp").get_lsp_capabilities() + + -- Common LSP attach keybindings + vim.api.nvim_create_autocmd("LspAttach", { + group = vim.api.nvim_create_augroup("UserLspConfig", {}), + callback = function(ev) + local opts = { buffer = ev.buf } + vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts) + vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts) + vim.keymap.set("n", "gr", vim.lsp.buf.references, opts) + vim.keymap.set("n", "gi", vim.lsp.buf.implementation, opts) + vim.keymap.set("n", "K", vim.lsp.buf.hover, opts) + vim.keymap.set("n", "ca", vim.lsp.buf.code_action, opts) + vim.keymap.set("n", "rn", vim.lsp.buf.rename, opts) + vim.keymap.set("n", "d", vim.diagnostic.open_float, opts) + vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, opts) + vim.keymap.set("n", "]d", vim.diagnostic.goto_next, opts) + end, + }) + + -- Configure each LSP server + local lspconfig = require("lspconfig") + + -- Lua + lspconfig.lua_ls.setup({ + capabilities = capabilities, + settings = { + Lua = { + runtime = { version = "LuaJIT" }, + diagnostics = { globals = { "vim" } }, + workspace = { + library = vim.api.nvim_get_runtime_file("", true), + checkThirdParty = false, + }, + telemetry = { enable = false }, + }, }, - opts.servers or {} - ) - end, - config = function(_, opts) - if vim.fn.has("nvim-0.11") == 0 then - vim.notify("nvim-lspconfig requires Neovim 0.11+ for vim.lsp.config", vim.log.levels.ERROR) - return - end + }) - for name, server_opts in pairs(opts.servers or {}) do - if server_opts ~= false then - local config = type(server_opts) == "table" and vim.deepcopy(server_opts) or {} + -- Nix + lspconfig.nil_ls.setup({ + capabilities = capabilities, + settings = { + ["nil"] = { + formatting = { command = { "nixfmt" } }, + }, + }, + }) - if config.enabled ~= false then - config.enabled = nil + -- Python + lspconfig.pyright.setup({ + capabilities = capabilities, + settings = { + python = { + analysis = { + typeCheckingMode = "basic", + autoSearchPaths = true, + useLibraryCodeForTypes = true, + }, + }, + }, + }) - -- Integrate blink.cmp capabilities with LSP - local has_blink, blink = pcall(require, "blink.cmp") - if has_blink then - config.capabilities = blink.get_lsp_capabilities(config.capabilities) - end + -- TypeScript/JavaScript + lspconfig.ts_ls.setup({ + capabilities = capabilities, + }) - if next(config) ~= nil then - vim.lsp.config(name, config) - end + -- Rust + lspconfig.rust_analyzer.setup({ + capabilities = capabilities, + settings = { + ["rust-analyzer"] = { + checkOnSave = { command = "clippy" }, + }, + }, + }) - vim.lsp.enable(name) - end - end - end + -- Go + lspconfig.gopls.setup({ + capabilities = capabilities, + }) + + -- C/C++ + lspconfig.clangd.setup({ + capabilities = capabilities, + }) end, }, } diff --git a/modules/home/rsydn/programs/nvim/lua/plugins/coding.lua b/modules/home/rsydn/programs/nvim/lua/plugins/coding.lua index 3468c0f..39dcab5 100644 --- a/modules/home/rsydn/programs/nvim/lua/plugins/coding.lua +++ b/modules/home/rsydn/programs/nvim/lua/plugins/coding.lua @@ -58,11 +58,7 @@ return { end, config = function(_, opts) require("mini.ai").setup(opts) - LazyVim.on_load("which-key.nvim", function() - vim.schedule(function() - LazyVim.mini.ai_whichkey(opts) - end) - end) + -- mini.clue handles text object hints automatically end, }, diff --git a/modules/home/rsydn/programs/nvim/lua/plugins/colorscheme.lua b/modules/home/rsydn/programs/nvim/lua/plugins/colorscheme.lua index 4ac478e..56fb218 100644 --- a/modules/home/rsydn/programs/nvim/lua/plugins/colorscheme.lua +++ b/modules/home/rsydn/programs/nvim/lua/plugins/colorscheme.lua @@ -2,9 +2,13 @@ return { -- gruvbox { "ellisonleao/gruvbox.nvim", - lazy = true, + lazy = false, priority = 1000, opts = {}, + config = function() + require("gruvbox").setup({}) + vim.cmd.colorscheme("gruvbox") + end, }, -- tokyonight @@ -17,7 +21,7 @@ return { -- catppuccin { "catppuccin/nvim", - lazy = false, + lazy = true, priority = 1000, name = "catppuccin", opts = { diff --git a/modules/home/rsydn/programs/nvim/lua/plugins/completion.lua b/modules/home/rsydn/programs/nvim/lua/plugins/completion.lua index d9f297e..6890957 100644 --- a/modules/home/rsydn/programs/nvim/lua/plugins/completion.lua +++ b/modules/home/rsydn/programs/nvim/lua/plugins/completion.lua @@ -1,5 +1,6 @@ return { -- Modern completion engine with built-in fuzzy matching + -- Note: Installed via Nix with pre-built Rust backend (see neovim.nix) { "saghen/blink.cmp", dependencies = { @@ -7,6 +8,7 @@ return { }, version = "1.*", event = "InsertEnter", + build = nil, -- Disable build since Nix provides pre-compiled version opts = { -- Keymap preset options: 'default' | 'super-tab' | 'enter' keymap = { preset = "default" }, @@ -34,9 +36,11 @@ return { }, -- Fuzzy matching implementation - -- Options: "prefer_rust_with_warning" | "rust" | "lua" + -- Using "rust" since Nix provides pre-built native module fuzzy = { - implementation = "prefer_rust_with_warning", + use_typo_resistance = true, + use_frecency = true, + use_proximity = true, }, }, opts_extend = { "sources.default" }, diff --git a/modules/home/rsydn/programs/nvim/lua/plugins/file-explorer.lua b/modules/home/rsydn/programs/nvim/lua/plugins/file-explorer.lua index b9672f5..6b1bb5e 100644 --- a/modules/home/rsydn/programs/nvim/lua/plugins/file-explorer.lua +++ b/modules/home/rsydn/programs/nvim/lua/plugins/file-explorer.lua @@ -15,19 +15,15 @@ return { }, opts = { defaults = { - mappings = { - i = { - [""] = "which_key", - }, - }, + -- Removed which_key mapping - mini.clue handles keybind hints globally }, }, }, -- Telescope FZF native - Better sorting performance + -- Note: Installed via Nix (see neovim.nix) to avoid build issues { "nvim-telescope/telescope-fzf-native.nvim", - build = "make", dependencies = { "nvim-telescope/telescope.nvim" }, config = function() require("telescope").load_extension("fzf") diff --git a/modules/home/rsydn/programs/nvim/lua/plugins/formatting.lua b/modules/home/rsydn/programs/nvim/lua/plugins/formatting.lua new file mode 100644 index 0000000..2e8ed38 --- /dev/null +++ b/modules/home/rsydn/programs/nvim/lua/plugins/formatting.lua @@ -0,0 +1,59 @@ +return { + { + "stevearc/conform.nvim", + event = { "BufWritePre" }, + cmd = { "ConformInfo" }, + keys = { + { + "cf", + function() + require("conform").format({ async = true, lsp_fallback = true }) + end, + mode = { "n", "v" }, + desc = "Format buffer", + }, + }, + opts = { + formatters_by_ft = { + lua = { "stylua" }, + nix = { "nixfmt" }, + python = { "ruff_format", "ruff_organize_imports" }, + javascript = { "prettierd", "prettier", stop_after_first = true }, + typescript = { "prettierd", "prettier", stop_after_first = true }, + javascriptreact = { "prettierd", "prettier", stop_after_first = true }, + typescriptreact = { "prettierd", "prettier", stop_after_first = true }, + json = { "prettierd", "prettier", stop_after_first = true }, + jsonc = { "prettierd", "prettier", stop_after_first = true }, + yaml = { "prettierd", "prettier", stop_after_first = true }, + markdown = { "prettierd", "prettier", stop_after_first = true }, + html = { "prettierd", "prettier", stop_after_first = true }, + css = { "prettierd", "prettier", stop_after_first = true }, + scss = { "prettierd", "prettier", stop_after_first = true }, + rust = { "rustfmt" }, + go = { "gofumpt" }, + sh = { "shfmt" }, + bash = { "shfmt" }, + zsh = { "shfmt" }, + }, + -- Format on save + format_on_save = { + timeout_ms = 500, + lsp_fallback = true, + }, + -- Customize formatters + formatters = { + shfmt = { + prepend_args = { "-i", "2" }, -- 2 space indent + }, + ruff_format = { + command = "ruff", + args = { "format", "--stdin-filename", "$FILENAME" }, + }, + ruff_organize_imports = { + command = "ruff", + args = { "check", "--select", "I", "--fix", "--stdin-filename", "$FILENAME" }, + }, + }, + }, + }, +} diff --git a/modules/home/rsydn/programs/nvim/lua/plugins/linting.lua b/modules/home/rsydn/programs/nvim/lua/plugins/linting.lua index 28dbe19..e0b931a 100644 --- a/modules/home/rsydn/programs/nvim/lua/plugins/linting.lua +++ b/modules/home/rsydn/programs/nvim/lua/plugins/linting.lua @@ -5,10 +5,13 @@ return { opts = { events = { "BufWritePost", "BufReadPost", "InsertLeave" }, linters_by_ft = { - -- Add linters per filetype here - -- fish = { "fish" }, - -- javascript = { "eslint_d" }, - -- python = { "ruff" }, + javascript = { "eslint" }, + typescript = { "eslint" }, + javascriptreact = { "eslint" }, + typescriptreact = { "eslint" }, + python = { "ruff" }, + sh = { "shellcheck" }, + bash = { "shellcheck" }, }, linters = {}, }, @@ -26,21 +29,28 @@ return { lint.linters_by_ft = opts.linters_by_ft - -- Debounced lint function + -- Debounced lint function with proper timer management + local timer = vim.uv.new_timer() local function debounce_lint() - local timer = vim.uv.new_timer() - return function() - timer:start(100, 0, vim.schedule_wrap(lint.try_lint)) - end + -- Stop existing timer before starting new one to prevent EALREADY error + timer:stop() + timer:start(100, 0, vim.schedule_wrap(lint.try_lint)) end - local lint_fn = debounce_lint() - -- Create autocommand for linting vim.api.nvim_create_autocmd(opts.events, { group = vim.api.nvim_create_augroup("nvim-lint", { clear = true }), + callback = debounce_lint, + }) + + -- Clean up timer on exit + vim.api.nvim_create_autocmd("VimLeavePre", { + group = vim.api.nvim_create_augroup("nvim-lint-cleanup", { clear = true }), callback = function() - lint_fn() + if timer and not timer:is_closing() then + timer:stop() + timer:close() + end end, }) end, diff --git a/modules/home/rsydn/programs/nvim/lua/plugins/treesitter.lua b/modules/home/rsydn/programs/nvim/lua/plugins/treesitter.lua index 5bbd4a1..8573216 100644 --- a/modules/home/rsydn/programs/nvim/lua/plugins/treesitter.lua +++ b/modules/home/rsydn/programs/nvim/lua/plugins/treesitter.lua @@ -1,42 +1,51 @@ return { { "nvim-treesitter/nvim-treesitter", - version = false, - build = ":TSUpdate", - event = { "BufReadPost", "BufNewFile" }, - cmd = { "TSUpdateSync", "TSUpdate", "TSInstall" }, opts = { - highlight = { enable = true }, - indent = { enable = true }, ensure_installed = { "bash", "c", + "cpp", + "css", "diff", + "dockerfile", + "git_config", + "git_rebase", + "gitcommit", + "gitignore", + "go", + "gomod", + "gosum", "html", "javascript", "jsdoc", "json", "jsonc", + "latex", "lua", "luadoc", "luap", "markdown", "markdown_inline", + "nix", + "norg", "printf", "python", "query", "regex", + "rust", + "scss", + "svelte", "toml", "tsx", "typescript", + "typst", "vim", "vimdoc", + "vue", "xml", "yaml", }, }, - config = function(_, opts) - require("nvim-treesitter.configs").setup(opts) - end, }, } diff --git a/modules/home/rsydn/programs/nvim/lua/plugins/which-key.lua b/modules/home/rsydn/programs/nvim/lua/plugins/which-key.lua new file mode 100644 index 0000000..e79bf9a --- /dev/null +++ b/modules/home/rsydn/programs/nvim/lua/plugins/which-key.lua @@ -0,0 +1,78 @@ +return { + -- Disable which-key (we use mini.clue instead) + { "folke/which-key.nvim", enabled = false }, + + -- mini.clue - Lightweight keybind hints + { + "nvim-mini/mini.clue", + event = "VeryLazy", + config = function() + local miniclue = require("mini.clue") + miniclue.setup({ + triggers = { + -- Leader triggers + { mode = "n", keys = "" }, + { mode = "x", keys = "" }, + + -- Built-in completion + { mode = "i", keys = "" }, + + -- `g` key + { mode = "n", keys = "g" }, + { mode = "x", keys = "g" }, + + -- Marks + { mode = "n", keys = "'" }, + { mode = "n", keys = "`" }, + { mode = "x", keys = "'" }, + { mode = "x", keys = "`" }, + + -- Registers + { mode = "n", keys = '"' }, + { mode = "x", keys = '"' }, + { mode = "i", keys = "" }, + { mode = "c", keys = "" }, + + -- Window commands + { mode = "n", keys = "" }, + + -- `z` key + { mode = "n", keys = "z" }, + { mode = "x", keys = "z" }, + + -- Bracketed commands + { mode = "n", keys = "[" }, + { mode = "n", keys = "]" }, + }, + + clues = { + -- Enhance this by adding descriptions for mapping groups + miniclue.gen_clues.builtin_completion(), + miniclue.gen_clues.g(), + miniclue.gen_clues.marks(), + miniclue.gen_clues.registers(), + miniclue.gen_clues.windows(), + miniclue.gen_clues.z(), + + -- Custom leader key descriptions + { mode = "n", keys = "b", desc = "+buffer" }, + { mode = "n", keys = "c", desc = "+code" }, + { mode = "n", keys = "d", desc = "+diagnostics" }, + { mode = "n", keys = "e", desc = "+explorer" }, + { mode = "n", keys = "f", desc = "+find" }, + { mode = "n", keys = "o", desc = "+open" }, + { mode = "n", keys = "r", desc = "+rename" }, + { mode = "n", keys = "s", desc = "+search" }, + }, + + window = { + delay = 300, -- Show hints after 300ms + config = { + width = "auto", + border = "rounded", + }, + }, + }) + end, + }, +} diff --git a/modules/home/rsydn/shell/tmux.nix b/modules/home/rsydn/shell/tmux.nix index d71adbc..fc13357 100644 --- a/modules/home/rsydn/shell/tmux.nix +++ b/modules/home/rsydn/shell/tmux.nix @@ -18,6 +18,10 @@ ''; }]; extraConfig = '' + # Terminal configuration for proper colors and features + set-option -g default-terminal "screen-256color" + set-option -ga terminal-overrides ",*256col*:Tc" + set-option -g focus-events on set -s extended-keys on set -as terminal-features 'xterm-ghostty:extkeys' set-option -g status-style "bg=#282a36 fg=#f8f8f2"