Closed mrcjkb closed 1 year ago
Add bang !
to create file if it doesn't exist
other.nvim
is sufficient for this.
See for example the following config:
mappings = {
{
pattern = '(.+)/src/(.*)/(.*).hs$',
target = {
{
target = '%1/test/%2/%3Spec.hs',
context = 'spec',
},
{
target = '%1/test/%2/*%3Test.hs',
context = 'test',
},
},
},
-- jump back from specs
{
pattern = '(.+)/test/(.*)/(.*)Spec.hs$',
target = '%1/src/%2/%3.hs',
},
-- jump back from tests
{
pattern = '(.+)/test/(.*)/(.*)Test.hs$',
target = '%1/src/%2/%3.hs',
},
},
Feature description
Not sure yet if this belongs in this plugin:
I often have a module that is accompanied by one or two test modules of the same name (e.g.
MyModule
->MyModuleSpec
and/orMyModuleTest
).It would be nice to be able to cycle between these files with a command/keymap.
This idea is similar to other.nvim,
but that plugin doesn't seem to let you link more than two files.It might also be useful to leverage LSP workspace symbols for this.