-- after/ftplugin/ruby.lua -- local lspconfig = require("lspconfig") -- lspconfig.ruby_lsp.setup({ -- cmd = { vim.fn.expand("~/.asdf/shims/ruby"), "-S", "ruby-lsp" }, -- }) local map = vim.keymap.set -- map("n", "x", ":lua RunInTerminal('ruby ' .. vim.fn.expand('%'), true)", { buffer = true }) map("n", "x", function() 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", { -- pattern = "ruby", -- callback = function() -- map("n", "x", ":lua RunInTerminal('ruby ' .. vim.fn.expand('%'), true)", { buffer = true }) -- end, -- })