Keys in mappings tables
gotgenes opened this issue · 1 comments
gotgenes commented
The nested mappings tables in the setup can be difficult to read. Would you consider adding keys to the mappings
, such as below?
require('telescope-alternate').setup({
mappings = {
{
pattern = 'app/services/(.*)_services/(.*).rb',
targets = { -- alternate from services to contracts / models
{ template = 'app/contracts/[1]_contracts/[2].rb', label = 'Contract' }, -- Adding label to switch
{ template = 'app/models/**/*[1].rb', label = 'Model', enable_new = false }, -- Ignore create entry (with true)
},
},
{
-- etc.
},
},
})
Some of these labels are inspired by other.nvim's setup API.
otavioschwanck commented
The nested mappings tables in the setup can be difficult to read. Would you consider adding keys to the
mappings
, such as below?require('telescope-alternate').setup({ mappings = { { pattern = 'app/services/(.*)_services/(.*).rb', targets = { -- alternate from services to contracts / models { template = 'app/contracts/[1]_contracts/[2].rb', label = 'Contract' }, -- Adding label to switch { template = 'app/models/**/*[1].rb', label = 'Model', enable_new = false }, -- Ignore create entry (with true) }, }, { -- etc. }, }, })Some of these labels are inspired by other.nvim's setup API.
Done. Added an example on README. Now you can map on both ways (verbose and the way it was)