From 3cb88f5a0468c17101b031358dee7c9c8ffbdace Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Sat, 15 Feb 2025 15:50:42 +0000 Subject: [PATCH] lazyvim: remove root functionality I don't change directories during my workflow. Maybe this could be useful, but I don't currently want to use it. --- nvim/lua/config/keymaps.lua | 2 +- nvim/lua/plugins/picker.lua | 9 --------- nvim/lua/plugins/ui.lua | 1 - 3 files changed, 1 insertion(+), 11 deletions(-) diff --git a/nvim/lua/config/keymaps.lua b/nvim/lua/config/keymaps.lua index fc3ba2f..9b33bbf 100644 --- a/nvim/lua/config/keymaps.lua +++ b/nvim/lua/config/keymaps.lua @@ -87,7 +87,7 @@ end -- floating terminal -- TODO: I prefer a split buffer for terminal, need to review how to make this more vim-like -local lazyterm = function() LazyVim.terminal(nil, { cwd = LazyVim.root() }) end +local lazyterm = function() LazyVim.terminal(nil, {}) end vim.keymap.set("n", "ft", lazyterm, { desc = "Terminal (Root Dir)" }) vim.keymap.set("n", "fT", function() LazyVim.terminal() end, { desc = "Terminal (cwd)" }) diff --git a/nvim/lua/plugins/picker.lua b/nvim/lua/plugins/picker.lua index 36b5430..ca35c5d 100644 --- a/nvim/lua/plugins/picker.lua +++ b/nvim/lua/plugins/picker.lua @@ -27,20 +27,11 @@ return { win = { input = { keys = { - [""] = { "toggle_cwd", mode = { "n", "i" }, }, [""] = { "trouble_open", mode = { "n", "i" }, }, }, }, }, actions = { - ---@param p snacks.Picker - toggle_cwd = function(p) - local root = LazyVim.root({ buf = p.input.filter.current_buf, normalize = true }) - local cwd = vim.fs.normalize((vim.uv or vim.loop).cwd() or ".") - local current = p:cwd() - p:set_cwd(current == root and cwd or root) - p:find() - end, actions = require("trouble.sources.snacks").actions, }, }, diff --git a/nvim/lua/plugins/ui.lua b/nvim/lua/plugins/ui.lua index fc905d7..f317aaf 100644 --- a/nvim/lua/plugins/ui.lua +++ b/nvim/lua/plugins/ui.lua @@ -110,7 +110,6 @@ return { lualine_b = { "branch" }, lualine_c = { - LazyVim.lualine.root_dir(), { "diagnostics", symbols = { -- 2.48.1