Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -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
);
Expand Down
102 changes: 95 additions & 7 deletions homeConfigurations/profiles/common_neovim.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 <Esc> exits
-- vim mode in the shell, but doesn't exit Neovim's terminal mode, causing confusion.
--
-- Solution: Use double escape and <C-w> mappings for easy terminal navigation
-- without conflicting with shell vim mode.
--
-- Keybindings:
-- <Esc><Esc> - Exit terminal mode (first Esc exits shell vim, second exits terminal)
-- <C-w>h/j/k/l - Navigate to left/down/up/right window directly from terminal
-- <C-w> - Access all window commands (then use any <C-w> command)
--
-- Default Neovim way (<C-\><C-n>) still works but is harder to type.

vim.keymap.set('t', '<Esc><Esc>', '<C-\\><C-n>', { desc = 'Exit terminal mode' })
vim.keymap.set('t', '<C-w>', '<C-\\><C-n><C-w>', { desc = 'Window commands from terminal' })
vim.keymap.set('t', '<C-w>h', '<C-\\><C-n><C-w>h', { desc = 'Move to left window' })
vim.keymap.set('t', '<C-w>j', '<C-\\><C-n><C-w>j', { desc = 'Move to bottom window' })
vim.keymap.set('t', '<C-w>k', '<C-\\><C-n><C-w>k', { desc = 'Move to top window' })
vim.keymap.set('t', '<C-w>l', '<C-\\><C-n><C-w>l', { desc = 'Move to right window' })
'';

programs.neovim.plugins =
Expand Down Expand Up @@ -441,7 +462,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
})
Expand Down Expand Up @@ -1004,6 +1031,68 @@
# <leader>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 <name>
# - Tab names persist in sessions (add 'globals' to sessionoptions)
# - Declarative, highly customizable tabline
# - Use tabs as workspace multiplexer (one tab per project)
# Keybindings:
# :TabRename <name> - Rename current tab
# <leader>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({
{ "<leader>t", group = "Terminal/Tabs" },
{ "<leader>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:
# <leader>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({
{ "<leader>bt", "<cmd>lua require('telescope-tabs').list_tabs()<cr>", desc = "Browse Tabs" },
})
'';
}

# Navigation using Telescope
# https://github.com/nvim-telescope/telescope.nvim/

Expand Down Expand Up @@ -1125,21 +1214,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: <leader>ac (open Claude), <leader>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
},
})

Expand Down
Loading