### Install overlook.nvim with lazy.nvim Source: https://github.com/williamhsieh/overlook.nvim/blob/master/README.md Installation instructions for overlook.nvim using the lazy.nvim package manager. Includes example keybindings for common actions like peeking definitions, closing all popups, and restoring popups. ```lua { "WilliamHsieh/overlook.nvim", opts = {}, -- Optional: set up common keybindings keys = { { "pd", function() require("overlook.api").peek_definition() end, desc = "Overlook: Peek definition" }, { "pc", function() require("overlook.api").close_all() end, desc = "Overlook: Close all popup" }, { "pu", function() require("overlook.api").restore_popup() end, desc = "Overlook: Restore popup" }, }, } ``` -------------------------------- ### Initialize and Configure overlook.nvim with M.setup() Source: https://github.com/williamhsieh/overlook.nvim/blob/master/doc/overlook-setup.txt The `M.setup()` function initializes and configures the overlook.nvim plugin. It accepts an optional `opts` table containing user-defined configuration settings. This function should be invoked from the user's Neovim configuration file, typically using `require('overlook').setup(opts)`. Example configurations include UI settings like border style and row offset. ```lua require("overlook").setup({ ui = { border = "single", row_offset = 2 } }) ``` -------------------------------- ### Get Current Overlook Configuration (Lua) Source: https://github.com/williamhsieh/overlook.nvim/blob/master/doc/overlook-config.txt Retrieves the active configuration table after user modifications via M.setup(). Primarily used internally by overlook modules. External modules can access `require('overlook.config').options` if setup timing is handled. ```lua local opts = require("overlook.config").get() ``` -------------------------------- ### Setup Overlook UI Configuration Source: https://github.com/williamhsieh/overlook.nvim/blob/master/doc/overlook-config.txt Demonstrates how to set up the overlook.nvim plugin with custom UI configurations. This includes setting border styles, offsets, and size ratios for popups. ```lua require('overlook').setup({ ui = { border = "single", row_offset = 2, size_ratio = 0.8 } }) ``` -------------------------------- ### Create Custom Synchronous Overlook Adapter Source: https://context7.com/williamhsieh/overlook.nvim/llms.txt Demonstrates how to create and configure a custom synchronous adapter for overlook.nvim. This adapter defines a 'get' function that returns information about where to peek, such as target buffer number, line, column, and a title. It's then registered with overlook's setup. ```lua -- Define a custom adapter for peeking at specific locations local custom_adapter = { -- Synchronous adapter get = function(custom_param) local bufnr = vim.api.nvim_get_current_buf() local filepath = vim.api.nvim_buf_get_name(bufnr) return { target_bufnr = bufnr, lnum = 1, -- Line number to peek at col = 1, -- Column position title = "Custom: " .. vim.fn.fnamemodify(filepath, ":t"), } end } -- Configure overlook with custom adapter require("overlook").setup({ adapters = { my_custom = custom_adapter, } }) -- Use the custom adapter require("overlook.peek").my_custom() ``` -------------------------------- ### Configure overlook.nvim UI and Callbacks Source: https://github.com/williamhsieh/overlook.nvim/blob/master/README.md Example configuration for overlook.nvim, demonstrating how to customize UI elements such as border style, offsets, and size ratios. It also shows how to set up an optional callback function to be executed when all popups are closed. ```lua require("overlook").setup({ -- UI settings for popup windows ui = { border = "rounded", -- Border style: "none", "single", "double", "rounded", etc. z_index_base = 30, -- Base z-index for first popup row_offset = 2, -- Initial row offset from cursor col_offset = 5, -- Initial column offset from cursor stack_row_offset = 1, -- Vertical offset for stacked popups stack_col_offset = 2, -- Horizontal offset for stacked popups width_decrement = 2, -- Width reduction for each stacked popup height_decrement = 1, -- Height reduction for each stacked popup min_width = 10, -- Minimum popup width min_height = 3, -- Minimum popup height size_ratio = 0.65, -- Default size ratio (0.0 to 1.0) keys = { close = "q", -- Key to close the topmost popup }, }, -- Optional callback when all popups are closed on_stack_empty = function() -- Your custom logic here end, }) ``` -------------------------------- ### Get Overlook Configuration Source: https://github.com/williamhsieh/overlook.nvim/blob/master/doc/overlook-config.txt Shows how to directly access the current configuration settings of overlook.nvim. This is useful for inspecting or dynamically modifying settings. ```lua local opts = require('overlook.config').get() ``` -------------------------------- ### Install overlook.nvim with lazy.nvim and Define Keybindings Source: https://context7.com/williamhsieh/overlook.nvim/llms.txt Installs the overlook.nvim plugin using the lazy.nvim package manager and sets up keybindings for core functionalities like peeking definitions, closing all popups, and restoring popups. This snippet shows how to integrate the plugin into a Neovim configuration. ```lua { "WilliamHsieh/overlook.nvim", opts = {}, keys = { { "pd", function() require("overlook.api").peek_definition() end, desc = "Overlook: Peek definition" }, { "pc", function() require("overlook.api").close_all() end, desc = "Overlook: Close all popup" }, { "pu", function() require("overlook.api").restore_popup() end, desc = "Overlook: Restore popup" }, }, } ``` -------------------------------- ### Default Overlook Configuration Options Source: https://github.com/williamhsieh/overlook.nvim/blob/master/doc/overlook-config.txt Provides the default configuration options for overlook.nvim. Users can override these defaults when calling the setup function. It details UI settings like borders, z-index, offsets, and size, as well as adapter configurations. ```lua local defaults = { -- UI settings for the popup windows ui = { -- Border style for popups. Accepts same values as nvim_open_win's 'border' option border = "rounded", -- Base z-index for the first popup. Subsequent popups increment from here. -- Higher values appear visually on top. z_index_base = 30, -- Initial row offset relative to the cursor for the first popup. row_offset = 0, -- Initial column offset relative to the cursor for the first popup. col_offset = 0, -- Vertical offset for subsequent stacked popups relative to the previous popup's top border. stack_row_offset = 0, -- Column offset for subsequent stacked popups relative to the previous popup's top-left corner. stack_col_offset = 0, -- Amount by which the width decreases for each subsequent popup in the stack. width_decrement = 1, -- Amount by which the height decreases for each subsequent popup in the stack. height_decrement = 1, -- Minimum allowed width for any popup window, prevents shrinking to zero. min_width = 10, -- Minimum allowed height for any popup window (must be >= 3 for border+title+content). min_height = 3, -- Default size ratio (0.0 to 1.0) used to calculate initial size. size_ratio = 0.65, -- Keymaps specific to the popup UI keys = { close = "q", -- Key to close the topmost popup }, }, -- Adapter-specific configurations adapters = { -- check `overlook.adapter.cursor` for implementation details your_custom_adapter = { ---@return OverlookPopupOptions? @Table suitable for overlook.ui.create_popup, or nil on error. get = function() end, }, }, -- Optional hook called when the last Overlook popup closes on_stack_empty = nil, } ``` -------------------------------- ### Create Custom Asynchronous Overlook Adapter Source: https://context7.com/williamhsieh/overlook.nvim/llms.txt Illustrates creating an asynchronous adapter for overlook.nvim, suitable for operations like LSP requests. The adapter includes an 'async_create_popup' function that performs an asynchronous operation and then calls a callback with the popup details. This allows for non-blocking interactions. ```lua -- Define an async adapter for custom LSP operations local async_adapter = { async = true, async_create_popup = function(create_popup_callback, opts) -- Perform async operation (e.g., LSP request) vim.lsp.buf.definition({ on_list = function(result) local item = result.items[1] if not item then vim.notify("No definition found", vim.log.levels.WARN) return end create_popup_callback({ target_bufnr = vim.uri_to_bufnr(item.user_data.uri), lnum = item.lnum, col = item.col, title = item.filename, }) end, }) end } -- Register and use the async adapter require("overlook").setup({ adapters = { my_async_adapter = async_adapter, } }) ``` -------------------------------- ### Window Promotion Functions Source: https://github.com/williamhsieh/overlook.nvim/blob/master/doc/overlook-api.txt Functions for opening peeked content in different window types. ```APIDOC ## open_in_split ### Description Open the peeked content in a horizontal split. Instead of opening the peeked content in a floating popup, this function opens it in a new horizontal split window. This allows for more persistent viewing of the content. ### Method `M.open_in_split`() ### Parameters None ### Request Example ```lua require("overlook.api").open_in_split() ``` ### Response None ### Response Example None ``` ```APIDOC ## open_in_vsplit ### Description Open the peeked content in a vertical split. Similar to `open_in_split`, this function opens the peeked content in a new vertical split window, providing an alternative layout for viewing the content. ### Method `M.open_in_vsplit`() ### Parameters None ### Request Example ```lua require("overlook.api").open_in_vsplit() ``` ### Response None ### Response Example None ``` ```APIDOC ## open_in_tab ### Description Open the peeked content in a new tab page. This function opens the peeked content in a completely new tab page, isolating it from the current window and allowing for focused work on the peeked content. ### Method `M.open_in_tab`() ### Parameters None ### Request Example ```lua require("overlook.api").open_in_tab() ``` ### Response None ### Response Example None ``` ```APIDOC ## open_in_original_window ### Description Open the peeked content in the original window. This function opens the peeked content in the same window where the peek action was initiated, effectively replacing the current buffer or view with the peeked content. This can be useful if you decide you want to fully navigate to the peeked location. ### Method `M.open_in_original_window`() ### Parameters None ### Request Example ```lua require("overlook.api").open_in_original_window() ``` ### Response None ### Response Example None ``` -------------------------------- ### Configure overlook.nvim UI and Callbacks Source: https://context7.com/williamhsieh/overlook.nvim/llms.txt Initializes overlook.nvim with custom UI settings and defines a callback function to execute when all popups are closed. This configuration allows customization of border styles, offsets, dimensions, and keybindings for popup management. ```lua require("overlook").setup({ ui = { border = "rounded", -- Border style: "none", "single", "double", "rounded", etc. z_index_base = 30, -- Base z-index for first popup row_offset = 2, -- Initial row offset from cursor col_offset = 5, -- Initial column offset from cursor stack_row_offset = 1, -- Vertical offset for stacked popups stack_col_offset = 2, -- Horizontal offset for stacked popups width_decrement = 2, -- Width reduction for each stacked popup height_decrement = 1, -- Height reduction for each stacked popup min_width = 10, -- Minimum popup width min_height = 3, -- Minimum popup height size_ratio = 0.65, -- Default size ratio (0.0 to 1.0) keys = { close = "q", -- Key to close the topmost popup }, }, on_stack_empty = function() -- Custom logic when all popups are closed print("All popups closed") end, }) ``` -------------------------------- ### Configure Essential Keybindings in Lua Source: https://github.com/williamhsieh/overlook.nvim/blob/master/README.md Sets up Neovim keybindings using vim.keymap.set for various overlook.nvim functions. These bindings allow users to quickly trigger actions like peeking definitions, managing popups, and switching focus. No external dependencies are required beyond the overlook.nvim plugin itself. ```lua vim.keymap.set("n", "pd", require("overlook.api").peek_definition, { desc = "Peek definition" }) vim.keymap.set("n", "pp", require("overlook.api").peek_cursor, { desc = "Peek cursor" }) vim.keymap.set("n", "pu", require("overlook.api").restore_popup, { desc = "Restore last popup" }) vim.keymap.set("n", "pU", require("overlook.api").restore_all_popups, { desc = "Restore all popups" }) vim.keymap.set("n", "pc", require("overlook.api").close_all, { desc = "Close all popups" }) vim.keymap.set("n", "pf", require("overlook.api").switch_focus, { desc = "Switch focus" }) vim.keymap.set("n", "ps", require("overlook.api").open_in_split, { desc = "Open popup in split" }) vim.keymap.set("n", "pv", require("overlook.api").open_in_vsplit, { desc = "Open popup in vsplit" }) vim.keymap.set("n", "pt", require("overlook.api").open_in_tab, { desc = "Open popup in tab" }) vim.keymap.set("n", "po", require("overlook.api").open_in_original_window, { desc = "Open popup in current window" }) ``` -------------------------------- ### Window Promotion Functions Source: https://github.com/williamhsieh/overlook.nvim/blob/master/doc/overlook-api.txt Functions to promote the top popup to different window types. ```APIDOC ## `M.open_in_split` ### Description Open the top popup to a horizontal split window. Converts the topmost popup in the current stack to a regular horizontal split window. The popup is closed and its buffer content is opened in a new split, preserving cursor position and allowing normal window navigation. Shows an error if no popup is available to promote. ### Method `CALL` ### Endpoint `overlook.api.open_in_split()` ### Parameters None ### Request Example ```lua require("overlook.api").open_in_split() ``` ### Response #### Success Response Promotes the top popup to a horizontal split. #### Response Example (No specific response body, action is visual) ## `M.open_in_vsplit` ### Description Open the top popup to a vertical split window. Converts the topmost popup in the current stack to a regular vertical split window. The popup is closed and its buffer content is opened in a new vsplit, preserving cursor position and allowing normal window navigation. Shows an error if no popup is available to promote. ### Method `CALL` ### Endpoint `overlook.api.open_in_vsplit()` ### Parameters None ### Request Example ```lua require("overlook.api").open_in_vsplit() ``` ### Response #### Success Response Promotes the top popup to a vertical split. #### Response Example (No specific response body, action is visual) ## `M.open_in_tab` ### Description Open the top popup to a new tab. Converts the topmost popup in the current stack to a new tab window. The popup is closed and its buffer content is opened in a new tab, preserving cursor position and allowing full tab functionality. Shows an error if no popup is available to promote. ### Method `CALL` ### Endpoint `overlook.api.open_in_tab()` ### Parameters None ### Request Example ```lua require("overlook.api").open_in_tab() ``` ### Response #### Success Response Promotes the top popup to a new tab. #### Response Example (No specific response body, action is visual) ## `M.open_in_original_window` ### Description Open the top popup to replace the original window content. Converts the topmost popup to occupy the original window that spawned it. The popup is closed and its buffer content replaces the original window's content, preserving cursor position. This effectively "commits" the popup content to become the main window's content. Shows an error if no popup is available to promote. ### Method `CALL` ### Endpoint `overlook.api.open_in_original_window()` ### Parameters None ### Request Example ```lua require("overlook.api").open_in_original_window() ``` ### Response #### Success Response Promotes the top popup to replace the original window content. #### Response Example (No specific response body, action is visual) ``` -------------------------------- ### Peek LSP Definition in a Floating Popup Source: https://context7.com/williamhsieh/overlook.nvim/llms.txt Sets up a keybinding to trigger the 'peek_definition' function from overlook.nvim. This allows users to view the Language Server Protocol (LSP) definition of a symbol under the cursor in an editable floating popup window. The popup can be edited and saved, and closed with 'q'. ```lua -- Set up keybinding for peek definition vim.keymap.set("n", "pd", function() require("overlook.api").peek_definition() end, { desc = "Peek definition" }) -- Usage: Place cursor on a function name and press pd -- The definition will open in a floating popup -- You can edit the popup content and save with :w -- Press 'q' to close the popup ``` -------------------------------- ### Configure Neovim Keybindings for overlook.nvim Source: https://context7.com/williamhsieh/overlook.nvim/llms.txt Sets up Lua keybindings for overlook.nvim features such as peeking definitions, managing popup stacks, and opening popups in different window types (split, vsplit, tab). This configuration utilizes `vim.keymap.set` for Neovim's built-in keymapping system. ```lua -- Complete keybinding setup for overlook.nvim local overlook = require("overlook.api") -- Peek operations vim.keymap.set("n", "pd", overlook.peek_definition, { desc = "Peek definition" }) vim.keymap.set("n", "pp", overlook.peek_cursor, { desc = "Peek cursor" }) vim.keymap.set("n", "pm", overlook.peek_mark, { desc = "Peek mark" }) -- Stack management vim.keymap.set("n", "pu", overlook.restore_popup, { desc = "Restore last popup" }) vim.keymap.set("n", "pU", overlook.restore_all_popups, { desc = "Restore all popups" }) vim.keymap.set("n", "pc", overlook.close_all, { desc = "Close all popups" }) vim.keymap.set("n", "pf", overlook.switch_focus, { desc = "Switch focus" }) -- Window promotion vim.keymap.set("n", "ps", overlook.open_in_split, { desc = "Open popup in split" }) vim.keymap.set("n", "pv", overlook.open_in_vsplit, { desc = "Open popup in vsplit" }) vim.keymap.set("n", "pt", overlook.open_in_tab, { desc = "Open popup in tab" }) vim.keymap.set("n", "po", overlook.open_in_original_window, { desc = "Open in current window" }) ``` -------------------------------- ### Peek Definition with LSP Source: https://github.com/williamhsieh/overlook.nvim/blob/master/doc/overlook-api.txt Peeks at the LSP definition under the cursor, creating a floating popup. Displays LSP info and stacks with other popups. Shows notifications if LSP is unavailable or definition not found. ```lua vim.keymap.set("n", "pd", require("overlook.api").peek_definition) ``` -------------------------------- ### Promote Overlook Popup to Tab Source: https://context7.com/williamhsieh/overlook.nvim/llms.txt Sets up a keybinding to convert a floating overlook popup into a new tab window. This action closes the original popup and opens its content in a new tab, allowing full tab functionality. This is useful for dedicating a new tab to explore content discovered in a popup. ```lua -- Set up keybinding to promote popup to tab vim.keymap.set("n", "pt", function() require("overlook.api").open_in_tab() end, { desc = "Open popup in new tab" }) -- Usage: Press pt while focused on a popup -- The popup content opens in a new tab -- Original popup is closed and removed from stack -- Full tab functionality is available with the promoted content ``` -------------------------------- ### Stack Management Functions Source: https://github.com/williamhsieh/overlook.nvim/blob/master/doc/overlook-api.txt Functions for managing the popup stack. ```APIDOC ## restore_all_popups ### Description Restore all previously closed popups in the current stack. Reopens all popups that were closed in the current window's popup stack, restoring them in their original stacking order. This allows users to quickly recover their exploration context after accidentally closing popups. ### Method `M.restore_all_popups`() ### Parameters None ### Request Example ```lua require("overlook.api").restore_all_popups() ``` ### Response None ### Response Example None ``` ```APIDOC ## restore_popup ### Description Restore a specific popup from the stack. Reopens a specific popup that was previously closed from the current window's popup stack. This allows users to recover a particular exploration context. ### Method `M.restore_popup`() ### Parameters None ### Request Example ```lua require("overlook.api").restore_popup() ``` ### Response None ### Response Example None ``` ```APIDOC ## close_all ### Description Close all currently open popups in the stack. Closes all floating popup windows associated with the current window's overlook stack. This is useful for clearing the exploration context when it is no longer needed. ### Method `M.close_all`() ### Parameters None ### Request Example ```lua require("overlook.api").close_all() ``` ### Response None ### Response Example None ``` -------------------------------- ### Switch Focus Between Overlook Popup and Root Window Source: https://context7.com/williamhsieh/overlook.nvim/llms.txt Sets up a keybinding to toggle focus between the top overlook popup and the original window. This allows for quick navigation between the popup stack and the main editing window. Pressing the keybinding in a popup jumps back to the root window, and pressing it in the root window focuses the top popup. ```lua -- Set up keybinding to switch focus vim.keymap.set("n", "pf", function() require("overlook.api").switch_focus() end, { desc = "Switch focus" }) -- Usage: Press pf while in a popup to jump back to root window -- Press pf in root window to focus the top popup -- Allows quick navigation between popup stack and main editing window ``` -------------------------------- ### Switch Focus Between Popups and Root Window Source: https://github.com/williamhsieh/overlook.nvim/blob/master/doc/overlook-api.txt Switches focus between the topmost floating popup and the main root window. This function allows users to easily navigate between the context of a popup and the original buffer. ```lua vim.keymap.set("n", "pf", require("overlook.api").switch_focus) ``` -------------------------------- ### Peek Functions Source: https://github.com/williamhsieh/overlook.nvim/blob/master/doc/overlook-api.txt Functions for creating floating popups to peek at code locations. ```APIDOC ## peek_definition ### Description Peek at the LSP definition under the cursor. Creates a floating popup window displaying the definition of the symbol under the cursor using LSP information. The popup is added to the current window's popup stack and can be navigated, edited, and stacked with additional popups. If no LSP server is attached or no definition is found, displays an appropriate notification to the user. ### Method `M.peek_definition()` ### Parameters None ### Request Example ```lua require("overlook.api").peek_definition() ``` ### Response None ### Response Example None ``` ```APIDOC ## switch_focus ### Description Switch focus between the top popup and the root window. ### Method `M.switch_focus()` ### Parameters None ### Request Example ```lua require("overlook.api").switch_focus() ``` ### Response None ### Response Example None ``` ```APIDOC ## peek_cursor ### Description Peek at the current cursor position. Creates a floating popup window at the current cursor position, displaying the current buffer content. This is useful for maintaining visual context while navigating to other locations. For example, if you are editing a file and want to quickly peek at the function signature or variable declaration, you can create a popup and then navigate to the desired location without losing the context. ### Method `M.peek_cursor()` ### Parameters None ### Request Example ```lua require("overlook.api").peek_cursor() ``` ### Response None ### Response Example None ``` ```APIDOC ## peek_mark ### Description Peek at a specific mark location. Prompts the user to enter a single-character mark name, then creates a floating popup window displaying the content at that mark's location. Only accepts single-character mark names (a-z, A-Z, 0-9). Shows an error notification if the input is invalid or empty. ### Method `M.peek_mark()` ### Parameters None ### Request Example ```lua require("overlook.api").peek_mark() ``` ### Response None ### Response Example None ``` -------------------------------- ### Open Top Popup in Vertical Split using Lua Source: https://github.com/williamhsieh/overlook.nvim/blob/master/doc/overlook-api.txt Converts the topmost popup in the current stack to a regular vertical split window. The popup is closed and its buffer content is opened in a new vsplit, preserving cursor position. Shows an error if no popup is available. Uses `open_in_vsplit` from overlook.api. ```lua vim.keymap.set("n", "pv", require("overlook.api").open_in_vsplit) ``` -------------------------------- ### Promote Overlook Popup to Split Window Source: https://context7.com/williamhsieh/overlook.nvim/llms.txt Provides keybindings to convert a floating overlook popup into a horizontal or vertical split window. This is useful for promoting important information found in a popup to a regular editing window while preserving cursor position. The original popup is closed. ```lua -- Set up keybindings for window promotion vim.keymap.set("n", "ps", function() require("overlook.api").open_in_split() end, { desc = "Open popup in horizontal split" }) vim.keymap.set("n", "pv", function() require("overlook.api").open_in_vsplit() end, { desc = "Open popup in vertical split" }) -- Usage: Found something important in a popup? -- Press ps to convert it to a horizontal split -- Press pv to convert it to a vertical split -- The popup closes and content opens in a regular window -- Cursor position is preserved during the transition ``` -------------------------------- ### Open Top Popup in Horizontal Split using Lua Source: https://github.com/williamhsieh/overlook.nvim/blob/master/doc/overlook-api.txt Converts the topmost popup in the current stack to a regular horizontal split window. The popup is closed and its buffer content is opened in a new split, preserving cursor position. Shows an error if no popup is available. Uses `open_in_split` from overlook.api. ```lua vim.keymap.set("n", "ps", require("overlook.api").open_in_split) ``` -------------------------------- ### Peek at Current Cursor Position Source: https://github.com/williamhsieh/overlook.nvim/blob/master/doc/overlook-api.txt Creates a floating popup at the current cursor position, displaying the buffer content. Useful for maintaining visual context while navigating elsewhere. ```lua vim.keymap.set("n", "pp", require("overlook.api").peek_cursor) ``` -------------------------------- ### Open Top Popup in Original Window using Lua Source: https://github.com/williamhsieh/overlook.nvim/blob/master/doc/overlook-api.txt Converts the topmost popup to occupy the original window that spawned it. The popup is closed and its buffer content replaces the original window's content, preserving cursor position. Shows an error if no popup is available. Uses `open_in_original_window` from overlook.api. ```lua vim.keymap.set("n", "po", require("overlook.api").open_in_original_window) ``` -------------------------------- ### Open Top Popup in New Tab using Lua Source: https://github.com/williamhsieh/overlook.nvim/blob/master/doc/overlook-api.txt Converts the topmost popup in the current stack to a new tab window. The popup is closed and its buffer content is opened in a new tab, preserving cursor position. Shows an error if no popup is available. Uses `open_in_tab` from overlook.api. ```lua vim.keymap.set("n", "pt", require("overlook.api").open_in_tab) ``` -------------------------------- ### Restore All Closed Popups Source: https://github.com/williamhsieh/overlook.nvim/blob/master/doc/overlook-api.txt Restores all previously closed popups in the current window's stack, maintaining their original order. Enables users to quickly recover exploration context. ```lua vim.keymap.set("n", "pU", require("overlook.api").restore_all_popups) ``` -------------------------------- ### Open Overlook Popup in Original Window Source: https://context7.com/williamhsieh/overlook.nvim/llms.txt Configures a keybinding to replace the current window's content with the buffer from an overlook popup. This effectively commits the popup's exploration to the main window, closing all popups in the stack. It's used when the user decides to integrate the popup's content into their primary editing space. ```lua -- Set up keybinding to open in original window vim.keymap.set("n", "po", function() require("overlook.api").open_in_original_window() end, { desc = "Open popup in current window" }) -- Usage: Press po while in a popup -- The popup content replaces the root window's buffer -- This "commits" the popup exploration to the main window -- All popups in the stack are closed ``` -------------------------------- ### Peek Current Cursor Position in a Floating Popup Source: https://context7.com/williamhsieh/overlook.nvim/llms.txt Defines a keybinding for the 'peek_cursor' function, which creates a floating popup displaying the content of the current buffer at the cursor's position. This is useful for maintaining visual context while navigating elsewhere in the code. The popup shows the same buffer content as the main window. ```lua -- Set up keybinding for peek cursor vim.keymap.set("n", "pp", function() require("overlook.api").peek_cursor() end, { desc = "Peek cursor" }) -- Usage: Press pp to create a popup at current position -- This maintains visual context while you navigate elsewhere -- The popup shows the same buffer content as the main window -- Navigate away from the original position while keeping reference visible ``` -------------------------------- ### Peek Vim Mark Location in a Floating Popup Source: https://context7.com/williamhsieh/overlook.nvim/llms.txt Sets up a keybinding for the 'peek_mark' function, enabling users to display content at a specific mark within a floating popup. After setting a mark (e.g., 'ma'), pressing the keybinding prompts for the mark character, and the content at that mark opens in a popup. Supports local (a-z), global (A-Z), and numbered (0-9) marks. ```lua -- Set up keybinding for peek mark vim.keymap.set("n", "pm", function() require("overlook.api").peek_mark() end, { desc = "Peek mark" }) -- Usage workflow: -- 1. Set a mark: ma (sets mark 'a' at current position) -- 2. Press pm -- 3. Enter the mark character when prompted: a -- 4. The content at mark 'a' opens in a floating popup -- Works with marks a-z (local), A-Z (global), and 0-9 (numbered) ``` -------------------------------- ### Peek at Specific Mark Location Source: https://github.com/williamhsieh/overlook.nvim/blob/master/doc/overlook-api.txt Prompts for a single-character mark name and creates a floating popup at that mark's location. Accepts a-z, A-Z, 0-9 marks. Shows errors for invalid or empty input. ```lua vim.keymap.set("n", "pm", require("overlook.api").peek_mark) ``` -------------------------------- ### Popup Management Functions Source: https://github.com/williamhsieh/overlook.nvim/blob/master/doc/overlook-api.txt Functions for restoring and closing Overlook popups. ```APIDOC ## `M.restore_popup` ### Description Restore the most recently closed popup. Reopens the last popup that was closed in the current window's popup stack. This provides a quick undo mechanism for popup closures. ### Method `CALL` ### Endpoint `overlook.api.restore_popup()` ### Parameters None ### Request Example ```lua require("overlook.api").restore_popup() ``` ### Response #### Success Response Restores the last closed popup. #### Response Example (No specific response body, action is visual) ## `M.close_all` ### Description Close all overlook popups across all windows. Closes every overlook popup in all window stacks, completely clearing the overlook state. This is useful for quickly resetting the interface when you have multiple popup stacks open. ### Method `CALL` ### Endpoint `overlook.api.close_all()` ### Parameters None ### Request Example ```lua require("overlook.api").close_all() ``` ### Response #### Success Response Closes all overlook popups. #### Response Example (No specific response body, action is visual) ``` -------------------------------- ### Restore Closed Popups Source: https://context7.com/williamhsieh/overlook.nvim/llms.txt Configures keybindings to restore recently closed popups using overlook.nvim's API. 'pu' restores the most recently closed popup, while 'pU' restores the entire exploration stack. This feature allows users to easily undo accidental closures and retrace their exploration path. ```lua -- Set up keybinding to restore last popup vim.keymap.set("n", "pu", function() require("overlook.api").restore_popup() end, { desc = "Restore last popup" }) -- Restore all closed popups vim.keymap.set("n", "pU", function() require("overlook.api").restore_all_popups() end, { desc = "Restore all popups" }) -- Usage: Accidentally closed a popup? Press pu to undo -- Press pU to restore entire exploration stack -- Popups are restored with their original content and position ``` -------------------------------- ### Restore Last Closed Popup using Lua Source: https://github.com/williamhsieh/overlook.nvim/blob/master/doc/overlook-api.txt Reopens the last popup that was closed in the current window's popup stack. This provides a quick undo mechanism for popup closures. It utilizes the `restore_popup` function from the overlook.api module. ```lua vim.keymap.set("n", "pu", require("overlook.api").restore_popup) ``` -------------------------------- ### Close All Overlook Popups Source: https://context7.com/williamhsieh/overlook.nvim/llms.txt Sets up a keybinding to close all overlook popups across all windows. This is useful for resetting the popup history when multiple popup stacks are open. All popup history is preserved for potential restore operations. ```lua -- Set up keybinding to close all popups vim.keymap.set("n", "pc", function() require("overlook.api").close_all() end, { desc = "Close all popups" }) -- Usage: Press pc to clear all popup stacks -- Useful when you have multiple popup stacks and want to reset -- All popup history is preserved for restore operations ``` -------------------------------- ### Close All Overlook Popups using Lua Source: https://github.com/williamhsieh/overlook.nvim/blob/master/doc/overlook-api.txt Closes every overlook popup in all window stacks, completely clearing the overlook state. This is useful for quickly resetting the interface when you have multiple popup stacks open. It uses the `close_all` function from the overlook.api module. ```lua vim.keymap.set("n", "pc", require("overlook.api").close_all) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.