diff --git a/lua/theprimeagen/remap.lua b/lua/theprimeagen/remap.lua index e165d1ab..cfbb8f8e 100644 --- a/lua/theprimeagen/remap.lua +++ b/lua/theprimeagen/remap.lua @@ -45,7 +45,19 @@ vim.keymap.set("n", "x", "!chmod +x %", { silent = true }) vim.keymap.set("n", "vpp", "e ~/.dotfiles/nvim/.config/nvim/lua/theprimeagen/packer.lua"); vim.keymap.set("n", "mr", "CellularAutomaton make_it_rain"); +--vim.keymap.set("n", "", function() +-- vim.cmd("so") +--end) vim.keymap.set("n", "", function() - vim.cmd("so") + -- save file + vim.cmd.w() + -- if lua file and is in nvim config dir :so the file + local current_file_path = vim.api.nvim_buf_get_name(0) + local is_in_config = current_file_path:find("^"..vim.fn.stdpath("config")) ~= nil + local is_lua = current_file_path:find(".lua$") ~= nil + if (is_in_config and is_lua) then + vim.cmd.so() + end + -- probally I could do to another languages end)