N
N
nonlux2015-08-17 07:30:59
vim
nonlux, 2015-08-17 07:30:59

How to open a test in a vertical split?

Given:
the file `src/Foo/Bar/Some.php` is open
Need or a plugin that will open the test in vspli like this:
- create in vsplit
- open in the right spec/Foo/Bar/SomeSpec.php
If there are no ready-made solutions:
- how to get in vim function the path of the current file ?
- how to change it to required for subsequent transfer to `:e `?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Masterov, 2015-08-17
@nonlux

The vim-projectionist plugin .
The config is set via the "g:projectionist_heuristics" variable (JSON => VimL) or via the ".projections.json" file, which must be located in the root directory of the project.

{
  "src/Foo/Bar/*.php": {
    "alternate": "spec/Foo/Bar/{}Spec.php",
    "type": "src"
  },
  "spec/Foo/Bar/*Spec.php": {
    "alternate": "src/Foo/Bar/{}.php",
    "type": "spec"
  }
}

:AV The vim-altr plugin
just opens files as a rule, without splitting.
call altr#define('src/*/%.php', 'spec/*/%Spec.php')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question