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:
parent
08761102fd
commit
9a41cb4bb4
|
@ -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
|
||||
|
|
|
@ -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
|
|
@ -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',
|
||||
|
|
Loading…
Reference in New Issue