Code Monkey home page Code Monkey logo

vim-elixir's Introduction

vim-elixir

Build Status

Elixir support for vim

Description

Features:

  • Syntax highlighting for Elixir and EEx files
  • Filetype detection for .ex, .exs, .eex, .heex, .leex, and .sface files
  • Automatic indentation
  • Integration between Ecto projects and vim-dadbod for running SQL queries on defined Ecto repositories

Installation

vim-elixir can be installed either with a plugin manager or by directly copying the files into your vim folders (location varies between platforms)

Plugin Managers

If you are using a plugin manager then add vim-elixir the way you would any other plugin:

# Using vim 8 native package loading
#   http://vimhelp.appspot.com/repeat.txt.html#packages
git clone https://github.com/elixir-editors/vim-elixir.git ~/.vim/pack/my-packages/start/vim-elixir

# Using pathogen
git clone https://github.com/elixir-editors/vim-elixir.git ~/.vim/bundle/vim-elixir
" Using vim-plug
Plug 'elixir-editors/vim-elixir'

" Using Vundle
Plugin 'elixir-editors/vim-elixir'

" Using NeoBundle
NeoBundle 'elixir-editors/vim-elixir'

Manual Installation

If you are not using a package manager then you can use the provided manual_install.sh script to copy the files into their respective homes.

Run ./manual_install.sh to copy the contents of each directory in the respective directories inside ~/.vim.

Configuration

You must add the following to your ~/.vimrc:

" Enable syntax highlighting
syntax on

" Enables filetype detection, loads ftplugin, and loads indent
" (Not necessary on nvim and may not be necessary on vim 8.2+)
filetype plugin indent on

Notes/Caveats

mix format Integration

We've decided not to include mix format integration into vim-elixir. If you'd like to set it up yourself, you have the following options:

  • For asynchronous execution of the formatter, have a look at vim-mix-format
  • Add it as a formatprg (e.g. setlocal formatprg=mix\ format\ -)

Why isn't this supported? We've run into two major issues with calling out to mix format. First mix format would not work unless your program compiled. Second mix format added an external process dependency to vim-elixir.

If someone really wanted to try and add this then we might be able to model it after vim-go's go fmt integration which I think could be acceptable to merge into master.

Development

Maintenance Help

vim-elixir is looking for new maintainers. If you get a lot of value from it, know vimscript well, or eager to learn about it then feel free to get in touch with @jbodah (GH issue, elixir-lang Slack)

Running the Tests

The tests depend on having Ruby installed. They also depend on a GUI vim (gvim, mvim) with server support. If you do not have gvim or mvim in your PATH then you can create a .gvim_path file in the vim-elixir root directory which specifies the path to the GUI vim executable.

To run the tests: bundle exec parallel_rspec spec

Developing in Docker

You can spawn a container with vim and your development configs using bin/vim or bin/nvim

Debugging Indent

# Open vim in a container loading this plugin
bin/vim myfile.ex

# Debug statements should be configured to print automatically
# Write/indent some code
:messages

# You should see output like the following:
#   ==> Indenting line 3
#   text = '    _ -> :wowo'
#   testing handler elixir#indent#handle_top_of_file
#   testing handler elixir#indent#handle_starts_with_string_continuation
#   testing handler elixir#indent#handle_following_trailing_binary_operator
#   testing handler elixir#indent#handle_starts_with_pipe
#   testing handler elixir#indent#handle_starts_with_binary_operator
#   testing handler elixir#indent#handle_inside_block
#   pattern matching relative to lnum 2
#   current line contains ->; assuming match definition
#   line 3: elixir#indent#handle_inside_block returned 4
#   1 change; before #1  4 seconds ago
#
# This tells you which line is being inspected as well as which handlers are being run
# and which branches are being exercised by those handlers

Feature Wishlist

Here is a list of features that I think would be great additions to vim-elixir:

  • Regularly merging vim-elixir into vim and keeping the sync up-to-date
  • Fixing our build so it can run regularly on CI
  • Live view support
  • Testing .exs files and ensuring feature compatibility between .ex and .exs
  • Documentation (e.g. :h vim-elixir)
  • README docs for various .vimrc options/flags
  • Identifying and rewriting tests that conflict with mix format
  • Fixes for indentation rule edge cases (e.g. with, see GH issues for examples)
  • Simplifying syntax rules
  • Performance optimizations for syntax/indent rules (especially for determining if something is a string)

