nvim/lua/user/autocommands.lua

74 lines
1.7 KiB
Lua
Raw Normal View History

2022-10-12 22:07:20 -04:00
vim.api.nvim_create_autocmd({ "FileType" }, {
pattern = { "qf", "help", "man", "lspinfo", "spectre_panel" },
callback = function()
vim.cmd([[
nnoremap <silent> <buffer> q :close<CR>
set nobuflisted
]])
end,
})
vim.api.nvim_create_autocmd({ "FileType" }, {
pattern = { "gitcommit"},
callback = function()
vim.opt_local.wrap = true
vim.opt_local.spell = true
end,
})
vim.api.nvim_create_autocmd({ "FileType" }, {
pattern = { "markdown" },
callback = function()
vim.opt_local.wrap = true
vim.opt_local.spell = true
end,
})
2022-11-03 11:10:22 -04:00
vim.cmd("autocmd BufRead,BufNewFile Jenkinsfile set filetype=groovy")
2022-10-12 22:07:20 -04:00
vim.cmd("autocmd BufEnter * ++nested if winnr('$') == 1 && bufname() == 'NvimTree_' . tabpagenr() | quit | endif")
-- vim.api.nvim_create_autocmd({ "BufEnter" }, {
-- callback = function()
-- vim.cmd [[
-- if winnr('$') == 1 && bufname() == 'NvimTree_' . tabpagenr() | quit | endif
-- ]]
-- end,
-- })
vim.api.nvim_create_autocmd({ "VimResized" }, {
callback = function()
vim.cmd("tabdo wincmd =")
end,
})
vim.api.nvim_create_autocmd({ "CmdWinEnter" }, {
callback = function()
vim.cmd("quit")
end,
})
vim.api.nvim_create_autocmd({ "BufWinEnter" }, {
callback = function()
vim.cmd("set formatoptions-=cro")
end,
})
vim.api.nvim_create_autocmd({ "TextYankPost" }, {
callback = function()
vim.highlight.on_yank({ higroup = "Visual", timeout = 200 })
end,
})
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
pattern = { "*.java" },
callback = function()
vim.lsp.codelens.refresh()
end,
})
vim.api.nvim_create_autocmd({ "VimEnter" }, {
callback = function()
vim.cmd("hi link illuminatedWord LspReferenceText")
vim.cmd("VMTheme sand")
2022-10-12 22:07:20 -04:00
end,
})