kitty: tab style
This commit is contained in:
@@ -46,9 +46,15 @@ in
|
|||||||
copy_on_select = "yes";
|
copy_on_select = "yes";
|
||||||
strip_trailing_spaces = "smart";
|
strip_trailing_spaces = "smart";
|
||||||
tab_bar_style = "powerline";
|
tab_bar_style = "powerline";
|
||||||
|
tab_powerline_style = "round";
|
||||||
tab_bar_align = "left";
|
tab_bar_align = "left";
|
||||||
tab_bar_edge = "top";
|
tab_bar_edge = "top";
|
||||||
|
tab_bar_min_tabs = 1;
|
||||||
shell_integration = "enabled";
|
shell_integration = "enabled";
|
||||||
|
active_tab_foreground = "#eeeeee";
|
||||||
|
active_tab_background = "#d65d0e";
|
||||||
|
inactive_tab_foreground = "#ebdbb2";
|
||||||
|
inactive_tab_background = "#202020";
|
||||||
};
|
};
|
||||||
keybindings = {
|
keybindings = {
|
||||||
"ctrl+shift+n" = "new_window";
|
"ctrl+shift+n" = "new_window";
|
||||||
|
|||||||
+173
-62
@@ -1,13 +1,12 @@
|
|||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
c = config.theme.colors;
|
c = config.theme.colors;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
programs.neovim = {
|
programs.neovim = {
|
||||||
enable = true;
|
enable = true;
|
||||||
viAlias = true;
|
viAlias = true;
|
||||||
vimAlias = true;
|
vimAlias = true;
|
||||||
|
|
||||||
extraPackages = with pkgs; [
|
extraPackages = with pkgs; [
|
||||||
lua-language-server
|
lua-language-server
|
||||||
@@ -17,22 +16,125 @@ in
|
|||||||
fd
|
fd
|
||||||
];
|
];
|
||||||
|
|
||||||
|
# Set mapleader before any plugin config blocks run
|
||||||
|
extraConfig = ''
|
||||||
|
let g:mapleader = "\<Space>"
|
||||||
|
let g:maplocalleader = "\<Space>"
|
||||||
|
'';
|
||||||
|
|
||||||
plugins = with pkgs.vimPlugins; [
|
plugins = with pkgs.vimPlugins; [
|
||||||
# Gruvbox theme
|
# ── Core dependencies ──────────────────────────────────────────────
|
||||||
|
plenary-nvim
|
||||||
|
nvim-web-devicons
|
||||||
|
|
||||||
|
# ── Theme ──────────────────────────────────────────────────────────
|
||||||
gruvbox-nvim
|
gruvbox-nvim
|
||||||
|
|
||||||
# Treesitter — better syntax highlighting
|
# ── Syntax highlighting ────────────────────────────────────────────
|
||||||
{
|
{
|
||||||
plugin = nvim-treesitter.withAllGrammars;
|
plugin = nvim-treesitter.withAllGrammars;
|
||||||
type = "lua";
|
type = "lua";
|
||||||
config = ''
|
config = ''
|
||||||
require("nvim-treesitter").setup({
|
require("nvim-treesitter").setup({
|
||||||
highlight = { enable = true },
|
highlight = { enable = true },
|
||||||
indent = { enable = true },
|
indent = { enable = true },
|
||||||
})
|
})
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
# File explorer
|
|
||||||
|
# ── Completion (must come before lspconfig) ────────────────────────
|
||||||
|
luasnip
|
||||||
|
cmp-nvim-lsp
|
||||||
|
cmp-buffer
|
||||||
|
cmp-path
|
||||||
|
cmp_luasnip
|
||||||
|
{
|
||||||
|
plugin = nvim-cmp;
|
||||||
|
type = "lua";
|
||||||
|
config = ''
|
||||||
|
local cmp = require("cmp")
|
||||||
|
local luasnip = require("luasnip")
|
||||||
|
|
||||||
|
cmp.setup({
|
||||||
|
snippet = {
|
||||||
|
expand = function(args)
|
||||||
|
luasnip.lsp_expand(args.body)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
mapping = cmp.mapping.preset.insert({
|
||||||
|
["<C-Space>"] = cmp.mapping.complete(),
|
||||||
|
["<C-e>"] = cmp.mapping.abort(),
|
||||||
|
["<CR>"] = cmp.mapping.confirm({ select = false }),
|
||||||
|
["<Tab>"] = cmp.mapping(function(fallback)
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.select_next_item()
|
||||||
|
elseif luasnip.expand_or_jumpable() then
|
||||||
|
luasnip.expand_or_jump()
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, { "i", "s" }),
|
||||||
|
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.select_prev_item()
|
||||||
|
elseif luasnip.jumpable(-1) then
|
||||||
|
luasnip.jump(-1)
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, { "i", "s" }),
|
||||||
|
}),
|
||||||
|
sources = cmp.config.sources({
|
||||||
|
{ name = "nvim_lsp" },
|
||||||
|
{ name = "luasnip" },
|
||||||
|
{ name = "buffer" },
|
||||||
|
{ name = "path" },
|
||||||
|
}),
|
||||||
|
})
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
# ── LSP ────────────────────────────────────────────────────────────
|
||||||
|
{
|
||||||
|
plugin = nvim-lspconfig;
|
||||||
|
type = "lua";
|
||||||
|
config = ''
|
||||||
|
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd("LspAttach", {
|
||||||
|
callback = function(event)
|
||||||
|
local map = function(keys, func, desc)
|
||||||
|
vim.keymap.set("n", keys, func, { buffer = event.buf, desc = desc })
|
||||||
|
end
|
||||||
|
map("gd", vim.lsp.buf.definition, "Go to definition")
|
||||||
|
map("gr", vim.lsp.buf.references, "Find references")
|
||||||
|
map("K", vim.lsp.buf.hover, "Hover docs")
|
||||||
|
map("<leader>rn", vim.lsp.buf.rename, "Rename symbol")
|
||||||
|
map("<leader>ca", vim.lsp.buf.code_action, "Code action")
|
||||||
|
map("<leader>ld", vim.diagnostic.open_float, "Show diagnostics")
|
||||||
|
map("<leader>ln", vim.diagnostic.goto_next, "Next diagnostic")
|
||||||
|
map("<leader>lp", vim.diagnostic.goto_prev, "Prev diagnostic")
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.lsp.config("lua_ls", {
|
||||||
|
capabilities = capabilities,
|
||||||
|
settings = {
|
||||||
|
Lua = {
|
||||||
|
diagnostics = { globals = { "vim" } },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
vim.lsp.enable("lua_ls")
|
||||||
|
|
||||||
|
vim.lsp.config("nil_ls", {
|
||||||
|
capabilities = capabilities,
|
||||||
|
})
|
||||||
|
vim.lsp.enable("nil_ls")
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
# ── File explorer ──────────────────────────────────────────────────
|
||||||
{
|
{
|
||||||
plugin = nvim-tree-lua;
|
plugin = nvim-tree-lua;
|
||||||
type = "lua";
|
type = "lua";
|
||||||
@@ -42,42 +144,73 @@ in
|
|||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
||||||
# Statusline
|
# ── Statusline ─────────────────────────────────────────────────────
|
||||||
{
|
{
|
||||||
plugin = lualine-nvim;
|
plugin = lualine-nvim;
|
||||||
type = "lua";
|
type = "lua";
|
||||||
config = ''
|
config = ''
|
||||||
require("lualine").setup({
|
require("lualine").setup({
|
||||||
options = {
|
options = { theme = "gruvbox-material" },
|
||||||
theme = "gruvbox-material",
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
||||||
# Icons (needed by nvim-tree and lualine)
|
# ── Buffer tabs ────────────────────────────────────────────────────
|
||||||
nvim-web-devicons
|
{
|
||||||
|
plugin = bufferline-nvim;
|
||||||
|
type = "lua";
|
||||||
|
config = ''
|
||||||
|
require("bufferline").setup()
|
||||||
|
vim.keymap.set("n", "<S-l>", "<cmd>BufferLineCycleNext<cr>", { desc = "Next buffer" })
|
||||||
|
vim.keymap.set("n", "<S-h>", "<cmd>BufferLineCyclePrev<cr>", { desc = "Prev buffer" })
|
||||||
|
vim.keymap.set("n", "<leader>x", "<cmd>bdelete<cr>", { desc = "Close buffer" })
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
# Fuzzy finder
|
# ── Fuzzy finder ───────────────────────────────────────────────────
|
||||||
{
|
{
|
||||||
plugin = telescope-nvim;
|
plugin = telescope-nvim;
|
||||||
type = "lua";
|
type = "lua";
|
||||||
config = ''
|
config = ''
|
||||||
local builtin = require("telescope.builtin")
|
local builtin = require("telescope.builtin")
|
||||||
vim.keymap.set("n", "<leader>ff", builtin.find_files)
|
vim.keymap.set("n", "<leader>ff", builtin.find_files, { desc = "Find files" })
|
||||||
vim.keymap.set("n", "<leader>fg", builtin.live_grep)
|
vim.keymap.set("n", "<leader>fg", builtin.live_grep, { desc = "Live grep" })
|
||||||
vim.keymap.set("n", "<leader>fb", builtin.buffers)
|
vim.keymap.set("n", "<leader>fb", builtin.buffers, { desc = "Find buffers" })
|
||||||
|
vim.keymap.set("n", "<leader>fr", builtin.oldfiles, { desc = "Recent files" })
|
||||||
|
vim.keymap.set("n", "<leader>fs", builtin.grep_string, { desc = "Find word under cursor" })
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
||||||
# Comment toggling
|
# ── Git ────────────────────────────────────────────────────────────
|
||||||
|
{
|
||||||
|
plugin = gitsigns-nvim;
|
||||||
|
type = "lua";
|
||||||
|
config = ''
|
||||||
|
require("gitsigns").setup({
|
||||||
|
on_attach = function(bufnr)
|
||||||
|
local gs = require("gitsigns")
|
||||||
|
local map = function(mode, keys, func, desc)
|
||||||
|
vim.keymap.set(mode, keys, func, { buffer = bufnr, desc = desc })
|
||||||
|
end
|
||||||
|
map("n", "<leader>gn", gs.next_hunk, "Next hunk")
|
||||||
|
map("n", "<leader>gp", gs.prev_hunk, "Prev hunk")
|
||||||
|
map("n", "<leader>gh", gs.preview_hunk, "Preview hunk")
|
||||||
|
map("n", "<leader>gb", gs.blame_line, "Blame line")
|
||||||
|
map("n", "<leader>gs", gs.stage_hunk, "Stage hunk")
|
||||||
|
map("n", "<leader>gr", gs.reset_hunk, "Reset hunk")
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
# ── Comment toggling ───────────────────────────────────────────────
|
||||||
{
|
{
|
||||||
plugin = comment-nvim;
|
plugin = comment-nvim;
|
||||||
type = "lua";
|
type = "lua";
|
||||||
config = ''require("Comment").setup()'';
|
config = ''require("Comment").setup()'';
|
||||||
}
|
}
|
||||||
|
|
||||||
# Show indentation guides
|
# ── Indentation guides ─────────────────────────────────────────────
|
||||||
{
|
{
|
||||||
plugin = indent-blankline-nvim;
|
plugin = indent-blankline-nvim;
|
||||||
type = "lua";
|
type = "lua";
|
||||||
@@ -86,61 +219,39 @@ in
|
|||||||
];
|
];
|
||||||
|
|
||||||
initLua = ''
|
initLua = ''
|
||||||
-- Leader key
|
|
||||||
vim.g.mapleader = " "
|
|
||||||
|
|
||||||
-- Colorscheme
|
|
||||||
require("gruvbox").setup({
|
require("gruvbox").setup({
|
||||||
contrast = "medium",
|
contrast = "medium",
|
||||||
transparent_mode = false,
|
transparent_mode = false,
|
||||||
})
|
})
|
||||||
vim.cmd("colorscheme gruvbox")
|
vim.cmd("colorscheme gruvbox")
|
||||||
|
|
||||||
-- Line numbers
|
|
||||||
vim.opt.number = true
|
vim.opt.number = true
|
||||||
vim.opt.relativenumber = true
|
vim.opt.relativenumber = true
|
||||||
|
vim.opt.tabstop = 2
|
||||||
|
vim.opt.shiftwidth = 2
|
||||||
|
vim.opt.expandtab = true
|
||||||
|
vim.opt.smartindent = true
|
||||||
|
vim.opt.ignorecase = true
|
||||||
|
vim.opt.smartcase = true
|
||||||
|
vim.opt.hlsearch = false
|
||||||
|
vim.opt.termguicolors = true
|
||||||
|
vim.opt.signcolumn = "yes"
|
||||||
|
vim.opt.cursorline = true
|
||||||
|
vim.opt.scrolloff = 8
|
||||||
|
vim.opt.wrap = false
|
||||||
|
vim.opt.splitright = true
|
||||||
|
vim.opt.splitbelow = true
|
||||||
|
vim.opt.clipboard = "unnamedplus"
|
||||||
|
|
||||||
-- Indentation
|
|
||||||
vim.opt.tabstop = 2
|
|
||||||
vim.opt.shiftwidth = 2
|
|
||||||
vim.opt.expandtab = true
|
|
||||||
vim.opt.smartindent = true
|
|
||||||
|
|
||||||
-- Search
|
|
||||||
vim.opt.ignorecase = true
|
|
||||||
vim.opt.smartcase = true
|
|
||||||
vim.opt.hlsearch = false
|
|
||||||
|
|
||||||
-- UI
|
|
||||||
vim.opt.termguicolors = true
|
|
||||||
vim.opt.signcolumn = "yes"
|
|
||||||
vim.opt.cursorline = true
|
|
||||||
vim.opt.scrolloff = 8
|
|
||||||
vim.opt.wrap = false
|
|
||||||
vim.opt.splitright = true
|
|
||||||
vim.opt.splitbelow = true
|
|
||||||
|
|
||||||
-- System clipboard
|
|
||||||
vim.opt.clipboard = "unnamedplus"
|
|
||||||
|
|
||||||
-- Keymaps
|
|
||||||
local map = vim.keymap.set
|
local map = vim.keymap.set
|
||||||
|
|
||||||
-- Better window navigation
|
|
||||||
map("n", "<C-h>", "<C-w>h")
|
map("n", "<C-h>", "<C-w>h")
|
||||||
map("n", "<C-j>", "<C-w>j")
|
map("n", "<C-j>", "<C-w>j")
|
||||||
map("n", "<C-k>", "<C-w>k")
|
map("n", "<C-k>", "<C-w>k")
|
||||||
map("n", "<C-l>", "<C-w>l")
|
map("n", "<C-l>", "<C-w>l")
|
||||||
|
|
||||||
-- Move lines up/down in visual mode
|
|
||||||
map("v", "J", ":m '>+1<cr>gv=gv")
|
map("v", "J", ":m '>+1<cr>gv=gv")
|
||||||
map("v", "K", ":m '<-2<cr>gv=gv")
|
map("v", "K", ":m '<-2<cr>gv=gv")
|
||||||
|
|
||||||
-- Keep cursor centered when scrolling
|
|
||||||
map("n", "<C-d>", "<C-d>zz")
|
map("n", "<C-d>", "<C-d>zz")
|
||||||
map("n", "<C-u>", "<C-u>zz")
|
map("n", "<C-u>", "<C-u>zz")
|
||||||
|
|
||||||
-- Save and quit
|
|
||||||
map("n", "<leader>w", "<cmd>w<cr>")
|
map("n", "<leader>w", "<cmd>w<cr>")
|
||||||
map("n", "<leader>q", "<cmd>q<cr>")
|
map("n", "<leader>q", "<cmd>q<cr>")
|
||||||
'';
|
'';
|
||||||
|
|||||||
Reference in New Issue
Block a user