vim-elixir's People

Contributors

carlosgaldino avatar dbernheisel avatar duggiefresh avatar ericmj avatar flupke avatar gasparch avatar guedes avatar hauleth avatar iurifq avatar jbodah avatar joeesteves avatar jparise avatar jsvisa avatar kassio avatar kelvinst avatar liskin avatar lmarlow avatar lnl7 avatar lucassperez avatar lukebakken avatar meh avatar mhinz avatar morhetz avatar rafaelfranca avatar reinh avatar sgiath avatar sztheory avatar thinca avatar ujihisa avatar whatyouhide avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vim-elixir's Issues

:do atom mistaken for keyword

The :do atom is mistaken for the do keyword, which:

  • breaks auto-alignment of end
  • matches when using %

Running vim-elixir at commit 49d2dbd

 $ vim --version                                                                                                                                                  [18:21:51]
NVIM 0.1.1 (compiled Dec 20 2015 21:21:16)
Build type: RelWithDebInfo
Compilation: /usr/bin/x86_64-linux-gnu-gcc -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wconversion -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -g -DDISABLE_LOG -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -DHAVE_CONFIG_H -I/build/neovim-rhxZwd/neovim-0.1.1ubuntu1+git201512202031+2074+16~ubuntu15.10.1/build/config -I/build/neovim-rhxZwd/neovim-0.1.1ubuntu1+git201512202031+2074+16~ubuntu15.10.1/src -I/build/neovim-rhxZwd/neovim-0.1.1ubuntu1+git201512202031+2074+16~ubuntu15.10.1/.deps/usr/include -I/build/neovim-rhxZwd/neovim-0.1.1ubuntu1+git201512202031+2074+16~ubuntu15.10.1/.deps/usr/include -I/usr/include/luajit-2.0 -I/build/neovim-rhxZwd/neovim-0.1.1ubuntu1+git201512202031+2074+16~ubuntu15.10.1/.deps/usr/include -I/build/neovim-rhxZwd/neovim-0.1.1ubuntu1+git201512202031+2074+16~ubuntu15.10.1/.deps/usr/include -I/build/neovim-rhxZwd/neovim-0.1.1ubuntu1+git201512202031+2074+16~ubuntu15.10.1/.deps/usr/include -I/build/neovim-rhxZwd/neovim-0.1.1ubuntu1+git201512202031+2074+16~ubuntu15.10.1/.deps/usr/include -I/usr/include -I/build/neovim-rhxZwd/neovim-0.1.1ubuntu1+git201512202031+2074+16~ubuntu15.10.1/build/src/nvim/auto -I/build/neovim-rhxZwd/neovim-0.1.1ubuntu1+git201512202031+2074+16~ubuntu15.10.1/build/include
Compiled by buildd@lcy01-32

smartindent broken

I have to "setlocal smartindent" in every file I open. Setting the corresponding line in "elixir.vim" didn't help. Not sure if this is the intended behavior, but I like my indents :)

indentation broken with `function :atom`

Typing a statement like plug :match somehow breaks indentation. What's breaking things is not plug, as that receives no special treatment (sidenote: should it?), it's the atom that follows.

screenshot from 2016-01-08 16-45-29

screenshot from 2016-01-08 16-39-24

Running dee2758.

the syntastic plugin is unhappy with a default `mix.exs`

These errors (on opening the file, or saving) seem unfortunate:

Error detected while processing function <SNR>55_BufWritePostHook..<SNR>55_UpdateErrors..<SNR>55_Cache
Errors..240..239:
line    5:
E691: Can only compare List with List
E15: Invalid expression: status < 0
Error detected while processing function <SNR>55_BufWritePostHook..<SNR>55_UpdateErrors..<SNR>55_Cache
Errors..240..262:
line    3:
E712: Argument of filter() must be a List or Dictionary

That's on OS X with syntastic 3.6.0-130 (master, here) and Mix 1.0.5, after typing:

