Get a view into a tmux window without leaving neovim. Useful for referencing your code as you read errors. Inspired by tj's floaterminal
in advent-of-nvim
:TmuxPeek
opens a floating window with the leftmost tmux window opened.
tmux-peek.nvim
uses terminal mode. When in terminal mode, use <C-\><C-N>
to exit insert mode. Use :h terminal
for more information on terminal mode.
tmux-peek.nvim
to open the same tmux window that neovim is open in will cause resizing issues
For lazy.nvim
{
"gassayping/tmux-peek.nvim",
opts = {}
}
:TmuxPeek
will automatically be made available
These are the default configuration options
require("tmux-peek").setup({
session_prefix = "peek-",
win_config = {
width = 0.5,
height = 0.3,
col = 0.5,
row = 0.9,
relative = "editor",
border = "rounded",
style = "minimal",
title = "Tmux Peek",
title_pos = "center"
}
})
It is recommended to add a keymap to easily toggle the floating tmux window
vim.keymap.set({ "n", "t" }, "<leader>tp", "<cmd>TmuxPeek<CR>", { desc = "Toggle floating tmux window" })