Skip to content
This repository was archived by the owner on Sep 1, 2023. It is now read-only.
Milad edited this page Apr 12, 2016 · 30 revisions

#alchemist.vim

This plugin uses alchemist-server to give inside about your elixir project in vim.

Installation

Dependencies

  • Elixir > v1.0.4 to run alchemist-server
  • Python alchemist_client is the script that talks to alchemist-server

Setting up

You can use your favourite VIM plugin mannger for installation, in this doc we use Vundle

Add this line to your .vimrc

Plugin 'slashmili/alchemist.vim'

Omni completion

Short keys

  • Auto completion: <C-x><C-o> while your are in INSERT mode.

Optional plugin

Demo

ExDoc

By default the docs are shown as markdown.

Short keys

  • Press K while cursor is under a module or function in NORMAL mode.

Commands

  • ExDoc: ExDoc [module/function] provides document (press TAB to get autocomplete).

Optional plugin

  • AnsiEsc to see the docs in ansi color

Demo

Jump to definition

For Jumping to Elixir/Erlang modules look at g:alchemist#elixir_erlang_src configs.

Short keys

  • Jump to the definition: Press <C-]> while cursor is under the keyword in NORMAL mode.
  • Jump through tag stack: Press <C-T> to jump between tag stack in NORMAL mode.

Commands

  • ExDef: ExDef [module/function] jumps to the definition.

Configs

  • Disable short keys

In case you don't like alchemist.vim semi-tag functionality!

let g:alchemist_tag_disable = 1
  • Change short keys bindings
let g:alchemist_tag_map = '<C-]>'
let g:alchemist_tag_stack_map = '<C-T>'
  • Set source path for Elixir and Erlang

If you haven't build Elixir/Erlang from source, you need to set g:alchemist#elixir_erlang_src to be able to jump to Elixir/Erlang modules.

let g:alchemist#elixir_erlang_src = "/home/foo/src/"

This directory should contains two directories, elixir and otp

/home/foo/src/
├── elixir
│ ├── CHANGELOG.md
│ ├── lib
│ ├── Makefile
│ ├── ...
├── otp
│ ├── AUTHORS
│ ├── lib
│ │ ├── asn1
│ │ ├── stdlib
│ │ ├── ...
│ ├── ...

Demo

IEx

Clone this wiki locally