From cbfbcd96e5fd6641ae5aae11f78c582efd26d7ca Mon Sep 17 00:00:00 2001 From: TJ DeVries Date: Tue, 3 Dec 2024 03:09:26 -0500 Subject: [PATCH] start adding init.lua for people --- .../01 - Introduction.md | 0 .../02 - Tutor and Modal Editing.md | 0 .../03 - Lua Crash Course.md | 0 03 - Lua Crash Course/init.lua | 17 +++++++++++++++++ 4 files changed, 17 insertions(+) rename 01 - Introduction.md => 01 - Introduction/01 - Introduction.md (100%) rename 02 - Tutor and Modal Editing.md => 02 - Tutor and Modal Editing/02 - Tutor and Modal Editing.md (100%) rename 03 - Lua Crash Course.md => 03 - Lua Crash Course/03 - Lua Crash Course.md (100%) create mode 100644 03 - Lua Crash Course/init.lua diff --git a/01 - Introduction.md b/01 - Introduction/01 - Introduction.md similarity index 100% rename from 01 - Introduction.md rename to 01 - Introduction/01 - Introduction.md diff --git a/02 - Tutor and Modal Editing.md b/02 - Tutor and Modal Editing/02 - Tutor and Modal Editing.md similarity index 100% rename from 02 - Tutor and Modal Editing.md rename to 02 - Tutor and Modal Editing/02 - Tutor and Modal Editing.md diff --git a/03 - Lua Crash Course.md b/03 - Lua Crash Course/03 - Lua Crash Course.md similarity index 100% rename from 03 - Lua Crash Course.md rename to 03 - Lua Crash Course/03 - Lua Crash Course.md diff --git a/03 - Lua Crash Course/init.lua b/03 - Lua Crash Course/init.lua new file mode 100644 index 0000000..3d48293 --- /dev/null +++ b/03 - Lua Crash Course/init.lua @@ -0,0 +1,17 @@ +-- Day 3 +print("advent of neovim") + +vim.keymap.set("n", "x", "source %") +vim.keymap.set("n", "x", ":.lua") +vim.keymap.set("v", "x", ":lua") + +-- Highlight when yanking (copying) text +-- Try it 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, +})