refactor: config.plugins -> plugins

This commit is contained in:
Folke Lemaitre 2022-12-31 10:54:42 +01:00
parent 8625b49288
commit 09c27b5e4d
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
17 changed files with 43 additions and 36 deletions

View file

@ -1,44 +0,0 @@
-- Check if we need to reload the file when it changed
vim.api.nvim_create_autocmd("FocusGained", { command = "checktime" })
-- Highlight on yank
vim.api.nvim_create_autocmd("TextYankPost", {
callback = function()
vim.highlight.on_yank()
end,
})
-- go to last loc when opening a buffer
vim.api.nvim_create_autocmd("BufReadPre", {
pattern = "*",
callback = function()
vim.api.nvim_create_autocmd("FileType", {
pattern = "<buffer>",
once = true,
callback = function()
vim.cmd(
[[if &ft !~# 'commit\|rebase' && line("'\"") > 1 && line("'\"") <= line("$") | exe 'normal! g`"' | endif]]
)
end,
})
end,
})
-- close some filetypes with <q>
vim.api.nvim_create_autocmd({ "FileType" }, {
pattern = {
"qf",
"help",
"man",
"notify",
"lspinfo",
"spectre_panel",
"startuptime",
"tsplayground",
"PlenaryTestPopup",
},
callback = function(event)
vim.bo[event.buf].buflisted = false
vim.keymap.set("n", "q", "<cmd>close<cr>", { buffer = event.buf, silent = true })
end,
})