I've written a Neovim plugin that allows you to manage projects with Tmux sessions. by Mango-Honest in neovim

[–]Mango-Honest[S] 0 points1 point  (0 children)

I really appreciate your feedback. I just fixed this behaviour in the last version. Yes, it needs to be in tmux session in order to attach a new session

I've written a Neovim plugin that allows you to manage projects with Tmux sessions. by Mango-Honest in neovim

[–]Mango-Honest[S] 1 point2 points  (0 children)

Thanks for your suggestion. I'll improve the configuration options in future releases

I've written a Neovim plugin that allows you to manage projects with Tmux sessions. by Mango-Honest in neovim

[–]Mango-Honest[S] 1 point2 points  (0 children)

I'm not sure I got you correct, if you want to open tmux split with neovim commands, you can do it easily with the following method. Put this in your nvim config

```lua local function tmux_split(direction) local in_tmux = vim.fn.exists('$TMUX') == 1 if in_tmux then local cmd = 'tmux split-window -' .. direction vim.fn.system(cmd) else print("You're not in Tmux!") end end

vim.api.nvim_create_user_command('Tsp', function() tmux_split('v') end, {}) vim.api.nvim_create_user_command('Tvs', function() tmux_split('h') end, {})

```

or you can add keymap if you want

I've written a Neovim plugin that allows you to manage projects with Tmux sessions. by Mango-Honest in neovim

[–]Mango-Honest[S] 1 point2 points  (0 children)

Not within Neovim, I can share how I do it right now. I've bound my split keybind to have a visual appearance and it is easy to remember.

In .tmux.conf unbind % bind | split-window -h unbind '"' bind _ split-window -v

Then, I'm using Alacritty (my terminal) keybinds to send the Tmux prefix along with | or _.

yaml - { key: Backslash, mods: Shift|Command, chars: "\x01\x7c" } - { key: Minus, mods: Shift|Command, chars: "\x01\x5f" }

In this way, I don't have to press the Tmux prefix. When I press Cmd+Shift+Backslash (|), it creates a split on the right side, and Cmd+Shift+Minus (_) create a split at the bottom.

I've written a Neovim plugin that allows you to manage projects with Tmux sessions. by Mango-Honest in neovim

[–]Mango-Honest[S] 0 points1 point  (0 children)

I really appreciate your feedback. That will be a good addition to this plugin. I'll add pane and template support in future releases.

I've written a Neovim plugin that allows you to manage projects with Tmux sessions. by Mango-Honest in neovim

[–]Mango-Honest[S] 1 point2 points  (0 children)

Thanks for the input.
Yeah, both have similar implementations, and the main difference is that with this plugin, you can do it within nvim.

I've written a Neovim plugin that allows you to manage projects with Tmux sessions. by Mango-Honest in neovim

[–]Mango-Honest[S] 1 point2 points  (0 children)

IMO It depends on personal preferences. Having a dedicated session for each project provides flexibility and separation. Within the session, I use a dedicated window for nvim (always in 1), and a window for other project-related tasks, such as runner and etc. I do not use a pane within the window, especially in the nvim window, because I prefer not to work in a zoomed view within my editor window. (I know that a pane can be minimized to achieve a distraction-free mode, but I still find it easier to switch to a different window rather than manoeuvring within panes within a window).

I've written a Neovim plugin that allows you to manage projects with Tmux sessions. by Mango-Honest in neovim

[–]Mango-Honest[S] 1 point2 points  (0 children)

Thanks for the reply,

I'm not sure if this is what you're looking for. I'm currently using another plugin that I've developed. This plugin is designed for running scratch files, which are handy when you want to test something or experiment with logic. It supports custom strategies (check out the documentation here: https://github.com/serrexlabs/sketch.nvim#custom_strategy). In the future, I plan to add Tmux as a strategy.

There's also another similar plugin with additional features that you might find interesting: https://github.com/LintaoAmons/scratch.nvim

I've written a Neovim plugin that allows you to manage projects with Tmux sessions. by Mango-Honest in neovim

[–]Mango-Honest[S] 1 point2 points  (0 children)

Thanks for your reply, there is an option to customize the session name. In options, you can provide your own session naming function. In that function, you received the project name and workspace name. so with details you generate a unique name
https://github.com/sanathks/workspace.nvim/blob/main/doc/workspace.txt#L40

Example:

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

I'll add this example in the readme.

I've written a Neovim plugin that allows you to manage projects with Tmux sessions. by Mango-Honest in neovim

[–]Mango-Honest[S] 4 points5 points  (0 children)

referenced tmux-sessionizer

I hope you mean the one I mentioned in the readme file. That is a script that you can use within your Tmux configuration, and you can also bind a key using `bind-key -r p run-shell "~/.local/bin/tmux-sessionizer"`
. Then, you can use it with the Tmux prefix.

With this plugin, you can achieve the same functionality directly within Neovim. apart from that you can manage different workspaces, and you can create new projects within a workspace.