feat(tmux): added configuration option for autoclosing terminals

This commit adds a config option so that if the user wants to close all
tmux terminals opened by harpoon on Vim exit, they can.
This commit is contained in:
Pranav Rao 2021-10-23 16:41:42 -04:00
parent 20590f1512
commit decdcd6971
2 changed files with 9 additions and 0 deletions

View File

@ -157,6 +157,7 @@ M.setup = function(config)
["save_on_toggle"] = false,
["save_on_change"] = true,
["enter_on_sendcmd"] = false,
["tmux_autoclose_windows"] = false,
},
}, expand_dir(
c_config

8
lua/harpoon/tmux.lua Executable file → Normal file
View File

@ -6,6 +6,14 @@ local utils = require("harpoon.utils")
local M = {}
local tmux_windows = {}
if global_config.tmux_autoclose_windows then
vim.cmd([[
augroup HARPOON_TMUX
autocmd!
autocmd VimLeave * :lua require('harpoon.tmux').clear_all()
]])
end
local function create_terminal()
log.trace("tmux: _create_terminal())")