Skip to content

Instantly share code, notes, and snippets.

@hauleth
Created April 13, 2019 13:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save hauleth/50e9de436f6b156949e5a4b036ffdd02 to your computer and use it in GitHub Desktop.
Save hauleth/50e9de436f6b156949e5a4b036ffdd02 to your computer and use it in GitHub Desktop.
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', '', ' alias {camelcase|capitalize|dot}, as: Subject', '', ' 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' }
\ }
\ }
\ }
let g:projectionist_heuristics['rebar.config'] = {
\ '*.erl': {
\ 'template': ['-module({basename}).', '', '-export([]).', ''],
\ },
\ 'src/*.app.src': { 'type': 'app' },
\ 'src/*.erl': {
\ 'type': 'src',
\ 'alternate': 'test/{}_SUITE.erl',
\ },
\ 'test/*_SUITE.erl': {
\ 'type': 'test',
\ 'alternate': 'src/{}.erl',
\ },
\ 'rebar.config': { 'type': 'rebar' }
\ }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment