A Neovim lua plugin for Elixir development.
Using plug:
Plug 'Danielwsx64/elixir-dev.nvim'
Using packer:
use "Danielwsx64/elixir-dev.nvim"
-
pipelize
: Switch function call syntax to pipe syntax and vice versa -
fn_shorthand
: Switch anonymous function to shorthand syntax and vice versa -
switch_keys
: Switch map keys format (string/atom) - Switch map, lists, keywords (inline/multiline)
-
jump_to_test
: Jump to test and back (create file if not exists). The command jumps to fn or describe definition. - Telescope list public fns
- Telescope list describes
- Telescope list tests
You can just call the vim command like:
:ElixirDev pipelize
vim.keymap.set("n", "<leader>fp", "<CMD>ElixirDev pipelize<CR>", { desc = "Format pipe syntax", silent = true })
vim.keymap.set("n", "<leader>ff", "<CMD>ElixirDev fn_shorthand<CR>", { desc = "Format anonymous fn syntax", silent = true })
vim.keymap.set("n", "<leader>fk", "<CMD>ElixirDev switch_keys<CR>", { desc = "Switch map keys syntax", silent = true })
vim.keymap.set("n", "<leader>gt", "<CMD>ElixirDev jump_to_test<CR>", { desc = "Go to test and back", silent = true })
This uses busted, luassert (both through
plenary.nvim) and matcher_combinators to
define tests in test/spec/
directory. These dependencies are required only to
run tests, that's why they are installed as git submodules.
Make sure your shell is in the ./test
directory or, if it is in the root directory,
replace make
by make -C ./test
in the commands below.
To init the dependencies run
$ make prepare
To run all tests just execute
$ make test
If you have entr(1) installed you may use it to run all tests whenever a file is changed using:
$ make watch
In both commands you myght specify a single spec to test/watch using:
$ make test SPEC=spec/elixir_dev/pipelize_spec.lua
$ make watch SPEC=spec/elixir_dev/pipelize_spec.lua
NOTE: Created with help of plugin-template.