Created
April 13, 2022 18:22
-
-
Save lopesivan/f83e862dc7884c4f901aea352cc7d291 to your computer and use it in GitHub Desktop.
última postagem do dia, a migração de código está fluindo bem, então compartilho esse trecho de código com vcs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
última postagem do dia, a migração de código está fluindo bem, então | |
compartilho esse trecho de código com vcs. | |
Arquivo 1: em vimscript -- DEPRECATED | |
" on_yank.vim - on_yank | |
" Maintainer: Ivan Lopes | |
" ~/.config/nvim/after/plugin | |
" Cool highlighting | |
augroup LuaHighlight | |
au! | |
au TextYankPost * lua vim.highlight.on_yank { | |
\ higroup = "Substitute", | |
\ timeout = 150, | |
\ on_macro = true | |
\ } | |
augroup END | |
Arquivo 2: em lua | |
-- on_yank.lua - on_yank | |
-- Maintainer: Ivan Lopes | |
-- ~/.config/nvim/after/plugin | |
local group = vim.api.nvim_create_augroup("LuaHighlight", {clear = true}) | |
vim.api.nvim_create_autocmd("TextYankPost", { | |
group = group, | |
pattern = "*", | |
callback = function() vim.highlight.on_yank({ | |
higroup = "Substitute", | |
timeout = 150, | |
on_macro = true | |
}) | |
end, | |
}) | |
-- vim: fdm=marker:sw=4:sts=4:et |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment