Skip to content

Instantly share code, notes, and snippets.

@unhammer
Last active February 12, 2023 05:40

Revisions

  1. unhammer revised this gist Oct 9, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion merlin-init.sh
    Original file line number Diff line number Diff line change
    @@ -21,6 +21,6 @@ EOF
    find ~/.opam -name '*.cmt' -print0 \
    | xargs -0 -I{} dirname '{}' \
    | sort -u \
    | sed 's/.*/S &\nB &/' >> .merlin
    | awk '{ print "S "$0"\nB "$0 }' >> .merlin

    fi
  2. unhammer created this gist Oct 9, 2014.
    26 changes: 26 additions & 0 deletions merlin-init.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    #!/bin/sh

    if test -f .merlin; then

    echo ".merlin already exists, bailing out ..." >&2
    exit 1

    else

    # You could add your default EXT's and such to this list:
    cat >.merlin <<EOF
    S .
    B _build
    EOF

    # Add PKG's:
    ocamlfind list \
    | awk '{ print "PKG "$1 }' >>.merlin

    # See https://github.com/the-lambda-church/merlin/wiki/Letting-merlin-locate-go-to-stuff-in-.opam
    find ~/.opam -name '*.cmt' -print0 \
    | xargs -0 -I{} dirname '{}' \
    | sort -u \
    | sed 's/.*/S &\nB &/' >> .merlin

    fi