new steps

This commit is contained in:
2026-02-13 02:05:33 +02:00
parent 6b4008ca38
commit 6cc023ec35
11 changed files with 167 additions and 609 deletions

View File

@@ -5,6 +5,30 @@ local api = vim.api
local au = api.nvim_create_autocmd
local group = api.nvim_create_augroup('core.events', { clear = true })
vim.api.nvim_create_user_command('W', function()
vim.cmd('w')
end, { desc = 'Write current buffer' })
function _G.see(val)
local lines = vim.split(vim.inspect(val), '\n')
vim.cmd('new')
vim.api.nvim_buf_set_lines(0, 0, -1, false, lines)
vim.bo.buftype = 'nofile'
vim.bo.bufhidden = 'wipe'
end
vim.api.nvim_create_user_command('MessagesToBuffer', function()
local output = vim.api.nvim_exec2('silent messages', { output = true }).output or ''
local lines = vim.split(output, '\n', { plain = true, trimempty = false })
vim.cmd('new')
local bufnr = vim.api.nvim_get_current_buf()
vim.bo[bufnr].buftype = 'nofile'
vim.bo[bufnr].bufhidden = 'wipe'
vim.bo[bufnr].swapfile = false
vim.api.nvim_buf_set_lines(bufnr, 0, -1, false, lines)
end, { desc = 'Open :messages output in a scratch buffer' })
-- Automatically create a scratch buffer if Neovim starts with no files
au('VimEnter', {
group = group,

14
lua/core/filetypes.lua Normal file
View File

@@ -0,0 +1,14 @@
vim.filetype.add({
pattern = {
['.*/templates/.*%.ya?ml'] = 'helm',
['.*/manifests/.*%.ya?ml'] = 'helm',
['.*/crds/.*%.ya?ml'] = 'helm',
['.*/kubernetes/.*%.ya?ml'] = 'helm',
['.*/k8s/.*%.ya?ml'] = 'helm',
['.*/charts/.*%.ya?ml'] = 'helm',
},
extension = {
gotmpl = 'helm',
tftpl = 'yaml',
},
})