From fca3d205db63d46f30ef831232a5bc012b8316ec Mon Sep 17 00:00:00 2001 From: Julien Lin Date: Wed, 9 Oct 2024 16:53:22 +0200 Subject: [PATCH] setup workspaces --- lua/plugins/workspaces.lua | 51 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 lua/plugins/workspaces.lua diff --git a/lua/plugins/workspaces.lua b/lua/plugins/workspaces.lua new file mode 100644 index 0000000..b8778ff --- /dev/null +++ b/lua/plugins/workspaces.lua @@ -0,0 +1,51 @@ +return { + { + "natecraddock/workspaces.nvim", + opts = { + -- path to a file to store workspaces data in + -- on a unix system this would be ~/.local/share/nvim/workspaces + path = vim.fn.stdpath("data") .. "/workspaces", + + -- to change directory for nvim (:cd), or only for window (:lcd) + -- deprecated, use cd_type instead + -- global_cd = true, + + -- controls how the directory is changed. valid options are "global", "local", and "tab" + -- "global" changes directory for the neovim process. same as the :cd command + -- "local" changes directory for the current window. same as the :lcd command + -- "tab" changes directory for the current tab. same as the :tcd command + -- + -- if set, overrides the value of global_cd + cd_type = "global", + + -- sort the list of workspaces by name after loading from the workspaces path. + sort = true, + + -- sort by recent use rather than by name. requires sort to be true + mru_sort = true, + + -- option to automatically activate workspace when opening neovim in a workspace directory + auto_open = false, + + -- option to automatically activate workspace when changing directory not via this plugin + -- set to "autochdir" to enable auto_dir when using :e and vim.opt.autochdir + -- valid options are false, true, and "autochdir" + auto_dir = false, + + -- enable info-level notifications after adding or removing a workspace + notify_info = true, + + -- lists of hooks to run after specific actions + -- hooks can be a lua function or a vim command (string) + -- lua hooks take a name, a path, and an optional state table + -- if only one hook is needed, the list may be omitted + hooks = { + add = {}, + remove = {}, + rename = {}, + open_pre = {}, + open = { "Telescope find_files" }, + }, + }, + }, +}