Skip to content

Commit

Permalink
Updated documentation based on Issue #352 (#354)
Browse files Browse the repository at this point in the history
Include the conditional Rmd/Rnw logic for reassigning the InsertChunk keymap.
  • Loading branch information
richardsc authored Mar 2, 2025
1 parent ef3706b commit 80c4b4d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions doc/R.nvim.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2206,8 +2206,11 @@ key bindings. Examples:

-- Emulate some of Nvim-R's default key bindings:
vim.api.nvim_buf_set_keymap(0, "i", "_", "<Plug>RInsertAssign", { noremap = true })
vim.api.nvim_buf_set_keymap(0, "i", "<", "<Plug>RnwInsertChunk", { noremap = true })
vim.api.nvim_buf_set_keymap(0, "i", "`", "<Plug>RmdInsertChunk", { noremap = true })
if vim.bo.filetype == "rnoweb" then
vim.api.nvim_buf_set_keymap(0, "i", "<", "<Plug>RnwInsertChunk", { noremap = true })
elseif vim.bo.filetype == "rmd" or vim.bo.filetype == "quarto" then
vim.api.nvim_buf_set_keymap(0, "i", "`", "<Plug>RmdInsertChunk", { noremap = true })
end
end,
}
<
Expand Down

0 comments on commit 80c4b4d

Please sign in to comment.