From 80c4b4d72e778ee52a1f65c4ab127d34d61b90c5 Mon Sep 17 00:00:00 2001 From: Clark Richards Date: Sat, 1 Mar 2025 22:32:47 -0400 Subject: [PATCH] Updated documentation based on Issue #352 (#354) Include the conditional Rmd/Rnw logic for reassigning the InsertChunk keymap. --- doc/R.nvim.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/R.nvim.txt b/doc/R.nvim.txt index c9eba91c..cfb34dc4 100644 --- a/doc/R.nvim.txt +++ b/doc/R.nvim.txt @@ -2206,8 +2206,11 @@ key bindings. Examples: -- Emulate some of Nvim-R's default key bindings: vim.api.nvim_buf_set_keymap(0, "i", "_", "RInsertAssign", { noremap = true }) - vim.api.nvim_buf_set_keymap(0, "i", "<", "RnwInsertChunk", { noremap = true }) - vim.api.nvim_buf_set_keymap(0, "i", "`", "RmdInsertChunk", { noremap = true }) + if vim.bo.filetype == "rnoweb" then + vim.api.nvim_buf_set_keymap(0, "i", "<", "RnwInsertChunk", { noremap = true }) + elseif vim.bo.filetype == "rmd" or vim.bo.filetype == "quarto" then + vim.api.nvim_buf_set_keymap(0, "i", "`", "RmdInsertChunk", { noremap = true }) + end end, } <