Skip to content

Commit cb21000

Browse files
committed
feat: yank highlighting, reloading modules, and better netrw
1 parent 33eee9a commit cb21000

File tree

1 file changed

+30
-7
lines changed

1 file changed

+30
-7
lines changed

lua/theprimeagen/init.lua

+30-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,33 @@
11
require("theprimeagen.set")
22
require("theprimeagen.remap")
33

4-
5-
6-
7-
8-
9-
10-
4+
local augroup = vim.api.nvim_create_augroup
5+
local ThePrimeagenGroup = augroup('ThePrimeagen', {})
6+
7+
local autocmd = vim.api.nvim_create_autocmd
8+
local yank_group = augroup('HighlightYank', {})
9+
10+
function R(name)
11+
require("plenary.reload").reload_module(name)
12+
end
13+
14+
autocmd('TextYankPost', {
15+
group = yank_group,
16+
pattern = '*',
17+
callback = function()
18+
vim.highlight.on_yank({
19+
higroup = 'IncSearch',
20+
timeout = 40,
21+
})
22+
end,
23+
})
24+
25+
autocmd({"BufWritePre"}, {
26+
group = ThePrimeagenGroup,
27+
pattern = "*",
28+
command = "%s/\\s\\+$//e",
29+
})
30+
31+
vim.g.netrw_browse_split = 0
32+
vim.g.netrw_banner = 0
33+
vim.g.netrw_winsize = 25

0 commit comments

Comments
 (0)