nvim/psoxizsh: move PsoxFileAutos to early config

As otherwise it appears they load too late, and will sporadically be
ignored when loading files.
This commit is contained in:
Paul Stemmet 2022-12-09 20:00:12 +00:00
parent 0553bbc116
commit 7a1ce7b98a
Signed by: Paul Stemmet
GPG key ID: EDEA539F594E7E75

View file

@ -77,6 +77,13 @@ local function psoxizsh_early_config()
-- Setup vim.diagnostic APIs
diagnostic.setup {}
au.PsoxFileAutos {
{ 'FileType', 'yaml', function() cmd 'setlocal indentkeys-=<:> ts=8 sts=2 sw=2 expandtab' end },
{ 'FileType', 'go', function() cmd 'setlocal ts=8 sts=4 sw=4 noexpandtab' end },
{ 'FileType', 'quickfix,netrw', 'setlocal nobuflisted' },
{ 'FileType', 'netrw', function() keys.Global.N.CloseNetrw:register { buffer = true } end },
}
-- Local pre plugin configuration
util.try_mreload('pre')
end
@ -103,7 +110,6 @@ local function psoxizsh_post_config(plugs)
-- Other
g.rainbow_active = 1
local CloseNetrw = keys.Buffer.N.CloseNetrw
cmd([[
function! CloseNetrw() abort
for bufn in range(1, bufnr('$'))
@ -117,14 +123,7 @@ local function psoxizsh_post_config(plugs)
endfor
endfunction
]])
CloseNetrw { action = fn.CloseNetrw }
au.PsoxFileAutos {
{ 'FileType', 'yaml', 'setlocal indentkeys-=<:> ts=8 sts=2 sw=2 expandtab' },
{ 'FileType', 'go', 'setlocal ts=8 sts=4 sw=4 noexpandtab' },
{ 'FileType', 'quickfix,netrw', 'setlocal nobuflisted' },
{ 'FileType', 'netrw', function() CloseNetrw:register { buffer = true } end },
}
keys.Buffer.N.CloseNetrw { action = fn.CloseNetrw }
-- Open any known user configuration paths for editing
local OpenConfig = function()