diff --git a/README.md b/README.md index e46a05ca..6ee306ed 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ - [Requirements](#requirements) - [Installation](#installation) - [Usage](#usage) + - [Usage with `vim.ui.select`](#usage-with-vimuiselect) - [Configuration](#configuration) - [Options](#options) - [General](#general) @@ -38,7 +39,6 @@ - [Utility Functions](#utility-functions) - [Bar Utility Functions](#bar-utility-functions) - [Menu Utility Functions](#menu-utility-functions) - - [Usage with `vim.ui.select`](#usage-with-vimuiselect) - [Highlighting](#highlighting) - [Developers](#developers) - [Architecture](#architecture) @@ -226,6 +226,16 @@ https://github.com/Bekaboo/dropbar.nvim/assets/76579810/e8c1ac26-0321-4762-9975- - To disable, remap or add new keymaps in the drop-down menu, see [menu options](#menu) +### Usage with `vim.ui.select` + +Dropbar can be used as a drop-in replacement for Neovim's builtin `vim.ui.select` menu. + +To enable this functionality, simply replace `vim.ui.select` with `dropbar.utils.menu.select`: + +```lua +vim.ui.select = require('dropbar.utils.menu').select +``` + ## Configuration ### Options @@ -1608,16 +1618,6 @@ Defined in [`lua/dropbar/utils/menu.lua`](https://github.com/Bekaboo/dropbar.nvi - Opt-in replacement for `vim.ui.select` - Supports non-string items by formatting via the `opts.format_item` callback -### Usage with `vim.ui.select` - -Dropbar can be used as a drop-in replacement for Neovim's builtin `vim.ui.select` menu. - -To enable this functionality, simply replace `vim.ui.select` with `dropbar.utils.menu.select`: - -```lua -vim.ui.select = require('dropbar.utils.menu').select -``` - ### Highlighting `dropbar.nvim` defines the following highlight groups that, override them in diff --git a/doc/dropbar.txt b/doc/dropbar.txt index 44e83f05..5c81959a 100644 --- a/doc/dropbar.txt +++ b/doc/dropbar.txt @@ -13,6 +13,7 @@ CONTENTS *dropbar-table-of-contents* 2. Requirements |dropbar-requirements| 3. Installation |dropbar-installation| 4. Usage |dropbar-usage| + 4.1 Usage with `vim.ui.select` |dropbar-usage-with-ui-select| 5. Configuration |dropbar-configuration| 5.1 Options |dropbar-configuration-options| 5.1.1 General |dropbar-configuration-options-general| @@ -30,7 +31,6 @@ CONTENTS *dropbar-table-of-contents* 5.3 Utility Functions |dropbar-configuration-utility-functions| 5.3.1 Bar Utility Functions |dropbar-configuration-utility-functions-bar| 5.3.2 Menu Utility Functions |dropbar-configuration-utility-functions-menu| - 5.4 Usage with `vim.ui.select` |dropbar-configuration-usage-with-ui-select| 5.5 Highlighting |dropbar-configuration-highlighting| 6. Developers |dropbar-developers| 6.1 Architecture |dropbar-developers-architecture| @@ -172,6 +172,18 @@ USAGE *dropbar-usage* - To disable, remap or add new keymaps in the drop-down menu, see |dropbar-configuration-options| +------------------------------------------------------------------------------ +USAGE WITH `vim.ui.select` *dropbar-usage-with-ui-select* + +Dropbar can be used as a drop-in replacement for Neovim's builtin +`vim.ui.select` menu. + +To enable this functionality, simply replace `vim.ui.select` with +`dropbar.utils.menu.select`: >lua + + vim.ui.select = require('dropbar.utils.menu').select +< + ============================================================================== CONFIGURATION *dropbar-configuration* @@ -1025,18 +1037,6 @@ utils.menu.get_current() *dropbar-utility-functions-utils.menu.get_current()* Returns ~ `dropbar_menu_t` or `nil` ------------------------------------------------------------------------------- -USAGE WITH `vim.ui.select` *dropbar-configuration-usage-with-ui-select* - -Dropbar can be used as a drop-in replacement for Neovim's builtin -`vim.ui.select` menu. - -To enable this functionality, simply replace `vim.ui.select` with -`dropbar.utils.menu.select`: >lua - - vim.ui.select = require('dropbar.utils.menu').select -< - ------------------------------------------------------------------------------ HIGHLIGHTING *dropbar-configuration-highlighting*