mix new portal --sup
gvim portal/mix.exs

After, also, enabling the syntax checker with these in my .vimrc:

let g:syntastic_elixir_checkers = ['elixir']
let g:syntastic_enable_elixir_checker = ['elixir'] 

On-demand loading with vim-plug breaks syntax highlighting

Using vim-plug, in my .vimrc:

call plug#begin('plugged')
" ...
Plug 'elixir-lang/vim-elixir', { 'for' : ['.ex', '.eex', '.exs'] }
call plug#end()
filetype plugin indent on
syntax on

Causes syntax highlighting to not activate, even if I do :syntax on.
Changing things to:

call plug#begin('plugged')
" ...
Plug 'elixir-lang/vim-elixir'
call plug#end()
filetype plugin indent on
syntax on

Makes things work.
NVIM 0.1.2, OS X 10.11

"UpdateErrors" "CacheErrors" message

This is giving me an error when I vim loads certain files:

Error detected while processing function <SNR>35_UpdateErrors..<SNR>35_CacheErrors..4..7:
line    5:
E712: Argument of filter() must be a List or Dictionary
line    7:
E714: List required

The file is still highlighted and folds work, but the message is shown on every save.

Using:

VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Dec 12 2012 16:22:25)
MacOS X (unix) version
Included patches: 1-754

Syntax highlighting of certain long sigils goes bad.

  @regex %R"""
  # RFC-3986 URI component:  URI
  [A-Za-z][A-Za-z0-9+\-.]* :                                      # scheme ":"
  (?: //                                                          # hier-part
    (?: (?:[A-Za-z0-9\-._~!$&'()*+,;=:]|%[0-9A-Fa-f]{2})* @)?
    (?:
      \[
      (?:
        (?:
          (?:                                                    (?:[0-9A-Fa-f]{1,4}:)    {6}
          |                                                   :: (?:[0-9A-Fa-f]{1,4}:)    {5}
          | (?:                            [0-9A-Fa-f]{1,4})? :: (?:[0-9A-Fa-f]{1,4}:)    {4}
          | (?: (?:[0-9A-Fa-f]{1,4}:){0,1} [0-9A-Fa-f]{1,4})? :: (?:[0-9A-Fa-f]{1,4}:)    {3}
          | (?: (?:[0-9A-Fa-f]{1,4}:){0,2} [0-9A-Fa-f]{1,4})? :: (?:[0-9A-Fa-f]{1,4}:)    {2}
          | (?: (?:[0-9A-Fa-f]{1,4}:){0,3} [0-9A-Fa-f]{1,4})? ::    [0-9A-Fa-f]{1,4}:
          | (?: (?:[0-9A-Fa-f]{1,4}:){0,4} [0-9A-Fa-f]{1,4})? ::
          ) (?:
              [0-9A-Fa-f]{1,4} : [0-9A-Fa-f]{1,4}
            | (?: (?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?) \.){3}
                  (?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)
            )
        |   (?: (?:[0-9A-Fa-f]{1,4}:){0,5} [0-9A-Fa-f]{1,4})? ::    [0-9A-Fa-f]{1,4}
        |   (?: (?:[0-9A-Fa-f]{1,4}:){0,6} [0-9A-Fa-f]{1,4})? ::
        )
      | [Vv][0-9A-Fa-f]+\.[A-Za-z0-9\-._~!$&'()*+,;=:]+
      )
      \]
    | (?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}
         (?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)
    | (?:[A-Za-z0-9\-._~!$&'()*+,;=]|%[0-9A-Fa-f]{2})*
    )
    (?: : [0-9]* )?
    (?:/ (?:[A-Za-z0-9\-._~!$&'()*+,;=:@]|%[0-9A-Fa-f]{2})* )*
  | /
    (?:    (?:[A-Za-z0-9\-._~!$&'()*+,;=:@]|%[0-9A-Fa-f]{2})+
      (?:/ (?:[A-Za-z0-9\-._~!$&'()*+,;=:@]|%[0-9A-Fa-f]{2})* )*
    )?
  |        (?:[A-Za-z0-9\-._~!$&'()*+,;=:@]|%[0-9A-Fa-f]{2})+
      (?:/ (?:[A-Za-z0-9\-._~!$&'()*+,;=:@]|%[0-9A-Fa-f]{2})* )*
  |
  )
  (?:\? (?:[A-Za-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9A-Fa-f]{2})* )?   # [ "?" query ]
  (?:\# (?:[A-Za-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9A-Fa-f]{2})* )?   # [ "#" fragment ]
  """

  defrecord URL, in: nil, date: nil, user: nil, info: nil

