diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index fa6357d..fe28fbd 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -4,6 +4,7 @@ "blink.cmp": { "branch": "main", "commit": "78336bc89ee5365633bcf754d93df01678b5c08f" }, "bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" }, "catppuccin": { "branch": "main", "commit": "e068ab5f8261f23f6f71ffd8791ae40315b77b9c" }, + "clangd_extensions.nvim": { "branch": "main", "commit": "78c2ecd659d54972be17aa6ba2deac3c53223b80" }, "conform.nvim": { "branch": "master", "commit": "619363c30309d29ffa631e67c8183f2a72caa373" }, "diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" }, "dotenv.nvim": { "branch": "main", "commit": "7d516e9293c6e3ac21830fb10a4e8674c02747c6" }, @@ -12,19 +13,21 @@ "friendly-snippets": { "branch": "main", "commit": "6cd7280adead7f586db6fccbd15d2cac7e2188b9" }, "gitsigns.nvim": { "branch": "main", "commit": "2038c666bd9d8a0b7349a0b6ee00dc83104b9ecf" }, "grug-far.nvim": { "branch": "main", "commit": "c69859c1d5427ab5fc7ed12380ab521b4e336691" }, + "hybrid-theme": { "branch": "main", "commit": "10e207f3ac64c4b46c7331b57463e26c25d94e16" }, "indent-blankline.nvim": { "branch": "master", "commit": "d28a3f70721c79e3c5f6693057ae929f3d9c0a03" }, "just-runner.nvim": { "branch": "main", "commit": "f29d405aa828900df242600720a2b0e57261489f" }, "lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" }, "lazydev.nvim": { "branch": "main", "commit": "ff2cbcba459b637ec3fd165a2be59b7bbaeedf0d" }, "lualine.nvim": { "branch": "master", "commit": "221ce6b2d999187044529f49da6554a92f740a96" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "50bf3871b539896bd0650b882f6e6b467cc1c1eb" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "47059d71b42d74b0a1e9f61c1d99d301039c3b5b" }, "mason.nvim": { "branch": "main", "commit": "2a6940af80375532e5e9e7c1f2fc6319a1b7a69d" }, - "mini.ai": { "branch": "main", "commit": "d73c36349aa7b0bab5f77ad71701a1d42211a1df" }, + "mini.ai": { "branch": "main", "commit": "cb20f298ebf5ae91924cd0c6c310712de2ef4086" }, "mini.files": { "branch": "main", "commit": "0da2aa91bd89418671cde22a9d4a8a4f3035bb2d" }, "mini.icons": { "branch": "main", "commit": "e56797f90192d81f1fda02e662fc3e8e3d775027" }, "mini.pairs": { "branch": "main", "commit": "db0fac0a25884183650352ccf92b362a41ed2e9c" }, "noice.nvim": { "branch": "main", "commit": "7bfd942445fb63089b59f97ca487d605e715f155" }, "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, + "nvim-dev-container": { "branch": "main", "commit": "365b4c815339d42133829006dce3e5f8b182b771" }, "nvim-lint": { "branch": "master", "commit": "a219b2c9e5b4765e5c845aba119dad55806fcaf1" }, "nvim-lspconfig": { "branch": "master", "commit": "3371bf298c1f56efc26771ee961f461176958fb5" }, "nvim-treesitter": { "branch": "main", "commit": "4916d6592ede8c07973490d9322f187e07dfefac" }, @@ -37,6 +40,6 @@ "todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" }, "tokyonight.nvim": { "branch": "main", "commit": "cdc07ac78467a233fd62c493de29a17e0cf2b2b6" }, "trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" }, - "ts-comments.nvim": { "branch": "main", "commit": "123a9fb12e7229342f807ec9e6de478b1102b041" }, + "ts-comments.nvim": { "branch": "main", "commit": "a59d6092213447450191122c9346f309161504cb" }, "which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" } } diff --git a/.config/nvim/lua/config/terminal.lua b/.config/nvim/lua/config/terminal.lua index e536b2c..d97f644 100644 --- a/.config/nvim/lua/config/terminal.lua +++ b/.config/nvim/lua/config/terminal.lua @@ -6,18 +6,21 @@ -- fT terminal in the current working directory -- -- This module adds: --- a *dedicated* floating terminal (stable toggle, one-key close) +-- open/focus a *dedicated* floating terminal (close it with ) -- ft a picker that lists every live terminal so any contextual -- terminal can be focused or restored even after its window was -- closed/hidden. local M = {} --- The floating terminal. Tracked as an upvalue so is a real --- open/close toggle regardless of which directory the editor is in. +-- The floating terminal. Tracked as an upvalue so always re-focuses +-- the *same* float regardless of which directory the editor is in. ---@type snacks.win? local float --- Open or focus the floating terminal, or hide it if already focused. +-- NOTE: currently unused; calls open_float() instead so shell +-- tab-completion keeps working while the terminal is open. Kept around for a +-- future explicit open/close toggle. function M.toggle_float() -- Reuse the existing instance: hide if visible, re-show if hidden. if float and float:buf_valid() then @@ -50,6 +53,31 @@ function M.toggle_float() end end +--- Open or focus the floating terminal. This never hides the window, so +--- once the float is open falls through to the shell and stays available +--- for tab-completion. Close the floating terminal with while it is +--- visible (handled by Snacks' native terminal keymap). +function M.open_float() + if float and float:buf_valid() then + if not float:win_valid() then + float:show() + end + if float:win_valid() then + vim.api.nvim_set_current_win(float.win) + end + vim.cmd("startinsert") + return + end + + -- First open: a high fixed count guarantees this terminal never collides with + -- the count-keyed bottom terminals (1, 2, 3 ...), so it is always the *same* + -- float for no matter the context. + float = Snacks.terminal(nil, { + count = 99, + win = { position = "float", border = "rounded" }, + }) +end + --- List every live Snacks terminal in a picker. Restore/focus one with , --- kill one with . function M.picker() diff --git a/.config/nvim/lua/plugins/terminal.lua b/.config/nvim/lua/plugins/terminal.lua index fdc2f4c..cf30a6b 100644 --- a/.config/nvim/lua/plugins/terminal.lua +++ b/.config/nvim/lua/plugins/terminal.lua @@ -7,7 +7,7 @@ return { { "", function() - require("config.terminal").toggle_float() + require("config.terminal").open_float() end, desc = "Terminal (float)", mode = "n", diff --git a/.gitignore b/.gitignore index 300d2ee..dc42dd0 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ *.orig *.bak .config/nvim/.env +.local/share/applications/mimeinfo.cache +.docker/config.json diff --git a/.local/share/applications/mimeinfo.cache b/.local/share/applications/mimeinfo.cache deleted file mode 100644 index ba69156..0000000 --- a/.local/share/applications/mimeinfo.cache +++ /dev/null @@ -1,6 +0,0 @@ -[MIME Cache] -application/x-shellscript=nvim.desktop; -inode/directory=yazi.desktop; -text/html=nvim.desktop; -text/markdown=nvim.desktop; -text/plain=nvim.desktop;