Skip to content

Commit

Permalink
better tmux selection
Browse files Browse the repository at this point in the history
  • Loading branch information
jrodal98 committed May 8, 2022
1 parent e96fd89 commit 3efd059
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions lua/custom/plugins/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,26 @@ return {
-- copy vim statusline into tmux statusline
{
"vimpostor/vim-tpipeline",
-- disable if tmux is not installed
disable=not vim.fn.executable("tmux"),
config = function()
vim.cmd [[
-- disable if tmux is not running
cond = function()
-- there has to be a less stupid way to do this,
-- but calling if vim.fn.system... wasn't working
-- no matter what I tried - I think it didn't capture output
return vim.api.nvim_exec(
[[
if system('pgrep tmux')
" prevent statusline duplication when tmux is running
autocmd BufRead,BufNewFile,BufEnter,BufWinEnter * set laststatus=0
echo v:true
else
" set global statusline otherwise
autocmd BufRead,BufNewFile,BufEnter,BufWinEnter * set laststatus=3
echo v:false
endif
]]
]],
-- capture the output
true
)
end,
},
{
Expand Down

0 comments on commit 3efd059

Please sign in to comment.