init
This commit is contained in:
commit
1e2ca5a6fc
71 changed files with 3330 additions and 0 deletions
38
config/TextYankPost.nix
Normal file
38
config/TextYankPost.nix
Normal 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
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue