Skip to content

Instantly share code, notes, and snippets.

@xfyuan
Forked from hauleth/projections.vim
Created April 15, 2019 08:31
Show Gist options
  • Save xfyuan/886925f19648a04b66d4eb2b4b5028ae to your computer and use it in GitHub Desktop.
Save xfyuan/886925f19648a04b66d4eb2b4b5028ae 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