custom-hypr - add: nvim config

This commit is contained in:
huyjaky
2024-11-29 11:44:20 +07:00
parent ea3007a51e
commit 1380fa224b
56 changed files with 2878 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
-- Some commands that I want to execute in specific timing
vim.api.nvim_create_augroup("disable_comment_newline", { clear = true })
vim.api.nvim_create_augroup("auto_wrap", { clear = true })
vim.api.nvim_create_augroup("disable_suspend_with_c_z", { clear = true })
vim.api.nvim_create_augroup("clear_last_search", { clear = true })
-- NOTE: CursorLineNr setting
vim.api.nvim_set_hl(0, "CursorLineNr", { fg = "#FFD700", bg = "none", bold = true })
-- NOTE: visual line colors
vim.api.nvim_set_hl(0, "Visual", { fg = "#000000", bg = "#FFFFFF", bold = true })
-- NOTE: Set colors for hightlights for similar words
-- vim.api.nvim_set_hl(0, "LspReferenceRead", { fg = "#FF0000" })
-- vim.api.nvim_set_hl(0, "LspReferenceWrite", { fg = "#FF0000" })
-- vim.api.nvim_set_hl(0, "LspReferenceText", { fg = "#FF0000" })
vim.api.nvim_create_autocmd("BufEnter", {
desc = "Disable auto insert comment newline",
group = "disable_comment_newline",
command = "set formatoptions-=cro",
})
vim.api.nvim_create_autocmd("FileType", {
desc = "Enable wrap and spell for text like documents",
group = "auto_wrap",
pattern = { "gitcommit", "markdown", "text", "plaintext" },
callback = function()
vim.opt_local.wrap = true
vim.opt_local.spell = true
end,
})
vim.api.nvim_create_autocmd("BufEnter", {
desc = "Remap <C-z> to nothing so that it doesn't suspend terminal",
group = "disable_suspend_with_c_z",
command = "nnoremap <c-z> <nop>",
})
vim.api.nvim_create_autocmd("BufWinEnter", {
desc = "Clear last search pattern",
group = "clear_last_search",
pattern = "*",
command = "let @/ = ''",
})