From 88a55e21bcd9dbfd6994aa21d3b73d1629b939bd Mon Sep 17 00:00:00 2001 From: Marcelo Jacobus Date: Tue, 17 Sep 2024 10:11:27 -0300 Subject: [PATCH] Not sure this works. I will check later. Changed: after/ftplugin/ruby.lua --- after/ftplugin/ruby.lua | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/after/ftplugin/ruby.lua b/after/ftplugin/ruby.lua index 5cbe469..2f5366f 100644 --- a/after/ftplugin/ruby.lua +++ b/after/ftplugin/ruby.lua @@ -1,10 +1,20 @@ -vim.cmd([[ - autocmd FileType ruby nnoremap cs :lua RunRubocop() -]]) +local map = LazyVim.safe_keymap_set -vim.cmd([[ - autocmd FileType ruby nnoremap x :lua RunInTerminal("ruby " .. vim.fn.expand('%'), true) -]]) +-- map("n", "x", ":lua RunInTerminal('ruby ' .. vim.fn.expand('%'), true)", { buffer = true }) + +print("haa") +map("n", "x", function() + print("Running ruby file") + -- RunInTerminal("ruby " .. vim.fn.expand('%'), true) +end, { desc = "Execute ruby file", buffer = true }) + +-- vim.cmd([[ +-- autocmd FileType ruby nnoremap cs :lua RunRubocop() +-- ]]) +-- +-- vim.cmd([[ +-- autocmd FileType ruby nnoremap x :lua RunInTerminal("ruby " .. vim.fn.expand('%'), true) +-- ]]) -- Maybe this -- vim.api.nvim_create_autocmd("FileType", {