add some autocmds
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
require 'configs.options'
|
||||
require 'configs.keymaps'
|
||||
require 'configs.lazy'
|
||||
require("configs.options")
|
||||
require("configs.keymaps")
|
||||
require("configs.autocmds")
|
||||
require("configs.lazy")
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
-- close some filetypes with <q>
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
group = vim.api.nvim_create_augroup("close_with_q", { clear = true }),
|
||||
pattern = {
|
||||
"qf", -- quickfix window
|
||||
"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, desc = "Close Buffer" })
|
||||
end,
|
||||
})
|
||||
@@ -2,6 +2,8 @@ vim.opt.clipboard = 'unnamedplus'
|
||||
vim.opt.confirm = true -- Confirm to save changes before exiting modified buffer
|
||||
vim.opt.cursorline = true -- Enable highlighting of the current line
|
||||
vim.opt.fileencoding = 'utf-8'
|
||||
-- vim.opt.foldmethod = "expr"
|
||||
-- vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
|
||||
vim.opt.list = true
|
||||
vim.opt.mouse = 'a' -- Enable mouse mode
|
||||
vim.opt.number = true
|
||||
|
||||
Reference in New Issue
Block a user