From 04d720f6c84d52445a0808fffae553b37408a4a2 Mon Sep 17 00:00:00 2001 From: pablu Date: Fri, 19 Jun 2026 00:37:46 +0200 Subject: only smart-nav on gentoo, and not on other systems, same with tmux navigation --- dot_config/nvim/init.lua | 260 -------------------------- dot_config/nvim/init.lua.tmpl | 287 +++++++++++++++++++++++++++++ dot_config/nvim/lua/plugins/catppuccin.lua | 6 +- dot_config/nvim/lua/plugins/dap.lua | 44 +++-- dot_config/nvim/lua/plugins/lsp.lua | 2 +- dot_config/nvim/lua/plugins/lualine.lua | 10 - dot_config/nvim/lua/plugins/telescope.lua | 6 +- dot_config/nvim/lua/plugins/tmux.lua | 15 -- dot_config/nvim/lua/plugins/tmux.lua.tmpl | 19 ++ dot_config/nvim/lua/plugins/which-key.lua | 9 +- 10 files changed, 337 insertions(+), 321 deletions(-) delete mode 100644 dot_config/nvim/init.lua create mode 100644 dot_config/nvim/init.lua.tmpl delete mode 100644 dot_config/nvim/lua/plugins/tmux.lua create mode 100644 dot_config/nvim/lua/plugins/tmux.lua.tmpl diff --git a/dot_config/nvim/init.lua b/dot_config/nvim/init.lua deleted file mode 100644 index b618040..0000000 --- a/dot_config/nvim/init.lua +++ /dev/null @@ -1,260 +0,0 @@ -local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not (vim.uv or vim.loop).fs_stat(lazypath) then - vim.fn.system({ - "git", - "clone", - "--filter=blob:none", - "https://github.com/folke/lazy.nvim.git", - "--branch=stable", -- latest stable release - lazypath, - }) -end -vim.opt.rtp:prepend(lazypath) - -require("vim-options") -require("lazy").setup("plugins") - -vim.o.number = true -vim.o.relativenumber = true - -vim.filetype.add({ - extension = { - gotmpl = 'gotmpl', - }, - pattern = { - [".*%.gohtml"] = "gotmpl", - [".*%.gotmpl"] = "gotmpl" - } -}) - --- Panes -vim.cmd.set("splitright") -vim.keymap.set("n", "/", function() - vim.cmd.vnew() -end, { desc = "Pane split right" }) - -vim.cmd.set("splitbelow") -vim.keymap.set("n", "-", function() - vim.cmd.new() -end, { desc = "Pane split down" }) - -local function smart_move(direction, vim_cmd) - return function() - local before = vim.api.nvim_get_current_win() - - vim.cmd("wincmd " .. vim_cmd) - - if before == vim.api.nvim_get_current_win() then - vim.system({ - "hyprctl", - "dispatch", - string.format( - "hl.dsp.focus({direction = '%s' })", - direction - ) - }) - end - end -end - -vim.keymap.set('n', '', smart_move("left", "h"), { noremap = true, silent = false, desc = "Move to left windows" }); -vim.keymap.set('n', '', smart_move("right", "l"), { noremap = true, silent = false, desc = "Move to right windows" }); -vim.keymap.set('n', '', smart_move("down", "j"), { noremap = true, silent = false, desc = "Move to down window" }); -vim.keymap.set('n', '', smart_move("up", "k"), { noremap = true, silent = false, desc = "Move to up window" }); - -vim.api.nvim_set_keymap('n', 'gb', ':bnext', { noremap = true, silent = true, desc = "Go back last buffer" }); - -vim.api.nvim_set_keymap('t', '', '', { noremap = true, silent = true, desc = "Escape Terminal" }); -vim.api.nvim_create_autocmd('TermOpen', { - group = vim.api.nvim_create_augroup('custom-term-open', { clear = true }), - callback = function() - vim.opt.number = false - vim.opt.relativenumber = false - end, -}); - - --- Telescope -local builtin = require("telescope.builtin") -vim.keymap.set('n', 'fg', function() builtin.live_grep({ glob_pattern = "!*_templ.go" }) end, - { desc = "Telescope live grep" }) -vim.keymap.set('n', 'gl', builtin.lsp_references, { desc = "Telescope show references" }) -vim.keymap.set('n', 'fx', builtin.diagnostics, { desc = "Telescope open diagnostics" }) -vim.keymap.set('n', 'ff', builtin.find_files, { desc = "Telescope find files" }) -vim.keymap.set('n', 'fb', builtin.buffers, { desc = "Telescope open buffers" }) - --- Formating -vim.keymap.set("n", "gf", function() - require("conform").format({ lsp_format = "fallback" }) -end, { desc = "Format buffer" }) - --- Filesystem -vim.keymap.set("n", "e", ":Oil", { desc = "Open file explorer: OIL" }) - --- Neotest -local neotest = require("neotest") -vim.keymap.set("n", "ts", function() - neotest.summary.toggle() -end, { desc = "Neotest open summary" }) -vim.keymap.set("n", "to", neotest.output.open, { desc = "Neotest open output" }) -vim.keymap.set("n", "td", function() neotest.run.run({ suite = false, strategy = "dap" }) end, - { desc = "Neotest debug closest test" }) -vim.keymap.set("n", "tr", function() neotest.run.run({ suite = false }) end, - { desc = "Neotest run closest test" }) - --- Debugging -local dap = require("dap") -vim.keymap.set("n", "db", dap.toggle_breakpoint, - { nowait = true, remap = false, desc = "Debug toggle breakpoint" }) -vim.keymap.set("n", "dc", dap.continue, { nowait = true, remap = false, desc = "Debug continue" }) -vim.keymap.set("n", "di", dap.step_into, { nowait = true, remap = false, desc = "Debug step into" }) -vim.keymap.set("n", "do", dap.step_over, { nowait = true, remap = false, desc = "Debug step over" }) -vim.keymap.set("n", "dr", dap.repl.open, { nowait = true, remap = false, desc = "Debug open repl" }) -vim.keymap.set("n", "dq", function() - dap.terminate() - require("dapui").close() - require("nvim-dap-virtual-text").toggle() -end, { nowait = true, remap = false, desc = "Debug close" }) -vim.keymap.set("n", "dl", dap.list_breakpoints, { nowait = true, remap = false, desc = "Debug list breakpoints" }) - -local function read_pyproject() - local results = vim.fs.find("pyproject.toml", { upward = true, stop = vim.loop.os_homedir() }) - local path = results[1] - if not path then - return nil - end - - local ok, lines = pcall(vim.fn.readfile, path) - if not ok then - return nil - end - - return table.concat(lines, "\n") -end - -local function get_scripts_from_pyproject() - local pyproject = read_pyproject() - if not pyproject then - return {} - end - - local scripts = {} - - -- Match [tool.poetry.scripts] - for script_line in pyproject:gmatch("%[tool%.poetry%.scripts%][^\n]*\n([^%[]*)") do - for name, module in script_line:gmatch('([%w_%-]+)%s*=%s*"([^"]+)"') do - scripts[name] = module - end - end - - -- Match [project.scripts] - for script_line in pyproject:gmatch("%[project%.scripts%][^\n]*\n([^%[]*)") do - for name, module in script_line:gmatch('([%w_%-]+)%s*=%s*"([^"]+)"') do - scripts[name] = module - end - end - - return scripts -end - -local function get_python_path() - local cwd = vim.fn.getcwd() - if vim.fn.executable(cwd .. "/venv/bin/python") == 1 then - return cwd .. "/venv/bin/python" - elseif vim.fn.executable(cwd .. "/.venv/bin/python") == 1 then - return cwd .. "/.venv/bin/python" - else - return vim.fn.exepath("python") - end -end - --- Store last used parameters for quick reuse -local last_params = {} - -vim.keymap.set("n", "dps", function() - local scripts = get_scripts_from_pyproject() - - if vim.tbl_isempty(scripts) then - vim.notify("No scripts found in pyproject.toml", vim.log.levels.WARN) - return - end - - local script_names = vim.tbl_keys(scripts) - table.sort(script_names) - - local function start_debug(script_name, module, args_str) - local package = module:match("^([^:]+)") - - -- Parse arguments string into table - local args = {} - if args_str and args_str ~= "" then - for arg in args_str:gmatch("%S+") do - table.insert(args, arg) - end - end - - -- Store for quick reuse - last_params[script_name] = args_str or "" - - vim.notify( - "Debugging: " .. script_name .. (args_str and (" with args: " .. args_str) or ""), - vim.log.levels.INFO - ) - - local dap = require("dap") - dap.configurations.python = { - { - type = "python", - request = "launch", - name = "Debug: " .. script_name, - module = package, - args = args, - pythonPath = get_python_path(), - justMyCode = false, - console = "integratedTerminal", - }, - } - dap.continue() - end - - local function show_param_input(script_name, module) - -- Show input dialog for parameters - vim.ui.input({ - prompt = "Arguments for " .. script_name .. ": ", - default = last_params[script_name] or "", - completion = "file", - }, function(args_str) - if args_str ~= nil then -- nil = cancelled, "" = empty input is OK - start_debug(script_name, module, args_str) - end - end) - end - - local function select_script() - if #script_names == 1 then - show_param_input(script_names[1], scripts[script_names[1]]) - else - vim.ui.select(script_names, { - prompt = "Select script to debug: ", - format_item = function(item) - return item .. " → " .. scripts[item] - end, - }, function(selected) - if selected then - show_param_input(selected, scripts[selected]) - end - end) - end - end - - select_script() -end, { desc = "Debug Python script from pyproject.toml" }) --- Lsp Config -vim.keymap.set("n", "K", vim.lsp.buf.hover, { desc = "Show hover information" }) -vim.keymap.set("n", "gd", vim.lsp.buf.definition, { desc = "Goto definition" }) -vim.keymap.set({ "n", "v" }, "ca", vim.lsp.buf.code_action, { desc = "LSP code action" }) -vim.keymap.set("n", "cr", vim.lsp.buf.rename, { desc = "LSP rename" }) - --- Motions -vim.keymap.set("n", "", "zz", {}) -vim.keymap.set("n", "", "zz", {}) diff --git a/dot_config/nvim/init.lua.tmpl b/dot_config/nvim/init.lua.tmpl new file mode 100644 index 0000000..2f6aa79 --- /dev/null +++ b/dot_config/nvim/init.lua.tmpl @@ -0,0 +1,287 @@ +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not (vim.uv or vim.loop).fs_stat(lazypath) then + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", -- latest stable release + lazypath, + }) +end +vim.opt.rtp:prepend(lazypath) + +require("vim-options") +require("lazy").setup("plugins") + +vim.o.number = true +vim.o.relativenumber = true + +vim.filetype.add({ + extension = { + gotmpl = 'gotmpl', + }, + pattern = { + [".*%.gohtml"] = "gotmpl", + [".*%.gotmpl"] = "gotmpl" + } +}) + +-- Panes +vim.cmd.set("splitright") +vim.keymap.set("n", "/", function() + vim.cmd.vnew() +end, { desc = "Pane split right" }) + +vim.cmd.set("splitbelow") +vim.keymap.set("n", "-", function() + vim.cmd.new() +end, { desc = "Pane split down" }) + +-- Movement +{{ if eq .chezmoi.hostname "gentoo" }} +local function smart_move(direction, vim_cmd) + return function() + local before = vim.api.nvim_get_current_win() + + vim.cmd("wincmd " .. vim_cmd) + + if before == vim.api.nvim_get_current_win() then + vim.system({ + "hyprctl", + "dispatch", + string.format( + "hl.dsp.focus({direction = '%s' })", + direction + ) + }) + end + end +end + +vim.keymap.set('n', '', smart_move("left", "h"), { noremap = true, silent = false, desc = "Move to left windows" }); +vim.keymap.set('n', '', smart_move("right", "l"), { noremap = true, silent = false, desc = "Move to right windows" }); +vim.keymap.set('n', '', smart_move("down", "j"), { noremap = true, silent = false, desc = "Move to down window" }); +vim.keymap.set('n', '', smart_move("up", "k"), { noremap = true, silent = false, desc = "Move to up window" }); + +{{ end }} + +vim.api.nvim_set_keymap('n', 'gb', ':bnext', { noremap = true, silent = true, desc = "Go back last buffer" }); + +vim.api.nvim_set_keymap('t', '', '', { noremap = true, silent = true, desc = "Escape Terminal" }); +vim.api.nvim_create_autocmd('TermOpen', { + group = vim.api.nvim_create_augroup('custom-term-open', { clear = true }), + callback = function() + vim.opt_local.number = false + vim.opt_local.relativenumber = false + end, +}); + + +-- Telescope +vim.keymap.set('n', 'fg', function() require("telescope.builtin").live_grep({ glob_pattern = "!*_templ.go" }) end, + { desc = "Telescope live grep" }) +vim.keymap.set('n', 'gl', function() require("telescope.builtin").lsp_references() end, + { desc = "Telescope show references" }) +vim.keymap.set('n', 'fx', function() require("telescope.builtin").diagnostics() end, + { desc = "Telescope open diagnostics" }) +vim.keymap.set('n', 'ff', function() require("telescope.builtin").find_files() end, + { desc = "Telescope find files" }) +vim.keymap.set('n', 'fb', function() require("telescope.builtin").buffers() end, { desc = "Telescope open buffers" }) + +-- Formating +vim.keymap.set("n", "gf", function() + require("conform").format({ lsp_format = "fallback" }) +end, { desc = "Format buffer" }) + +-- Filesystem +vim.keymap.set("n", "e", ":Oil", { desc = "Open file explorer: OIL" }) + +-- Neotest +vim.keymap.set("n", "ts", function() + require("neotest").summary.toggle() +end, { desc = "Neotest open summary" }) +vim.keymap.set("n", "to", function() require("neotest").output.open() end, { desc = "Neotest open output" }) +vim.keymap.set("n", "td", function() require("neotest").run.run({ suite = false, strategy = "dap" }) end, + { desc = "Neotest debug closest test" }) +vim.keymap.set("n", "tr", function() require("neotest").run.run({ suite = false }) end, + { desc = "Neotest run closest test" }) + +-- Debugging +vim.keymap.set("n", "db", function() require("dap").toggle_breakpoint() end, + { nowait = true, remap = false, desc = "Debug toggle breakpoint" }) +vim.keymap.set("n", "dc", function() require("dap").continue() end, + { nowait = true, remap = false, desc = "Debug continue" }) +vim.keymap.set("n", "di", function() require("dap").step_into() end, + { nowait = true, remap = false, desc = "Debug step into" }) +vim.keymap.set("n", "do", function() require("dap").step_over() end, + { nowait = true, remap = false, desc = "Debug step over" }) +vim.keymap.set("n", "dr", function() require("dap").repl.open() end, + { nowait = true, remap = false, desc = "Debug open repl" }) +vim.keymap.set("n", "dq", function() + local dap = require("dap") + dap.terminate() + require("dapui").close() + require("nvim-dap-virtual-text").toggle() +end, { nowait = true, remap = false, desc = "Debug close" }) +vim.keymap.set("n", "dl", function() require("dap").list_breakpoints() end, + { nowait = true, remap = false, desc = "Debug list breakpoints" }) + +local function read_pyproject() + local results = vim.fs.find("pyproject.toml", { upward = true, stop = vim.loop.os_homedir() }) + local path = results[1] + if not path then + return nil + end + + local ok, lines = pcall(vim.fn.readfile, path) + if not ok then + return nil + end + + return table.concat(lines, "\n") +end + +local function get_scripts_from_pyproject() + local pyproject = read_pyproject() + if not pyproject then + return {} + end + + local scripts = {} + + -- Match [tool.poetry.scripts] + for script_line in pyproject:gmatch("%[tool%.poetry%.scripts%][^\n]*\n([^%[]*)") do + for name, module in script_line:gmatch('([%w_%-]+)%s*=%s*"([^"]+)"') do + scripts[name] = module + end + end + + -- Match [project.scripts] + for script_line in pyproject:gmatch("%[project%.scripts%][^\n]*\n([^%[]*)") do + for name, module in script_line:gmatch('([%w_%-]+)%s*=%s*"([^"]+)"') do + scripts[name] = module + end + end + + return scripts +end + +local function get_python_path() + local cwd = vim.fn.getcwd() + if vim.fn.executable(cwd .. "/venv/bin/python") == 1 then + return cwd .. "/venv/bin/python" + elseif vim.fn.executable(cwd .. "/.venv/bin/python") == 1 then + return cwd .. "/.venv/bin/python" + else + return vim.fn.exepath("python") + end +end + +-- Store last used parameters for quick reuse +local last_params = {} + +vim.keymap.set("n", "dps", function() + local scripts = get_scripts_from_pyproject() + + if vim.tbl_isempty(scripts) then + vim.notify("No scripts found in pyproject.toml", vim.log.levels.WARN) + return + end + + local script_names = vim.tbl_keys(scripts) + table.sort(script_names) + + local function start_debug(script_name, module, args_str) + local package = module:match("^([^:]+)") + + -- Parse arguments string into table + local args = {} + if args_str and args_str ~= "" then + for arg in args_str:gmatch("%S+") do + table.insert(args, arg) + end + end + + -- Store for quick reuse + last_params[script_name] = args_str or "" + + vim.notify( + "Debugging: " .. script_name .. (args_str and (" with args: " .. args_str) or ""), + vim.log.levels.INFO + ) + + require("dap").run({ + type = "python", + request = "launch", + name = "Debug: " .. script_name, + module = package, + args = args, + pythonPath = get_python_path(), + justMyCode = false, + console = "integratedTerminal", + }) + end + + local function show_param_input(script_name, module) + -- Show input dialog for parameters + vim.ui.input({ + prompt = "Arguments for " .. script_name .. ": ", + default = last_params[script_name] or "", + completion = "file", + }, function(args_str) + if args_str ~= nil then -- nil = cancelled, "" = empty input is OK + start_debug(script_name, module, args_str) + end + end) + end + + local function select_script() + if #script_names == 1 then + show_param_input(script_names[1], scripts[script_names[1]]) + else + vim.ui.select(script_names, { + prompt = "Select script to debug: ", + format_item = function(item) + return item .. " → " .. scripts[item] + end, + }, function(selected) + if selected then + show_param_input(selected, scripts[selected]) + end + end) + end + end + + select_script() +end, { desc = "Debug Python script from pyproject.toml" }) +-- Lsp Config +vim.keymap.set("n", "K", vim.lsp.buf.hover, { desc = "Show hover information" }) +vim.keymap.set("n", "gd", vim.lsp.buf.definition, { desc = "Goto definition" }) +vim.keymap.set({ "n", "v" }, "ca", vim.lsp.buf.code_action, { desc = "LSP code action" }) +vim.keymap.set("n", "cr", vim.lsp.buf.rename, { desc = "LSP rename" }) + +-- Motions +vim.keymap.set("n", "", "zz", {}) +vim.keymap.set("n", "", "zz", {}) + +-- Disable unused +for _, key in ipairs({ + "Q", + "q:", + "q/", + "q?", + "ZZ", + "ZQ", + "", + "U", + "gQ", + "", + "", + "", + "", + "", + "" +}) do + vim.keymap.set("n", key, "") +end diff --git a/dot_config/nvim/lua/plugins/catppuccin.lua b/dot_config/nvim/lua/plugins/catppuccin.lua index 772b80e..b60a0e4 100644 --- a/dot_config/nvim/lua/plugins/catppuccin.lua +++ b/dot_config/nvim/lua/plugins/catppuccin.lua @@ -5,9 +5,9 @@ return priority = 1000, lazy = false, config = function() - -- require("catppuccin").setup({ - -- transparent_background = true, - -- }) + require("catppuccin").setup({ + transparent_background = true, + }) vim.cmd.colorscheme "catppuccin" end diff --git a/dot_config/nvim/lua/plugins/dap.lua b/dot_config/nvim/lua/plugins/dap.lua index 6d63dfa..1314be1 100644 --- a/dot_config/nvim/lua/plugins/dap.lua +++ b/dot_config/nvim/lua/plugins/dap.lua @@ -27,31 +27,29 @@ return { }) -- Configurations - dap.configurations = { - python = { - { - -- The first three options are required by nvim-dap - type = "python", -- the type here established the link to the adapter definition: `dap.adapters.python` - request = "launch", - name = "Launch file", + dap.configurations.python = { + { + -- The first three options are required by nvim-dap + type = "python", -- the type here established the link to the adapter definition: `dap.adapters.python` + request = "launch", + name = "Launch file", - -- Options below are for debugpy, see https://github.com/microsoft/debugpy/wiki/Debug-configuration-settings for supported options + -- Options below are for debugpy, see https://github.com/microsoft/debugpy/wiki/Debug-configuration-settings for supported options - program = "${file}", -- This configuration will launch the current file if used. - pythonPath = function() - -- debugpy supports launching an application with a different interpreter then the one used to launch debugpy itself. - -- The code below looks for a `venv` or `.venv` folder in the current directly and uses the python within. - -- You could adapt this - to for example use the `VIRTUAL_ENV` environment variable. - local cwd = vim.fn.getcwd() - if vim.fn.executable(cwd .. "/venv/bin/python") == 1 then - return cwd .. "/venv/bin/python" - elseif vim.fn.executable(cwd .. "/.venv/bin/python") == 1 then - return cwd .. "/.venv/bin/python" - else - return "/usr/bin/python" - end - end, - }, + program = "${file}", -- This configuration will launch the current file if used. + pythonPath = function() + -- debugpy supports launching an application with a different interpreter then the one used to launch debugpy itself. + -- The code below looks for a `venv` or `.venv` folder in the current directly and uses the python within. + -- You could adapt this - to for example use the `VIRTUAL_ENV` environment variable. + local cwd = vim.fn.getcwd() + if vim.fn.executable(cwd .. "/venv/bin/python") == 1 then + return cwd .. "/venv/bin/python" + elseif vim.fn.executable(cwd .. "/.venv/bin/python") == 1 then + return cwd .. "/.venv/bin/python" + else + return vim.fn.exepath("python") + end + end, }, } diff --git a/dot_config/nvim/lua/plugins/lsp.lua b/dot_config/nvim/lua/plugins/lsp.lua index 78c93dd..aa4388a 100644 --- a/dot_config/nvim/lua/plugins/lsp.lua +++ b/dot_config/nvim/lua/plugins/lsp.lua @@ -7,7 +7,7 @@ return { "gopls", "html", "yamlls", - "svelte-language-server", + "svelte", "clangd", "ansiblels", "vtsls", diff --git a/dot_config/nvim/lua/plugins/lualine.lua b/dot_config/nvim/lua/plugins/lualine.lua index 68bb97d..71522da 100644 --- a/dot_config/nvim/lua/plugins/lualine.lua +++ b/dot_config/nvim/lua/plugins/lualine.lua @@ -6,16 +6,6 @@ return { -- options = { -- theme = 'catppuccin' -- }, - sections = { - lualine_x = { - function() - return require('direnv').statusline() - end, - 'encoding', - 'fileformat', - 'filetype', - } - } }) end } diff --git a/dot_config/nvim/lua/plugins/telescope.lua b/dot_config/nvim/lua/plugins/telescope.lua index 9134656..d5b89d1 100644 --- a/dot_config/nvim/lua/plugins/telescope.lua +++ b/dot_config/nvim/lua/plugins/telescope.lua @@ -6,9 +6,6 @@ return { 'BurntSushi/ripgrep', { 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' } }, - }, - { - 'nvim-telescope/telescope-ui-select.nvim', config = function() local telescope = require("telescope") telescope.setup({ @@ -28,5 +25,8 @@ return { telescope.load_extension("ui-select") telescope.load_extension("fzf") end + }, + { + 'nvim-telescope/telescope-ui-select.nvim', } } diff --git a/dot_config/nvim/lua/plugins/tmux.lua b/dot_config/nvim/lua/plugins/tmux.lua deleted file mode 100644 index 2b859f8..0000000 --- a/dot_config/nvim/lua/plugins/tmux.lua +++ /dev/null @@ -1,15 +0,0 @@ -return { - 'alexghergh/nvim-tmux-navigation', - config = function() - require 'nvim-tmux-navigation'.setup { - disable_when_zoomed = false, -- defaults to false - keybindings = { - left = "", - down = "", - up = "", - right = "", - last_active = "", - } - } - end -} diff --git a/dot_config/nvim/lua/plugins/tmux.lua.tmpl b/dot_config/nvim/lua/plugins/tmux.lua.tmpl new file mode 100644 index 0000000..5c73b6c --- /dev/null +++ b/dot_config/nvim/lua/plugins/tmux.lua.tmpl @@ -0,0 +1,19 @@ +{{ if ne .chezmoi.hostname "gentoo" }} +return { + 'alexghergh/nvim-tmux-navigation', + config = function() + require 'nvim-tmux-navigation'.setup { + disable_when_zoomed = false, -- defaults to false + keybindings = { + left = "", + down = "", + up = "", + right = "", + last_active = "", + } + } + end +} +{{ else }} +return {} +{{ end }} diff --git a/dot_config/nvim/lua/plugins/which-key.lua b/dot_config/nvim/lua/plugins/which-key.lua index 62125fe..7db392f 100644 --- a/dot_config/nvim/lua/plugins/which-key.lua +++ b/dot_config/nvim/lua/plugins/which-key.lua @@ -1,11 +1,7 @@ return { "folke/which-key.nvim", event = "VeryLazy", - opts = { - -- your configuration comes here - -- or leave it empty to use the default settings - -- refer to the configuration section below - }, + opts = {}, keys = { { "?", @@ -15,8 +11,9 @@ return { desc = "Buffer Local Keymaps (which-key)", }, }, - config = function() + config = function(_, opts) local wk = require("which-key") + wk.setup(opts) wk.add({ { "d", group = "Debug" }, { "f", group = "Telescope" }, -- cgit 1.3.1