## 背景 [[Zellij]]について用途を検討していたら、[[overseer.nvim]]を使ったほうがいいのではと思ったので。 <div class="link-card-v2"> <div class="link-card-v2-site"> <img class="link-card-v2-site-icon" src="https://publish-01.obsidian.md/access/35d05cd1bf5cc500e11cc8ba57daaf88/favicon-64.png" /> <span class="link-card-v2-site-name">Minerva</span> </div> <div class="link-card-v2-title"> 🧠Zellijの全機能を試して戦略を立案する </div> <div class="link-card-v2-content">Zellijを再評価するため1週間継続利用した結果、特定目的向きのワークスペース構築に適すると判断し、Neovim共存やフローティングペイン廃止、リーダーキーを`;u`に変更するなどのカスタマイズを行った経緯と内容を整理した記録である</div> <img class="link-card-v2-image" src="https://publish-01.obsidian.md/access/35d05cd1bf5cc500e11cc8ba57daaf88/Notes/attachments/brain.webp" /> <a data-href="🧠Zellijの全機能を試して戦略を立案する" class="internal-link"></a> </div> %%[[🧠Zellijの全機能を試して戦略を立案する]]%% ## インストール キーマップだけの最低限設定で。 `lua/plugins/overseer.lua` ```lua return { "stevearc/overseer.nvim", keys = { { "<space><space>o", "<CMD>OverseerRun<CR>" }, { "<space><space>O", "<CMD>OverseerToggle<CR>" }, }, opts = {}, } ``` ## [[lualine.nvim]]は非表示 ```lua return { opts = function() return { options = { disabled_filetypes = { statusline = { "OverseerList", "OverseerOutput" }, winbar = { "OverseerList", "OverseerOutput" }, }, }, sections = { -- どこでも好きなところで良い lualine_y = { { "overseer" } }, }, } end } ``` ## [[バッファ (Vim)|バッファ]]が保存されたら再実行 > [!fixme] > ちゃんとしたものを別ノートで書く [[restart_on_save (overseer.nvim)|restart_on_save]]を設定する。 ```lua return { builder = function() return { components = { "restart_on_save", "default", }, } end, } ``` ``` ---@type overseer.TemplateDefinition return { name = "Carnelian", builder = function() -- local file = vim.fn.expand("%") ---@type overseer.TaskDefinition return { cmd = { "bun" }, args = { "pre:push" }, components = { { "on_output_quickfix", open_on_exit = "failure" }, "default", }, } end, } ``` ## テンプレートを使う > [!fixme] > ## デフォルトのテンプレートを非表示にする > [!fixme] > 別ノートに抽出。 `disable_template_modules` で非表示にしたいテンプレートモジュールのパスを設定する。 ```lua return { "stevearc/overseer.nvim", opts = { disable_template_modules = { "overseer.template.bun", "overseer.template.pnpm", "overseer.template.npm", }, }, } ``` ## 表示されるテンプレートをフィルタリング > [!fixme] > 別ノートに抽出。 [[snacks.picker]]を使っている場合。🎭 から始まるテンプレートだけを表示する。 ```lua return { "folke/snacks.nvim", opts = { picker = { sources = { select = { kinds = { overseer_template = { transform = function(item) return type(item.name) == "string" and item.name:match("^🎭") ~= nil end, }, }, }, }, }, }, } ``` [[snacks.nvim]]は `sources.select.kinds` を指定できる。 `lua/snacks/picker/config/sources.lua` ```lua ---@class snacks.picker.select.Config: snacks.picker.Config ---@field kinds? table<string, snacks.picker.Config|{}> custom snacks picker configs for specific `vim.ui.select` kinds M.select = { items = {}, -- these are set dynamically main = { current = true }, ``` <div class="link-card-v2"> <div class="link-card-v2-site"> <img class="link-card-v2-site-icon" src="https://github.githubassets.com/favicons/favicon.svg" /> <span class="link-card-v2-site-name">GitHub</span> </div> <div class="link-card-v2-title"> feat(select): allow configuring options for specific vim.ui.select kinds · folke/snacks.nvim@bca5b05 </div> <div class="link-card-v2-content"> 🍿 A collection of QoL plugins for Neovim. Contribute to folke/snacks.nvim development by creating an account on ... </div> <img class="link-card-v2-image" src="https://opengraph.githubassets.com/ee418b1129ac3d2ef75636a0b89fbd6a07039a3cb325bef06369d756473ba63a/folke/snacks.nvim/commit/bca5b058388fb381f6d04c3624a541f7c0637382" /> <a href="https://github.com/folke/snacks.nvim/commit/bca5b058388fb381f6d04c3624a541f7c0637382"></a> </div> [[overseer.nvim]]はテンプレート選択のとき `kind = "overseer_template"` を渡している。ので `select.kinds.overseer_template` を設定すればよい。 <div class="link-card-v2"> <div class="link-card-v2-site"> <img class="link-card-v2-site-icon" src="https://github.githubassets.com/favicons/favicon.svg" /> <span class="link-card-v2-site-name">GitHub</span> </div> <div class="link-card-v2-title"> overseer.nvim/lua/overseer/commands.lua at 5828bdbd86677497613033c142f0a8624489216f · stevearc/overseer.nvim </div> <div class="link-card-v2-content"> A task runner and job management plugin for Neovim - stevearc/overseer.nvim </div> <img class="link-card-v2-image" src="https://opengraph.githubassets.com/c88f75d5fa2ce7f49c9be13454dce356508dcb70861933be81ae8f205f42a7ab/stevearc/overseer.nvim" /> <a href="https://github.com/stevearc/overseer.nvim/blob/5828bdbd86677497613033c142f0a8624489216f/lua/overseer/commands.lua#L182-L185"></a> </div>