mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
Rework into opts, modify pdfviewer to be os dependent
This commit is contained in:
parent
4b68c4d164
commit
4f1b02ea02
1 changed files with 46 additions and 57 deletions
|
|
@ -7,9 +7,9 @@ return {
|
||||||
end,
|
end,
|
||||||
{
|
{
|
||||||
"R-nvim/R.nvim",
|
"R-nvim/R.nvim",
|
||||||
config = function()
|
lazy = false,
|
||||||
|
opts = {
|
||||||
-- Create a table with the options to be passed to setup()
|
-- Create a table with the options to be passed to setup()
|
||||||
local opts = {
|
|
||||||
R_args = { "--quiet", "--no-save" },
|
R_args = { "--quiet", "--no-save" },
|
||||||
hook = {
|
hook = {
|
||||||
on_filetype = function()
|
on_filetype = function()
|
||||||
|
|
@ -19,7 +19,7 @@ return {
|
||||||
vim.api.nvim_buf_set_keymap(0, "n", "<Enter>", "<Plug>RDSendLine", {})
|
vim.api.nvim_buf_set_keymap(0, "n", "<Enter>", "<Plug>RDSendLine", {})
|
||||||
vim.api.nvim_buf_set_keymap(0, "v", "<Enter>", "<Plug>RSendSelection", {})
|
vim.api.nvim_buf_set_keymap(0, "v", "<Enter>", "<Plug>RSendSelection", {})
|
||||||
|
|
||||||
-- Increase the width of which-key to handle the r-nvim descriptions
|
-- Increase the width of which-key to handle the longer r-nvim descriptions
|
||||||
local wk = require("which-key")
|
local wk = require("which-key")
|
||||||
wk.setup({
|
wk.setup({
|
||||||
layout = {
|
layout = {
|
||||||
|
|
@ -44,27 +44,16 @@ return {
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
min_editor_width = 72,
|
pdfviewer = (function()
|
||||||
rconsole_width = 78,
|
if vim.loop.os_uname().sysname:find("Windows", 1, true) then
|
||||||
disable_cmds = {
|
return "open" -- according to @Aman9das on Github
|
||||||
"RClearConsole",
|
elseif vim.loop.os_uname().sysname:find("Darwin", 1, true) then
|
||||||
"RCustomStart",
|
return "open"
|
||||||
"RSPlot",
|
else
|
||||||
"RSaveClose",
|
return "xdg-open" -- according to @Aman9das on Github
|
||||||
},
|
|
||||||
synctex = false,
|
|
||||||
pdfviewer = "open",
|
|
||||||
}
|
|
||||||
-- Check if the environment variable "R_AUTO_START" exists.
|
|
||||||
-- If using fish shell, you could put in your config.fish:
|
|
||||||
-- alias r "R_AUTO_START=true nvim"
|
|
||||||
if vim.env.R_AUTO_START == "true" then
|
|
||||||
opts.auto_start = "on startup"
|
|
||||||
opts.objbr_auto_start = true
|
|
||||||
end
|
end
|
||||||
require("r").setup(opts)
|
end)(),
|
||||||
end,
|
},
|
||||||
lazy = false,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"hrsh7th/nvim-cmp",
|
"hrsh7th/nvim-cmp",
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue