VIM Elixir folding

Background

So recently I moved in to Vim 8.1, trying to have an IDE I can simply take to any UNIX machine.
As part of this process, I am now picking which plugins to use for Elixir.

Objective

I miss a lot the ability to fold code. Thus naturally I am looking for an Elixir folding plugin for Vim, but I only found 1:

That’s it. It has no documentation on the Readme nor any additional install install information for PlugInstall which I use.

I also found a blog:

http://blog.nathansplace.co.uk/2018/vim_folding_swagger_elixir

But it is for swagger comments which I don’t really care about nor use.

If this sounds like a silly post, please notice I have just recently moved to Vim and I am still learning.

Question

  • Which code folders to you use for Elixir in your Vim setup?
1 Like

What does :echo &foldmethod return? I am using syntax with just vim-elixir and everything works as expected without any problems.

Vim supports few different folding methods and you need to be sure that you use the one you want.

2 Likes

returns “manual”

So you need to manually create folds. If you want more automatic solution then add:

set foldmethod=syntax

in your $MYVIMRC and it will work.

3 Likes

I wouldn’t look at a specific Elixir folding plugin, look more general Vim. Maybe this will help? http://vimcasts.org/episodes/how-to-fold/

2 Likes