Conversation
|
You could also set |
| let root = simplify(fnamemodify('.', ':p:s?[\/]$??')) | ||
|
|
||
| let projections = {} | ||
| let projections['lib/*.ex'] = { 'type': 'main', 'alternate': ['test/{}_test.exs'] } |
There was a problem hiding this comment.
I prefer type: source to type: main, which follows the convention used by the Projectionist documentation. What do you think?
|
|
||
| let projections = {} | ||
| let projections['lib/*.ex'] = { 'type': 'main', 'alternate': ['test/{}_test.exs'] } | ||
| let projections['lib/**/*.ex'] = { 'type': 'main', 'alternate': ['test/{}_test.exs'] } |
There was a problem hiding this comment.
Are these additional lib/**/ and test/**/ entries necessary? The lib/*.ex / test/*.ex entries work well for me, even with file hierarchies.
There was a problem hiding this comment.
No, these aren't needed, quoting docs:
From a globbing perspective,
"*"is actually a stand in for"**/*". For advanced cases, you can include both globs explicitly:"test/**/test_*.rb". When expanding with{}, the**and*portions are joined with a slash. If necessary, thedirnameandbasenameexpansions can be used to split the value back apart.
|
My configuration for projectionist looks like this: let g:projectionist_heuristics['mix.exs'] = {
\ 'apps/*/mix.exs': { 'type': 'app' },
\ 'lib/*.ex': {
\ 'type': 'lib',
\ 'alternate': 'test/{}_test.exs',
\ 'template': ['defmodule {camelcase|capitalize|dot} do', 'end'],
\ },
\ 'test/*_test.exs': {
\ 'type': 'test',
\ 'alternate': 'lib/{}.ex',
\ 'template': ['defmodule {camelcase|capitalize|dot}Test do', ' use ExUnit.Case', '', ' @subject {camelcase|capitalize|dot}', '', ' doctest @subject', 'end'],
\ },
\ 'mix.exs': { 'type': 'mix' },
\ 'config/*.exs': { 'type': 'config' },
\ '*.ex': {
\ 'makery': {
\ 'lint': { 'compiler': 'credo' },
\ 'test': { 'compiler': 'exunit' },
\ 'build': { 'compiler': 'mix' }
\ }
\ },
\ '*.exs': {
\ 'makery': {
\ 'lint': { 'compiler': 'credo' },
\ 'test': { 'compiler': 'exunit' },
\ 'build': { 'compiler': 'mix' }
\ }
\ }
\ } |
|
@hauleth I like your configuration, 👍 on configuring it that way... I would just add the dispatch config to it, since it's a well known package too |
|
Yep, realized that, will check that one someday, but for now I'm sticking with dispatch. |
|
This is quite old and doesn't look like there are any signs of it getting merged but just wanted to weigh in here: I don't think it's a good idea for this to be included in this repo for the very reason outlined by the above convo and comments on the PR: I think this type of thing would be best included under a "Tips" category or the like in the wiki or README. |
Hello, few days ago i bothered to add support for https://github.com/tpope/vim-projectionist to my config files. Basically i use
Ashortcut to navigate between tests/source-code, i think it could be useful for other people.Feel free to modify, thank you for this repo.