Skip to content

Instantly share code, notes, and snippets.

@roycrippen4
roycrippen4 / telescope.lua
Created December 12, 2024 19:52
Load plugin before opening its help via telescope.nvim
-- Adapt code to package manager of your choice.
-- I am using lazy.nvim in this example
local help_tag_mapping = {
['<CR>'] = function(prompt_bufnr)
local selection = require('telescope.actions.state').get_selected_entry()
if not selection then
return
end
local doc_path = selection.filename or selection.path
@roycrippen4
roycrippen4 / inspector.lua
Created October 8, 2024 23:54
Inspect nvim highlight groups under mouse cursor in a floating window
local api = vim.api
local cmd = vim.cmd
local fn = vim.fn
local iter = vim.iter
local autocmd = api.nvim_create_autocmd
local close_win = api.nvim_win_close
local create_buf = api.nvim_create_buf
local create_namespace = api.nvim_create_namespace
local get_current_win = api.nvim_get_current_win