Fix: alpha window closing. Patches to open files with telescope and neotree on the same window as alpha. Autocmds to load global and local settigs to every window after opening from telescope/neovim from alpha window.

This commit is contained in:
psychhim
2025-10-15 02:10:11 +05:30
parent 036a8d766c
commit a6a8f01ebf
5 changed files with 111 additions and 7 deletions

View File

@@ -0,0 +1,44 @@
-- Auto-apply all preferred settings to every normal buffer
local M = {}
function M.setup()
vim.api.nvim_create_autocmd({ 'BufWinEnter', 'WinEnter', 'BufEnter' }, {
callback = function()
local ft = vim.bo.filetype
local bt = vim.bo.buftype
-- Skip floating or special buffers
if ft == 'neo-tree' or ft == 'TelescopePrompt' or bt == 'terminal' or bt == 'nofile' then
return
end
-- Window-local options
vim.wo.number = true
vim.wo.relativenumber = true
vim.wo.signcolumn = 'yes'
vim.wo.scrolloff = 8
-- Global options
vim.o.hlsearch = false
vim.o.mouse = '' -- disable mouse
vim.o.breakindent = true
vim.o.undofile = true
vim.o.ignorecase = true
vim.o.smartcase = true
vim.o.updatetime = 250
vim.o.timeoutlen = 300
vim.o.completeopt = 'menuone,noselect'
vim.o.termguicolors = true
vim.o.showtabline = 1
-- Tabs and indentation
vim.o.expandtab = false
vim.o.shiftwidth = 4
vim.o.softtabstop = 0
vim.o.tabstop = 4
vim.o.smartindent = true
end,
})
end
return M