From: Huck Boles Date: Thu, 29 Jun 2023 01:16:11 +0000 (-0500) Subject: added: key map for telescope help pages X-Git-Url: https://git.huck.website/?a=commitdiff_plain;h=e2a33f4495d9c6b6f0ba3b13a661b991106e2919;p=nvim.git added: key map for telescope help pages --- diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua index 625b3f8..cfe762b 100644 --- a/lua/plugins/telescope.lua +++ b/lua/plugins/telescope.lua @@ -14,6 +14,7 @@ return { { 'b', 'Telescope buffers' }, { '', 'Telescope command_history' }, { 'D', 'Telescope diagnostics' }, + { 'H', 'Telescope help_tags' }, }, config = function() require('telescope').setup { @@ -44,26 +45,26 @@ return { vim.api.nvim_create_autocmd('VimEnter', { pattern = '*', callback = function() - local arg = vim.api.nvim_eval('argv(0)') - if arg and (vim.fn.isdirectory(arg) ~= 0 or arg == "") then - vim.defer_fn(function() - local function is_git_repo() - vim.fn.system("git rev-parse --is-inside-work-tree") - return vim.v.shell_error == 0 - end - local function get_git_root() - local dot_git_path = vim.fn.finddir(".git", ".;") - return vim.fn.fnamemodify(dot_git_path, ":h") - end - local opts = {} - if is_git_repo() then - opts = { - cwd = get_git_root(), - } - end - require("telescope.builtin").find_files(opts) - end, 10) - end + local arg = vim.api.nvim_eval('argv(0)') + if arg and (vim.fn.isdirectory(arg) ~= 0 or arg == "") then + vim.defer_fn(function() + local function is_git_repo() + vim.fn.system("git rev-parse --is-inside-work-tree") + return vim.v.shell_error == 0 + end + local function get_git_root() + local dot_git_path = vim.fn.finddir(".git", ".;") + return vim.fn.fnamemodify(dot_git_path, ":h") + end + local opts = {} + if is_git_repo() then + opts = { + cwd = get_git_root(), + } + end + require("telescope.builtin").find_files(opts) + end, 10) + end end }) end