Skip to content

Commit e774b34

Browse files
committed
Add support for Elixir
1 parent 3920f6d commit e774b34

File tree

8 files changed

+57
-8
lines changed

8 files changed

+57
-8
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [0.4.0] - 2020-05-24
8+
### Added
9+
- Support for Elixir.
10+
- Add color to `nil` in Ruby.
11+
712
## [0.3.0] - 2020-05-24
813
### Added
914
- Support for TypeScript.

README.md

+8-4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Supported languages/syntaxes:
88
- Ruby using [vim-ruby/vim-ruby](https://github.com/vim-ruby/vim-ruby)
99
- JavaScript using [yuezk/vim-js](https://github.com/yuezk/vim-js)
1010
- TypeScript using [HerringtonDarkholme/yats.vim](https://github.com/HerringtonDarkholme/yats.vim)
11+
- Elixir using [elixir-editors/vim-elixir](https://github.com/elixir-editors/vim-elixir)
1112

1213
More on the way!
1314

@@ -24,7 +25,7 @@ Plug 'lucasprag/simpleblack'
2425
You can also set a specific version if you want to not receive updates.
2526

2627
```
27-
Plug 'lucasprag/simpleblack', { 'tag': 'v0.3.0' } " latest version
28+
Plug 'lucasprag/simpleblack', { 'tag': 'v0.4.0' } " latest version
2829
```
2930

3031
## Screenshots
@@ -33,16 +34,19 @@ Plug 'lucasprag/simpleblack', { 'tag': 'v0.3.0' } " latest version
3334

3435
Notice that you can distinguish between module, class and method endings by color.
3536

36-
![simpleblack](github/ruby.png)
37+
![ruby](github/ruby.png)
3738

3839
#### JavaScript
3940

40-
![simpleblack](github/javascript.png)
41+
![javascript](github/javascript.png)
4142

4243
#### TypeScript
4344

44-
![simpleblack](github/typescript.png)
45+
![typescript](github/typescript.png)
4546

47+
#### Elixir
48+
49+
![elixir](github/elixir.png)
4650

4751
## Usage
4852

colors/simpleblack.vim

+6-2
Original file line numberDiff line numberDiff line change
@@ -255,9 +255,9 @@ call <sid>hi('rubyFunction', s:simpleBlue2, s:none, 'none')
255255
call <sid>hi('rubyGlobalVariable', s:simpleWhite, s:none, 'none')
256256
call <sid>hi('rubyInclude', s:simpleIndianRed, s:none, 'none')
257257
call <sid>hi('rubyInstanceVariable', s:simpleWhite, s:none, 'none')
258-
call <sid>hi('rubyInterpolationDelimiter', s:none, s:none, 'none')
258+
call <sid>hi('rubyInterpolationDelimiter', s:simpleIndianRed, s:none, 'none')
259259
call <sid>hi('rubyOperator', s:simpleIndianRed, s:none, 'none')
260-
call <sid>hi('rubyPseudoVariable', s:simpleWhite, s:none, 'none')
260+
call <sid>hi('rubyPseudoVariable', s:simpleGoo, s:none, 'none')
261261
call <sid>hi('rubyRegexp', s:simpleGreen, s:none, 'none')
262262
call <sid>hi('rubyRegexpDelimiter', s:simpleGreen, s:none, 'none')
263263
call <sid>hi('rubyStringDelimiter', s:simpleGreen, s:none, 'none')
@@ -284,8 +284,12 @@ hi! link erlangDirective Statement
284284
hi! link erlangNode Identifier
285285

286286
" Elixir
287+
" based on https://github.com/elixir-editors/vim-elixir
287288
hi! link elixirAtom rubySymbol
288289
hi! link elixirModuleDeclaration rubyConstant
290+
call <sid>hi('elixirStringDelimiter', s:simpleGreen, s:none, 'none')
291+
call <sid>hi('elixirDocStringDelimiter', s:simpleBlue, s:none, 'none')
292+
call <sid>hi('elixirVariable', s:simpleSteel, s:none, 'none')
289293

290294
" XML
291295
call <sid>hi('xmlAttrib', s:simpleIndianRed, s:none, 'none')

examples/elixir.ex

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
require "vimcolors"
2+
3+
defmodule ElixirExample do
4+
use Vim.Colors
5+
6+
@moduledoc """
7+
Shows syntax highlithing for creating a screenshot
8+
"""
9+
10+
defmodule User do
11+
defstruct email: nil, role: "guest"
12+
end
13+
14+
@doc false
15+
def examples(_args) do
16+
["string", :atom, true, false, 99.9]
17+
|> Enum.each(fn(item) -> IO.puts("Look! We got a #{item}!") end)
18+
19+
map = %{key: <<1::3>>}
20+
if Map.has_key?(map, :key) do
21+
IO.inspect(%{map | key: "new value"})
22+
end
23+
24+
Enum.min([~D[2020-03-31], ~D[2020-04-01]])
25+
Enum.min_by(["a", "aa", "aaa", "b", "bbb"], &String.length/1)
26+
27+
[key: "value", key: "different value"]
28+
end
29+
30+
def message(user = %User{email: ~r/example/}) do
31+
case user.role do
32+
"admin" -> "Hey admin."
33+
"member" -> "Hello again member, please text the admin for help if you need."
34+
"guest" -> "Welcome guest, feel free to sign up to be a member."
35+
_ -> "I don't know who you are, but be my guest."
36+
end
37+
end
38+
end

examples/ruby.rb

-2
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,3 @@ def heredoc_example
3535
end
3636
end
3737
end
38-
39-

github/elixir.png

68.2 KB
Loading

github/ruby.png

-114 Bytes
Loading

github/simpleblack.png

-14.5 KB
Loading

0 commit comments

Comments
 (0)