1
0
Fork 0
chezmoi/dot_config/nvim/lua/configs/misc.lua
2022-12-23 10:03:09 +01:00

48 lines
1.8 KiB
Lua

-- {{{ LAYA
local aug = vim.api.nvim_create_augroup('laya', {})
vim.api.nvim_create_autocmd({ 'BufRead', 'BufNewFile' }, {
group = aug,
pattern = '**/jopixel/**/*.php',
callback = function()
vim.cmd.iabbrev({ args = { '<buffer>', 'TR', '$this->obtainer()->translator()->t();<Left><Left>' } })
vim.cmd.iabbrev({ args = { '<buffer>', 'TI', '$this->obtainer()->translator()->t()<Left>' } })
vim.cmd.iabbrev({ args = { '<buffer>', 'LOG', '$this->obtainer()->logger()->log();<Left><Left>' } })
vim.cmd.iabbrev({ args = { '<buffer>', 'DBG', "$this->obtainer()->logger()->log('debug', 'debug',);<Left><Left>" } })
vim.cmd.iabbrev({ args = { '<buffer>', 'PROD', '$this->producer()' } })
vim.cmd.iabbrev({ args = { '<buffer>', 'FILE', '$this->producer()->file()<Left>' } })
vim.cmd.iabbrev({ args = { '<buffer>', 'LINK', "$this->producer()->link($this, '')<Left><Left>" } })
vim.cmd.iabbrev({ args = { '<buffer>', 'NW', '$this->obtainer()->notifications()->warning();<Left><Left>' } })
vim.cmd.iabbrev({ args = { '<buffer>', 'NS', '$this->obtainer()->notifications()->success();<Left><Left>' } })
end
})
-- }}} LAYA
--- terminal {{{
local termgroup = vim.api.nvim_create_augroup('terminal', { clear = true })
vim.api.nvim_create_autocmd('TermOpen', {
group = termgroup,
callback = function()
-- local buf = args.buf
vim.api.nvim_win_set_option(0, 'number', false)
vim.api.nvim_win_set_option(0, 'signcolumn', 'no')
vim.schedule(vim.cmd.startinsert) -- without schedule it lock screen refresh
end
})
--}}}
-- Buffer {{{
vim.cmd([[
augroup forceRecheck
au FocusGained,BufEnter * :silent! !
augroup END
]])
-- }}}
--- Keys {{{
-- scroll up and down with shift+arrow
vim.keymap.set('n', '<S-Down>', '<C-E>')
vim.keymap.set('n', '<S-Up>', '<C-Y>')
--}}}