From 45bbe9938f34f0fddd1f93f6711a72836c0f9af4 Mon Sep 17 00:00:00 2001 From: punkfairie Date: Sat, 4 Jan 2025 21:11:40 -0800 Subject: [PATCH] feat: Open help windows to the right --- nvim/lua/autocmds.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/nvim/lua/autocmds.lua b/nvim/lua/autocmds.lua index 36502f3..43a04b6 100644 --- a/nvim/lua/autocmds.lua +++ b/nvim/lua/autocmds.lua @@ -126,3 +126,14 @@ autocmd({ 'BufWritePre' }, { vim.fn.mkdir(vim.fn.fnamemodify(file, ':p:h'), 'p') end, }) + +autocmd({ 'BufWinEnter' }, { + desc = 'Open help files in vertical split to the right', + group = augroup('help_window_right'), + pattern = { '*.txt' }, + callback = function() + if vim.o.filetype == 'help' then + vim.cmd.wincmd('L') + end + end, +})