From 3788b9d414279bad8595009d357b16155329117d Mon Sep 17 00:00:00 2001 From: Rok Garbas Date: Mon, 29 Dec 2025 03:40:06 +0100 Subject: [PATCH 1/3] feat(neovim): open terminals in vertical split on right side Configure both snacks terminal and claude-code terminal to open on the right side in vertical split (40% width) instead of floating windows. - snacks terminal: add win.position="right" and win.width=0.4 - claude-code: change from floating to position="vertical" with split_ratio=0.4 --- homeConfigurations/profiles/common_neovim.nix | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/homeConfigurations/profiles/common_neovim.nix b/homeConfigurations/profiles/common_neovim.nix index 4bb7fb8..01ec2de 100644 --- a/homeConfigurations/profiles/common_neovim.nix +++ b/homeConfigurations/profiles/common_neovim.nix @@ -441,7 +441,13 @@ quickfile = { enabled = true }, scroll = { enabled = true }, statuscolumn = { enabled = true }, - terminal = { enabled = true }, -- Replaces toggleterm-nvim + terminal = { + enabled = true, + win = { + position = "right", -- Open terminal on the right side + width = 0.4, -- 40% of screen width + }, + }, words = { enabled = true }, zen = { enabled = true }, -- Replaces zen-mode.nvim }) @@ -1125,21 +1131,20 @@ # Used by: telescope, gitsigns, claude-code, and many other plugins plenary-nvim - # Claude Code CLI integration - opens Claude Code in floating terminal + # Claude Code CLI integration - opens Claude Code in vertical split terminal # https://github.com/greggh/claude-code.nvim # Keybindings: ac (open Claude), at (toggle) - # Features: 90% screen floating window, persistent terminal, quick AI access + # Features: Right-side vertical split (40% width), persistent terminal, quick AI access { plugin = claude-code-nvim; type = "lua"; config = # lua '' require('claude-code').setup({ - -- Use floating window for Claude Code terminal + -- Use vertical split on the right for Claude Code terminal window = { - type = "float", - width = 0.9, - height = 0.9, + position = "vertical", -- Opens on the right side + split_ratio = 0.4, -- 40% of screen width }, }) From 2b7b4049effc11b282e3ec311cc3f59e0de8e6fc Mon Sep 17 00:00:00 2001 From: Rok Garbas Date: Mon, 29 Dec 2025 03:45:18 +0100 Subject: [PATCH 2/3] feat(neovim): add terminal mode keybindings for vim mode shells Add terminal mode keybindings that don't conflict with vim mode in zsh and Claude Code CLI. New keybindings: - : Exit terminal mode (double escape) - h/j/k/l: Navigate windows directly from terminal mode - : Access all window commands from terminal This solves the issue where single Esc exits shell vim mode but leaves user stuck in Neovim terminal mode, causing confusion. --- homeConfigurations/profiles/common_neovim.nix | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/homeConfigurations/profiles/common_neovim.nix b/homeConfigurations/profiles/common_neovim.nix index 01ec2de..6e0f2c7 100644 --- a/homeConfigurations/profiles/common_neovim.nix +++ b/homeConfigurations/profiles/common_neovim.nix @@ -164,6 +164,27 @@ -- Use the system clipboard o.clipboard = "unnamed" + + -- Terminal mode keybindings + -- Problem: When using vim mode in zsh or Claude Code CLI, single exits + -- vim mode in the shell, but doesn't exit Neovim's terminal mode, causing confusion. + -- + -- Solution: Use double escape and mappings for easy terminal navigation + -- without conflicting with shell vim mode. + -- + -- Keybindings: + -- - Exit terminal mode (first Esc exits shell vim, second exits terminal) + -- h/j/k/l - Navigate to left/down/up/right window directly from terminal + -- - Access all window commands (then use any command) + -- + -- Default Neovim way () still works but is harder to type. + + vim.keymap.set('t', '', '', { desc = 'Exit terminal mode' }) + vim.keymap.set('t', '', '', { desc = 'Window commands from terminal' }) + vim.keymap.set('t', 'h', 'h', { desc = 'Move to left window' }) + vim.keymap.set('t', 'j', 'j', { desc = 'Move to bottom window' }) + vim.keymap.set('t', 'k', 'k', { desc = 'Move to top window' }) + vim.keymap.set('t', 'l', 'l', { desc = 'Move to right window' }) ''; programs.neovim.plugins = From c2357bf72403886d2de459f68b9c6487d12559c0 Mon Sep 17 00:00:00 2001 From: Rok Garbas Date: Mon, 29 Dec 2025 04:05:51 +0100 Subject: [PATCH 3/3] feat(neovim): add tabby.nvim with telescope integration for tab management Add comprehensive tab management with custom tab names and telescope integration for fuzzy searching/switching between tabs. Changes: - Add tabby.nvim for custom tab names and beautiful tabline - Add telescope-tabs as custom plugin for tab browsing - Configure telescope-tabs to display tab names from tabby.nvim - Add 'globals' to sessionoptions to persist tab names - Disable doCheck for telescope-tabs (requires telescope at runtime) New keybindings: - tr: Rename current tab - bt: Browse/switch tabs with Telescope - :TabRename : Direct command to rename tab Tab names now persist across sessions and can be searched with fuzzy finding via Telescope. --- flake.lock | 19 +++++- flake.nix | 4 ++ homeConfigurations/profiles/common_neovim.nix | 62 +++++++++++++++++++ 3 files changed, 84 insertions(+), 1 deletion(-) diff --git a/flake.lock b/flake.lock index bee2683..341df55 100644 --- a/flake.lock +++ b/flake.lock @@ -437,7 +437,8 @@ "nix-darwin": "nix-darwin", "nixos-hardware": "nixos-hardware", "nixpkgs-unstable": "nixpkgs-unstable", - "vimPlugin-auto-dark-mode": "vimPlugin-auto-dark-mode" + "vimPlugin-auto-dark-mode": "vimPlugin-auto-dark-mode", + "vimPlugin-telescope-tabs": "vimPlugin-telescope-tabs" } }, "rust-analyzer-src": { @@ -520,6 +521,22 @@ "repo": "auto-dark-mode.nvim", "type": "github" } + }, + "vimPlugin-telescope-tabs": { + "flake": false, + "locked": { + "lastModified": 1756725211, + "narHash": "sha256-5NpH9+0ECrcKi8quPLpCHLSPTuzGETWtq4E+2jqUKio=", + "owner": "LukasPietzschmann", + "repo": "telescope-tabs", + "rev": "777b1f630f3d6a12a2e71635a82581c988d6da2e", + "type": "github" + }, + "original": { + "owner": "LukasPietzschmann", + "repo": "telescope-tabs", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index c1a3856..7d37f2a 100644 --- a/flake.nix +++ b/flake.nix @@ -40,6 +40,8 @@ # Custom vim/neovim plugins inputs.vimPlugin-auto-dark-mode.url = "github:f-person/auto-dark-mode.nvim"; inputs.vimPlugin-auto-dark-mode.flake = false; + inputs.vimPlugin-telescope-tabs.url = "github:LukasPietzschmann/telescope-tabs"; + inputs.vimPlugin-telescope-tabs.flake = false; inputs.flox.url = "github:flox/flox/release-1.7.9"; @@ -83,6 +85,8 @@ pname = normalizeName name; version = toPluginVersion inputs.${name}; src = inputs.${name}; + # Disable require check for telescope-tabs (needs telescope.nvim at runtime) + doCheck = if name == "vimPlugin-telescope-tabs" then false else true; }; }) pluginsNames ); diff --git a/homeConfigurations/profiles/common_neovim.nix b/homeConfigurations/profiles/common_neovim.nix index 6e0f2c7..ca0cc5b 100644 --- a/homeConfigurations/profiles/common_neovim.nix +++ b/homeConfigurations/profiles/common_neovim.nix @@ -1031,6 +1031,68 @@ # A - swap parameter with previous nvim-treesitter-textobjects + # -- TABS / TABLINE ----------------------------------------------------- + + # Highly configurable tabline plugin with custom tab names + # https://github.com/nanozuki/tabby.nvim + # Features: + # - Custom tab names with :TabRename + # - Tab names persist in sessions (add 'globals' to sessionoptions) + # - Declarative, highly customizable tabline + # - Use tabs as workspace multiplexer (one tab per project) + # Keybindings: + # :TabRename - Rename current tab + # tr - Rename tab (mapped below) + { + plugin = tabby-nvim; + type = "lua"; + config = # lua + '' + require('tabby').setup({ + preset = 'active_wins_at_tail', -- Show active windows in each tab + }) + + -- Add 'globals' to sessionoptions to persist tab names + vim.opt.sessionoptions:append("globals") + + require("which-key").add({ + { "t", group = "Terminal/Tabs" }, + { "tr", ":TabRename ", desc = "Rename Tab" }, + }) + ''; + } + + # Telescope extension for switching between tabs + # https://github.com/LukasPietzschmann/telescope-tabs + # Features: + # - Fuzzy search through tabs + # - Shows tab names from tabby.nvim + # - Smart tab history (last shown tab stack) + # Keybindings: + # bt - Browse tabs with telescope + { + plugin = custom-telescope-tabs; + type = "lua"; + config = # lua + '' + require('telescope-tabs').setup({ + -- Display tab names from tabby.nvim + entry_formatter = function(tab_id, buffer_ids, file_names, file_paths, is_current) + local tab_name = require('tabby.feature.tab_name').get(tab_id) + local marker = is_current and ' <' or "" + return string.format('%d: %s%s', tab_id, tab_name, marker) + end, + entry_ordinal = function(tab_id, buffer_ids, file_names, file_paths, is_current) + return require('tabby.feature.tab_name').get(tab_id) + end, + }) + + require("which-key").add({ + { "bt", "lua require('telescope-tabs').list_tabs()", desc = "Browse Tabs" }, + }) + ''; + } + # Navigation using Telescope # https://github.com/nvim-telescope/telescope.nvim/