]> git.frustrated-labs.net Git - dotfiles.git/commitdiff
nvim: configure highlight on yank autocmd
authorAlexander Goussas <[email protected]>
Sun, 15 Jun 2025 05:17:16 +0000 (00:17 -0500)
committerAlexander Goussas <[email protected]>
Sun, 15 Jun 2025 05:17:16 +0000 (00:17 -0500)
nvim/.config/nvim/init.lua
nvim/.config/nvim/lua/autocmds.lua [new file with mode: 0644]
nvim/.config/nvim/lua/options.lua [new file with mode: 0644]

index 57dd1be38ca4e877a4031727e6d07950e9ae0d9a..85246431eeba12e285b82a88b779bfd0bcd690cc 100644 (file)
@@ -1,26 +1,5 @@
-vim.o.number = true
-vim.o.signcolumn = 'yes'
-
--- Splitting
-vim.o.splitbelow = true
-vim.o.splitright = true
-vim.o.wrap = false
-
--- Indenting
-vim.o.shiftwidth = 2
-vim.o.shiftround = true
-vim.o.tabstop = 2
-vim.o.softtabstop = 2
-vim.o.expandtab = true
-
--- Statusline
-vim.o.laststatus = 0
-vim.o.termguicolors = true
--- vim.cmd('colorscheme grey')
-
--- Netrw
-vim.g.loaded_netrw = 1
-vim.g.loaded_netrwPlugin = 1
+require("options")
+require("autocmds")
 
 local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
 if not (vim.uv or vim.loop).fs_stat(lazypath) then
diff --git a/nvim/.config/nvim/lua/autocmds.lua b/nvim/.config/nvim/lua/autocmds.lua
new file mode 100644 (file)
index 0000000..e1392aa
--- /dev/null
@@ -0,0 +1,7 @@
+vim.api.nvim_create_autocmd("TextYankPost", {
+  pattern = "*",
+  desc = "Highlight on yank",
+  callback = function()
+    vim.highlight.on_yank({ timeout = 200 })
+  end,
+})
diff --git a/nvim/.config/nvim/lua/options.lua b/nvim/.config/nvim/lua/options.lua
new file mode 100644 (file)
index 0000000..7cb4a2a
--- /dev/null
@@ -0,0 +1,22 @@
+vim.o.number = true
+vim.o.signcolumn = 'yes'
+
+-- Splitting
+vim.o.splitbelow = true
+vim.o.splitright = true
+vim.o.wrap = false
+
+-- Indenting
+vim.o.shiftwidth = 2
+vim.o.shiftround = true
+vim.o.tabstop = 2
+vim.o.softtabstop = 2
+vim.o.expandtab = true
+
+-- Statusline
+vim.o.laststatus = 0
+vim.o.termguicolors = true
+
+-- Netrw
+vim.g.loaded_netrw = 1
+vim.g.loaded_netrwPlugin = 1