first commit

This commit is contained in:
2026-03-12 12:35:37 +05:30
commit 5441420e71
72 changed files with 8407 additions and 0 deletions

34
nvim/lua/utils.lua Normal file
View File

@@ -0,0 +1,34 @@
-- Highlight when yanking (copying) text
-- Try it with `yap` in normal mode
-- See `:help vim.highlight.on_yank()`
vim.api.nvim_create_autocmd("TextYankPost", {
desc = "Highlight when yanking (copying) text",
group = vim.api.nvim_create_augroup("kickstart-highlight-yank", { clear = true }),
callback = function()
vim.highlight.on_yank()
end,
})
-- vim.api.nvim_create_autocmd("ModeChanged", {
-- desc = "Clear highlight when entering visual mode",
-- group = vim.api.nvim_create_augroup("visualmode-hlsearch", {}),
-- callback = function()
-- vim.cmd("nohlsearch")
-- end,
-- })
-- Reopen vim at the last location in the buffer
local lastplace = vim.api.nvim_create_augroup("LastPlace", {})
vim.api.nvim_clear_autocmds({ group = lastplace })
vim.api.nvim_create_autocmd("BufReadPost", {
group = lastplace,
pattern = { "*" },
desc = "remember last cursor place",
callback = function()
local mark = vim.api.nvim_buf_get_mark(0, '"')
local lcount = vim.api.nvim_buf_line_count(0)
if mark[1] > 0 and mark[1] <= lcount then
pcall(vim.api.nvim_win_set_cursor, 0, mark)
end
end,
})