Replies: 3 comments 3 replies
-
|
I do it this way... in my keymaps.lua file: local function set_rnvim_keymaps()
-- you can disable keymaps like this:
pcall(vim.api.nvim_buf_del_keymap, 0, "n", "<leader>rf")
-- and add keymaps like this:
local opts_keymap = { noremap = true, silent = true, buffer = true }
vim.keymap.set("n", "<leader>sb", "<Plug>RSendFile", opts_keymap)
end
-- Then, "load" them based on the filetypes of interest
vim.api.nvim_create_autocmd("FileType", {
pattern = { "r", "rmd", "Rmd", "rnoweb" },
callback = function()
set_rnvim_keymaps()
end,
})I hope this helps :) |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
This is what I am using in the local map_opts = { noremap = true, silent = true, buffer = 0 }
local function set_keymap(mode, lhs, rhs, opts)
vim.keymap.set(mode, lhs, rhs, opts or map_opts)
end
set_keymap("n", "<leander>-sb", "<Plug>RSendFile", { silent = true })
|
Beta Was this translation helpful? Give feedback.
3 replies
-
|
It only works for R files. For Quarto, we have |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
hey - i am trying to have this mapping to send the whole file. but it does not seem to work. can you maybe see why? I would appreciate it thanks a lot.
Beta Was this translation helpful? Give feedback.
All reactions