From 138b4a262f47819aec432f4ca710dbefe8b4723a Mon Sep 17 00:00:00 2001 From: Andrzej Date: Wed, 15 May 2024 12:12:43 +0200 Subject: [PATCH] add keymap opens a new vsplit and *then* the devdocs picker --- nvim/.config/nvim/lua/plugins/docs.lua | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/nvim/.config/nvim/lua/plugins/docs.lua b/nvim/.config/nvim/lua/plugins/docs.lua index e8c0a1c..0d5eaa9 100644 --- a/nvim/.config/nvim/lua/plugins/docs.lua +++ b/nvim/.config/nvim/lua/plugins/docs.lua @@ -5,6 +5,14 @@ return { "nvim-telescope/telescope.nvim", "nvim-treesitter/nvim-treesitter", }, + init = function() + vim.keymap.set( + "n", + "sm", + "vnewDevdocsOpenCurrent", + { desc = "[S]earch the Friendly [M]anual" } + ) + end, opts = { dir_path = vim.fn.stdpath("data") .. "/devdocs", -- installation directory telescope = {}, -- passed to the telescope picker @@ -21,10 +29,10 @@ return { }, wrap = false, -- text wrap, only applies to floating window previewer_cmd = nil, -- for example: "glow" - cmd_args = {}, -- example using glow: { "-s", "dark", "-w", "80" } + cmd_args = { "-s", "dark", "-w", "80" }, cmd_ignore = {}, -- ignore cmd rendering for the listed docs picker_cmd = false, -- use cmd previewer in picker preview - picker_cmd_args = {}, -- example using glow: { "-s", "dark", "-w", "50" } + picker_cmd_args = { "-s", "dark", "-w", "50" }, mappings = { -- keymaps for the doc buffer open_in_browser = "", },