Files
dotfiles/common/.config/nvim/lua/config/autocmd.lua
Pratik Tripathy ae6d1cebb8 refactor(neovim): Rename files, move plugin declarations around, remove
plugins completely

- Removed: dotnet with all related configs & plugins
- Removed: `vim-highlightedyank` replaced with autocommand
- Moved: `indent-blankline` from `code-generic` -> `ui`
- Moved: All javascript plugins to `code-lsp`: WIP
- Moved: `vim-easymotion` from `code-navigation` -> `navigation`
- Renamed: `code-completion` -> `completion`
- Renamed: `code-formatting` -> `formatting`
- Renamed: `code-git` -> `git`
- Renamed: `code-lint` -> `lint`
- Renamed: `navigate-files` -> `navigation`
2025-07-28 12:54:04 +05:30

28 lines
936 B
Lua

-- Auto reload existing session
if not vim.g.vscode then
vim.api.nvim_create_autocmd("VimEnter", {
group = vim.api.nvim_create_augroup("restore_session", { clear = true }),
callback = function()
-- If nvim started with arguments, do NOT restore
if vim.fn.argc() ~= 0 then
return
end
require("persistence").load()
end,
nested = true,
})
end
vim.api.nvim_create_autocmd("TextYankPost", {
desc = "Highlight when yanking text",
group = vim.api.nvim_create_augroup("highlight-yank", { clear = true }),
callback = function()
vim.highlight.on_yank({
higroup = "Visual", -- Highlight group to use
timeout = 400, -- Duration in milliseconds
on_visual = true, -- Highlight visual selections
on_macro = false, -- Don't highlight during macro playback
})
end,
})