workspace.nvim is a Neovim plugin that allows you to manage Tmux sessions for your projects and workspaces in a simple and efficient way.
Inspired by ThePrimeagen's tmux-sessionizer
{
"sanathks/workspace.nvim",
dependencies = {"nvim-telescope/telescope.nvim"},
config = function()
require("workspace").setup({
workspaces = {
{ name = "Work", path = "~/projects/work", keymap = { "<leader>w" } },
{ name = "Hobby", path = "~/projects/hobby", keymap = { "<leader>p" } },
}
})
end,
}
local workspace = require("workspace")
vim.keymap.set('n', '<leader>ps', workspace.tmux_sessions)
with the tmux_session_name_generator
option you can provide a custom session name generator, which allows you to make the session name unique across multiple workspaces.
function(project_name, workspace_name)
local suffix = string.sub(workspace_name, 1, 2)
local session_name = string.upper(project_name) .. "_" .. suffix
return session_name
end
Contributions are welcome! If you find any issues or have ideas for improvements, please open an issue or submit a pull request.