summaryrefslogtreecommitdiff
path: root/home/common/modules/neovim/config/lua/pacman/plugins/toggleterm.lua
blob: e61b9b6e7871695a1531ca52fe14a037d751144f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
return {
  {
    "akinsho/toggleterm.nvim",
    event = "VeryLazy",
    opts = {
      direction = "float",
      open_mapping = [[<c-\>]],
      on_create = function(term)
        local session_name = "_nvim_toggleterm_" .. vim.fn.getcwd() .. "_$(date +%s%4N)"
        term:send("exec tmux new-session -A -s " .. session_name)
        term:send("tmux set-option destroy-unattached")
        term:send("tmux set window-status-current-format '#{window_index}:#{pane_current_command}'")
        term:send("tmux set window-status-format '#{window_index}:#{pane_current_command}'")
        term:clear()
      end,
    },
  }
}
-- vim: ts=2 sts=2 sw=2 et