From 3782f15f0a28c8886480b1a7786d84ea05c553a8 Mon Sep 17 00:00:00 2001 From: liv <shadows_withal@pm.me> Date: Sat, 2 Mar 2024 19:14:40 +0100 Subject: [PATCH] add nvim config for projects --- dot_config/nvim/lua/plugins/projects.lua | 42 ++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 dot_config/nvim/lua/plugins/projects.lua diff --git a/dot_config/nvim/lua/plugins/projects.lua b/dot_config/nvim/lua/plugins/projects.lua new file mode 100644 index 0000000..7418624 --- /dev/null +++ b/dot_config/nvim/lua/plugins/projects.lua @@ -0,0 +1,42 @@ +-- Better project/cd support + +return { + { + "gnikdroy/projections.nvim", + config = function() + require("projections").setup({ + workspaces = { + "~/Projects/Personal", + }, + }) + require("telescope").load_extension("projections") + + -- Load project if started in a project directory + local switcher = require("projections.switcher") + vim.api.nvim_create_autocmd({ "VimEnter" }, { + callback = function() + if vim.fn.argc() == 0 then + switcher.switch(vim.loop.cwd()) + end + end, + }) + end, + keys = { + { "<leader>fp", "<cmd>Telescope projections<CR>", desc = "Search projects" }, + }, + }, + { + "nvimdev/dashboard-nvim", + opts = function(_, opts) + local button = { + action = "Telescope projections", + desc = "Projects", + icon = "🕮 ", + key = "p", + } + + button.key_format = " %s" + table.insert(opts.config.center, 6, button) + end, + }, +}