nvim/plug: +dressing@master

This is a plugin which overrides vim.prompt and vim.input handlers,
providing Telescope integration, and a much more pleasant experience
over the default menus provided by nvim.

The primary reason for this plugin is vim.lsp.buf.code_action/1, which
uses vim.input.
This commit is contained in:
Paul Stemmet 2022-12-09 20:10:46 +00:00
parent 08761102fd
commit 9a41cb4bb4
Signed by: Paul Stemmet
GPG Key ID: EDEA539F594E7E75
3 changed files with 44 additions and 0 deletions

View File

@ -145,4 +145,18 @@ M.Buffer.Lsp.N {
ShowDocumentation = B { 'Display documentation of <cword> symbol' , key = 'K' , action = vim.lsp.buf.hover , } ,
}
-- ###################################
-- ## PLUGIN dressing.nvim Mappings ##
-- ###################################
M.Plugin.Dressing {
Input = G {
{ mode = 'i', skip = true },
Close = B { 'Close the input modal' , key = '<Esc>' , } ,
Confirm = B { 'Submit the current input' , key = '<CR>' , } ,
Prev = B { 'Previous item in input history' , key = '<Up>' , } ,
Next = B { 'Next item in input history' , key = '<Down>' , } ,
}
}
return M

View File

@ -0,0 +1,23 @@
return function()
local dressing, util = require 'dressing', require 'psoxizsh.util'
local K = require('psoxizsh.key.map').Plugin.Dressing
local defaults = {
input = {
default_prompt = '<|>',
mappings = { i = {
[K.Input.Close.key] = 'Close',
[K.Input.Confirm.key] = 'Confirm',
[K.Input.Prev.key] = 'HistoryPrev',
[K.Input.Next.key] = 'HistoryNext',
}},
},
select = {
backend = { 'telescope', 'builtin' }
},
}
dressing.setup(util.mconfig('config.dressing', defaults))
end

View File

@ -126,6 +126,13 @@ local plugins = {
config = require 'psoxizsh.plugins.config.trouble'
},
-- vim.ui.input & vim.ui.select handler
{ 'stevearc/dressing.nvim',
as = 'dressing',
branch = 'master',
config = require 'psoxizsh.plugins.config.dressing'
},
-- Autocompletion + snippets + vim.diagnostic sources
-- Completion framework
{ 'hrsh7th/nvim-cmp',