This commit is contained in:
sharings 2025-07-26 12:43:01 +00:00
commit 1e2ca5a6fc
71 changed files with 3330 additions and 0 deletions

38
config/TextYankPost.nix Normal file
View file

@ -0,0 +1,38 @@
{ helpers, ... }:
let
inherit (helpers) mkRaw;
in
{
# https://github.com/nvim-lua/kickstart.nvim/blob/2ba39c69736597b60f6033aa3f8526e7c28343d5/init.lua#L196-L205
# Highlight when yakning (copying) text
# Try in 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,
# })
# https://www.youtube.com/watch?v=m8C0Cq9Uv9o&t=7m50s
# TJ: setup groups to prevent "duplicate event listeners", prevent running
# code twice
autoGroups = {
kickstart-highlight-yank = {
clear = true;
};
};
autoCmd = [
{
event = [ "TextYankPost" ];
desc = "Highlight when yanking (copying) text";
group = "kickstart-highlight-yank";
callback = mkRaw ''
function()
vim.highlight.on_yank()
end
'';
}
];
}