From 3d4bca0adaf5871c36feab67096f08fec8425d5a Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Tue, 10 Dec 2024 16:55:45 +0000 Subject: [PATCH] Execute Lua code in the current file, range or ...line --- nvim/lua/opdavies/keymaps.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nvim/lua/opdavies/keymaps.lua b/nvim/lua/opdavies/keymaps.lua index d36ff26..8044134 100644 --- a/nvim/lua/opdavies/keymaps.lua +++ b/nvim/lua/opdavies/keymaps.lua @@ -6,8 +6,10 @@ set("n", "so", ":call opdavies#save_and_exec()") set("n", "g", "gqap") set("x", "g", "gqa") --- Make the current file executable -set("n", "x", ":!chmod +x %") +-- Execute Lua in the current file, line or range. +set("n", "x", "source %") +set("n", "x", ":.lua") +set("v", "x", ":lua") -- Yank from the current column to the end of the line set("n", "Y", "yg$")