]> git.huck.website - nvim.git/commitdiff
added: key map for telescope help pages
authorHuck Boles <huck@huck.website>
Thu, 29 Jun 2023 01:16:11 +0000 (20:16 -0500)
committerHuck Boles <huck@huck.website>
Thu, 29 Jun 2023 01:16:11 +0000 (20:16 -0500)
lua/plugins/telescope.lua

index 625b3f83243eacb499b89ad9935d395fd1ba6a08..cfe762b1934063c5ead0d60866e7b7e72c4a3f7a 100644 (file)
@@ -14,6 +14,7 @@ return {
             { '<leader>b',     '<CMD>Telescope buffers<CR>' },
             { '<leader><C-r>', '<CMD>Telescope command_history<CR>' },
             { '<leader>D',     '<CMD>Telescope diagnostics<CR>' },
+            { '<leader>H',     '<CMD>Telescope help_tags<CR>' },
         },
         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