No license is specified.

Please specify a license, and include a LICENSE file at the top level. This will help people understand under what terms they can contribute and if code can be shared between other projects.

Module view optimization - "end" excess syntax

Please, let me ask you an option to change the "end" syntax in elixir to another color that is similar to the background, or almost make it completely transparent, once the "end" is not necessary in the functional scenario, and it will be really more clear and fast to read the elixir module.

Indentation issues with blocks.

When you use quote the end part aligns to def instead of quote.

And when using fn -> and go below, it aligns to the call instead of indenting outward.

Auto indentation fails with closing delimiter of indented nested arrays/hash literals

Hello!

See what happens when I auto-indent this (nonsense) code with =.

Before

def example do
  %{
    foo: => %{
      bar: 1
    }
  }

  [
    [
      1
    ]
  ]

  %{
    foo: [
    }
  }

  [
    %{
      bar: 1
    }
  ]
end

After gg=G

def example do
  %{
    foo: => %{
      bar: 1
    }
}

  [
    [
      1
    ]
]

  %{
    foo: [
    }
}

  [
    %{
      bar: 1
    }
]
end

The closing delimiters of the literal data structures are no longer correctly indented.

I'd have a crack at fixing this myself, but I've absolutely no idea where to begin with VimL :P

Cheers,
Louis

Problems to indent complex lists

This is the current indentation:

    def test do
      [ { :cowboy, github: "extend/cowboy" },
        { :dynamo, "0.1.0-dev", github: "elixir-lang/dynamo" },
          { :ecto, github: "elixir-lang/ecto" },
            { :pgsql, github: "semiocast/pgsql" } ]
    end

    def test do
      [ app: :first,
        version: "0.0.1",
        dynamos: [First.Dynamo],
          compilers: [:elixir, :dynamo, :ecto, :app],
            env: [prod: [compile_path: "ebin"]],
              compile_path: "tmp/first/ebin",
                deps: deps ]
    end

IMHO the correct indentation should be:

    def test do
      [ { :cowboy, github: "extend/cowboy" },
        { :dynamo, "0.1.0-dev", github: "elixir-lang/dynamo" },
        { :ecto, github: "elixir-lang/ecto" },
        { :pgsql, github: "semiocast/pgsql" } ]
    end

    def test do
      [ app: :first,
        version: "0.0.1",
        dynamos: [First.Dynamo],
        compilers: [:elixir, :dynamo, :ecto, :app],
        env: [prod: [compile_path: "ebin"]],
        compile_path: "tmp/first/ebin",
        deps: deps ]
    end

I guess the problem is in this line, when a list has one of [{( symbols the vim-elixir increment the indentation.

.exs files using tabs instead of spaces

I started editing a .exs file a few minutes ago and noticed that it is using tabs instead of spaces for indentation. .ex files do not exhibit this behavior.

Can I save a script without executing, or is my workflow wrong?

This is a n00b question. :) Suppose I write an Elixir script that ends with Expensive.function_call(), intending to run it from the command line.

Using vim-elixir, when I save an .exs file, it's immediately executed as part of determining whether there are syntax errors. If it takes 10 seconds to finish, the file won't be saved for 10 seconds.

This was unexpected for me, and would be even more so if the script actually had side effects (writing files, for example) or started a long-running process.

If "execute upon save" is the only way to check syntax (probably so?), how do vim-elixir users write scripts whose execution is expensive or dangerous?

Support for .eex templates

Right now there's no eex/eelixir filetype. I don't have experience with Vim syntax files, but we might be able to use vim-ruby as a starting place since it includes support for the "eruby" filetype.

how to set omnifunc?

I am new to the language, but I am more familiar with vim, but could not find the documentation for this plugin, do not know how to set completion

Mistreatment of """

vim-elixir highlights the , additional arguments as if they were inside the here document:

foo """, additional arguments
text that is actually in the """
"""
bar

It also incorrectly assumes the 2nd """ ends the here document - it doesn't, the 3rd """ does. This causes the rest of the code (bar) to be incorrectly highlighted as if it was inside the here document.

Broken color syntax for case

I noticed problem with missing color for end words and closing } in {int, _} when int > 0...

Example code:

defmodule Rumbl.Permalink do
  def cast(binary) when is_binary(binary) do
    case Integer.parse(binary) do
      {int, _} when int > 0 -> {:ok, int}
      _ -> :error
    end
  end
end

Sigil highlighting error on escape ")" character

In this case I have a sigilized string with an escaped closing paren

iex(2)> ~s(ruby -e '[].push('123'\))
"ruby -e '[].push('123')"

However the syntax rules don't seem to check for escaped sigils

1__deployer_exs______repos_backupify_scripts__-_vim__vim_

Integration with Vim Projectionist

Hi there,

I love your plugin, I was wondering if you have any thoughts on incorporating https://github.com/tpope/vim-projectionist into vim-elixir (see https://github.com/tpope/vim-rails which leans on it heavily I believe)

I have no clue how to do this (though I'm tempted to give it a try!).. as a vim-rails user it's really nice to be in a file and to type :A and get taken to the alternate file (e.g. from a model to a model spec). to be able to run a test by going .Rake. I'm utterly new to elixir, and I've never tried writing a vim plugin, but just wondering if this sort of feature is something you'd be interested in / see on your road map, or if you are sticking to syntax ? There's also https://github.com/mattreduce/vim-mix which might be a better fit?

Escaping ' in char lists not working.

For a repro, see the following example from: lib\elixir\lib\uri.ex

  def char_reserved?(c) do
    c in ':/?#[]@!$&\'()*+,;='
  end

Seems that ' isn't being escaped properly.

image

Current syntax checking is very dangerous

Running the file after every save is killing my machine. I've got Elixir scripts that run benchmarks, and every save of my file is locking up Vim for a long time.

Furthermore, it's potentially very dangerous. For instance, what if I accidentally typed this in my script:

File.rm_rf! "/"

Indentation weirdness with lists

Here is an example:

  def project do
    [name: "mix",
     version: "0.1.0"]
  end

This is how I would expect it to be indented. Let's walk through it incrementally and see how vim-elixir indents it:

  def project do
    [name: "mix",
    |

I would have expected this to indent up to the n in name:, but it indents to the opening bracket. So, we type a space and continue:

  def project do
    [name: "mix",
     version: "0.1.0"]
       |

This is where vim-elixir indents to when I hit newline after the closing bracket. I would have expected it to indent like this:

  def project do
    [name: "mix",
     version: "0.1.0"]
    |

Because of where it indents after the closing bracket, if I type end, I get this:

  def project do
    [name: "mix",
     version: "0.1.0"]
     end

Thoughts?

How to change the indentation

I don't really like 9 spaces when I press tab as the default indentation. I would like to be able to change it to 4 spaces per indentation or when I press tab. Is there anyway to change that, since I don't see any help txt file. Thank you!

Typing 'match' deindents

I was trying to name some values match and noticed this. Anytime you try to use the word 'match', it deindents two spaces. Try typing this code:

if true do
  match = "foo"
  IO.puts match
end

Struct element highlighting not fully working

In the below example, :alpha is not being parsed as an atom when included as a member of a defstruct expression. It is being highlighted correctly when included as a member of a list, though.

Discussion: Move test suite to Vader

tl;dr I am somewhat familiar with VimL and would love to help out on this project, however, it seems that the testing setup is specific to the a contributor's machine.


Please correct me if I am wrong: I'm running terminal Vim on iTerm and believe that the testing defaults for this project are a bit of a hinderance. Without too much knowledge of vimrunner, it seems that this piece in the spec_helper will require the GUI version of Vim. Moreover, it seems that folks will have to compile a version of Vim with these specific requirements as dictated by vimrunner or setup MacVim.

Furthermore, vimrunner and rspec assumes that a contributor knows some Ruby. Maybe vim-elixir could use a VimL friendly testing framework, i.e., (vim-vader)[https://github.com/junegunn/vader.vim]?

Ultimately, if vimrunner and rspec are going to remain throughout this project, could someone with the domain knowledge add a brief testing setup summary into the README. Thanks so much! ๐Ÿ˜„

Some tests are passing when they shouldn't

Right now, since the tests run on already indented code, some of them are unaffected by the indentation rules and pass when they shouldn't. To demonstrate this I have 775ae31, which remove the indentation before trying to indent the text. The result is that 4 extra tests fail.

A couple of potential fixes for this that I can think of:

  • Do what I've done here, and strip the indentation before attempting to indent. this is probably the simplest option.
  • Provide an input and expected result for each test. This is more thorough, but would result in a bit more work and the tests probably wouldn't be as nice to read as they are right now.

I'd like to help out with some of the failing specs, but I figured this should probably be resolved first.

Pipeline indentation bug

Bad things happen when expression have multiple = symbols:

Post
|> where([p], p.id == 10)
                      |> where([p], u.user_id == 1)
                                                 |> select([p], p)

Folding doesn't work

I have a module with two functions. I should be able to fold either the whole module, or each function individually. Instead, the module folds "over" the first function only. See the screen shots below for clarification.

Unfolded:
elixir-unfolded

Folded:
elixir-folded

not detecting elixir files

i have vim-elixir installed (using Vundle).. if i run :set filetype=elixir, it highlights and everything but i can't get it to recognize files ending with .ex :\

Speed issues reloaded.

Got some profiling done.

Old regexp engine.

  TOTAL      COUNT  MATCH   SLOWEST     AVERAGE   NAME               PATTERN
  0.320364   24326  5809    0.000916    0.000013  elixirSymbol       \%([a-zA-Z_]\w*\([?!]\)\?\):\(:\)\@!
  0.207783   20348  3472    0.000398    0.000010  elixirOperator     \%(<=>\|<\%(<\|=\)\@!\|>\%(<\|=\|>\)\@!\|<=\|>=\|===\|==\|=\~\|!=\|!\~\|?[ \t]\@=\)
  0.205511   24805  6274    0.000848    0.000008  elixirOperator     |\|++\|--\|\*\*\|\/\/\|<-\|<>\|<<\|>>\|=\|\.\|::
  0.158070   21502  2971    0.008710    0.000007  elixirOperator     !+[ \t]\@=\|&&\|||\|\^\|\*\|+\|-\|/
  0.140059   18531  0       0.000775    0.000008  elixirOperator     %=\|\*=\|\*\*=\|+=\|-=\|\^=\|||=
  0.089855   66276  7588    0.001143    0.000001  elixirBlock        \<end\>
  0.066333   18550  19      0.000135    0.000004  elixirVariable     @[a-zA-Z_]\w*\|&\d
  0.062502   23992  5494    0.000270    0.000003  elixirName         \<[A-Z]\w*\>
  0.058267   21691  3160    0.000043    0.000003  elixirNumber       \<\d\(_\?\d\)*\(\.[^[:space:][:digit:]]\@!\(_\?\d\)*\)\?\([eE][-+]\?\d\(_\?\d\)*\)\?\>
  0.051194   18531  0       0.000418    0.000003  elixirKeyword      \<\%(->\)\>\s*
  0.037833   24343  9697    0.000104    0.000002  elixirBlock        \<do\>\(:\)\@!
  0.034945   18531  0       0.000099    0.000002  elixirSymbol       \(:\)\@<!:\%(<=>\|&&\?\|%\(()\|\[\]\|{}\)\|++\?\|--\?\|||\?\|!\|//\|[%&`/|]\)
  0.034938   18545  14      0.000038    0.000002  elixirSymbol       \(:\)\@<!:\%([a-zA-Z_]\w*\%([?!]\|=[>=]\@!\)\?\|<>\|===\?\|>=\?\|<=\?\)
  0.028728   18531  14      0.008233    0.000002  elixirComment      #.*
  0.025052   20647  2116    0.000168    0.000001  elixirAnonymousFunction \<fn\>
  0.023032   18531  0       0.000144    0.000001  elixirSymbolInterpolated :\("\)\@=
  0.022628   18531  0       0.000356    0.000001  elixirString       \(\w\)\@<!?\%(\\\(x\d{1,2}\|\h{1,2}\h\@!\>\|0[0-7]{0,2}[0-7]\@!\>\|[^x0MC]\)\|(\\[MC]-)+\w\|[^\s\\]\)
  0.020974   18531  0       0.000162    0.000001  elixirNumber       \<0[bB][01]\+\>
  0.020911   18531  0       0.000313    0.000001  elixirDocString    '''
  0.020596   18531  0       0.000122    0.000001  elixirNumber       \<0[xX][0-9A-Fa-f]\+\>
  0.020076   18531  0       0.000044    0.000001  elixirString       "
  0.019941   18531  0       0.000075    0.000001  elixirString       '
  0.019899   18531  0       0.000108    0.000001  elixirDocString    """
  0.019553   18531  0       0.000141    0.000001  elixirRegex        %r/
  0.009238   6668   1299    0.000018    0.000001  elixirAnonymousFunction \<end\>
  0.005670   2857   2857    0.000034    0.000002  elixirFunctionDeclaration [^[:space:];#<,()\[\]]\+
  0.003587   2843   2843    0.000033    0.000001  elixirArguments    )
  0.003497   2857   2843    0.000021    0.000001  elixirArguments    (
  0.000388   162    162     0.000004    0.000002  elixirImplDeclaration [^[:space:];#<]\+
  0.000107   19     19      0.000014    0.000006  elixirModuleDeclaration [^[:space:];#<]\+
  0.000036   14     14      0.000005    0.000003  elixirRecordDeclaration [^[:space:];#<]\+

  1.731567   541348

New regexp engine

  TOTAL      COUNT  MATCH   SLOWEST     AVERAGE   NAME               PATTERN
  0.401159   37040  10625   0.011535    0.000011  elixirOperator     |\|++\|--\|\*\*\|\/\/\|<-\|<>\|<<\|>>\|=\|\.\|::
  0.367277   29468  5736    0.013881    0.000012  elixirOperator     \%(<=>\|<\%(<\|=\)\@!\|>\%(<\|=\|>\)\@!\|<=\|>=\|===\|==\|=\~\|!=\|!\~\|?[ \t]\@=\)
  0.267639   31018  4603    0.000168    0.000009  elixirOperator     !+[ \t]\@=\|&&\|||\|\^\|\*\|+\|-\|/
  0.234225   38024  11627   0.000538    0.000006  elixirSymbol       \%([a-zA-Z_]\w*\([?!]\)\?\):\(:\)\@!
  0.226895   26415  0       0.001037    0.000009  elixirOperator     %=\|\*=\|\*\*=\|+=\|-=\|\^=\|||=
  0.170971   95470  10513   0.000447    0.000002  elixirBlock        \<end\>
  0.160030   26415  0       0.000378    0.000006  elixirSymbol       \(:\)\@<!:\%(<=>\|&&\?\|%\(()\|\[\]\|{}\)\|++\?\|--\?\|||\?\|!\|//\|[%&`/|]\)
  0.155998   26435  22      0.000374    0.000006  elixirSymbol       \(:\)\@<!:\%([a-zA-Z_]\w*\%([?!]\|=[>=]\@!\)\?\|<>\|===\?\|>=\?\|<=\?\)
  0.131036   26415  0       0.000178    0.000005  elixirString       \(\w\)\@<!?\%(\\\(x\d{1,2}\|\h{1,2}\h\@!\>\|0[0-7]{0,2}[0-7]\@!\>\|[^x0MC]\)\|(\\[MC]-)+\w\|[^\s\\]\)
  0.124561   31183  4770    0.000119    0.000004  elixirNumber       \<\d\(_\?\d\)*\(\.[^[:space:][:digit:]]\@!\(_\?\d\)*\)\?\([eE][-+]\?\d\(_\?\d\)*\)\?\>
  0.121338   36060  9723    0.000308    0.000003  elixirName         \<[A-Z]\w*\>
  0.108762   26446  31      0.000193    0.000004  elixirVariable     @[a-zA-Z_]\w*\|&\d
  0.084049   36139  15171   0.000143    0.000002  elixirBlock        \<do\>\(:\)\@!
  0.043683   30191  3776    0.000205    0.000001  elixirAnonymousFunction \<fn\>
  0.039937   26415  0       0.000234    0.000002  elixirSymbolInterpolated :\("\)\@=
  0.031686   26415  0       0.000173    0.000001  elixirKeyword      \<\%(->\)\>\s*
  0.029315   26417  22      0.000076    0.000001  elixirComment      #.*
  0.028686   26415  0       0.000052    0.000001  elixirNumber       \<0[bB][01]\+\>
  0.028419   26415  0       0.000340    0.000001  elixirDocString    '''
  0.028359   26415  0       0.000037    0.000001  elixirNumber       \<0[xX][0-9A-Fa-f]\+\>
  0.028025   26415  0       0.000239    0.000001  elixirString       '
  0.027988   26437  26      0.000152    0.000001  elixirString       "
  0.027857   26415  0       0.000089    0.000001  elixirDocString    """
  0.027638   26415  0       0.000193    0.000001  elixirRegex        %r/
  0.022562   11626  2219    0.000029    0.000002  elixirAnonymousFunction \<end\>
  0.014241   4270   4270    0.000032    0.000003  elixirFunctionDeclaration [^[:space:];#<,()\[\]]\+
  0.005254   4221   4221    0.000011    0.000001  elixirArguments    )
  0.004958   4239   4221    0.000028    0.000001  elixirArguments    (
  0.001918   378    378     0.000014    0.000005  elixirImplDeclaration [^[:space:];#<]\+
  0.000472   31     31      0.000071    0.000015  elixirModuleDeclaration [^[:space:];#<]\+
  0.000116   31     31      0.000009    0.000004  elixirDelegateDeclaration [^[:space:];#<,()\[\]]\+
  0.000110   18     18      0.000009    0.000006  elixirRecordDeclaration [^[:space:];#<]\+
  0.000051   31     0       0.000011    0.000002  elixirDelegateDeclaration \[
  0.000028   8      4       0.000013    0.000004  elixirRegexEscape  \\\\\|\\[aAbBcdDefGhHnrsStvVwW]\|\\\d\{3}\|\\x[0-9a-fA-F]\{2}
  0.000026   24     0       0.000002    0.000001  elixirString       \\"
  0.000026   24     24      0.000002    0.000001  elixirString       "
  0.000011   8      4       0.000002    0.000001  elixirInterpolation #{
  0.000009   8      8       0.000002    0.000001  elixirInterpolation }
  0.000006   6      0       0.000001    0.000001  elixirRegexCharClass \[:\(alnum\|alpha\|ascii\|blank\|cntrl\|digit\|graph\|lower\|print\|punct\|space\|upper\|word\|xdigit\):\]

  2.945321   785816

Color for `do end` regression

$ git last
commit 6e58b17f6bbf4be396f661120162417a8293757b
Author: Kassio Borges <[email protected]>
Date:   Fri Jan 1 22:34:17 2016 -0300

When I use this commit of vim-elixir, do end color looks fine:
screen shot 2016-01-08 at 1 11 15 pm

But after this recent commit 788a50b, do and end have the same color with def now:

$ git log 788a50b -1
commit 788a50bb761a5e4d59da30e6dc449cd4e41947a0
Author: Kassio Borges <[email protected]>
Date:   Sat Jan 2 17:41:02 2016 -0300

    Create a `elixirBlockDefinition` syntax

    This use `Define` colors on `do`/`end` and `fn`/`end` blocks.
$ git merge 788a50b
Updating 6e58b17..788a50b
Fast-forward
 syntax/elixir.vim | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

screen shot 2016-01-08 at 1 13 18 pm

Also, auto completion of end for do after pressing return doesn't work either. This is vim-endwise's job, but it did work before, and after commit 788a50b, it didn't work.

Highlighting frequently breaks on Elixir's enum.ex

I was doing a little hacking in Elixir's builtin enum.ex file and I noticed that the highlighting seems to break once you scroll down. When I open the file, I usually see this:

good

But if I scroll down for a bit, it all turns bad and scrolling back up gets me something like this:

bad

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.