Papillon6814
Hello. I’m a beginner of vim and I’d like to write elixir with it. I installed vim-elixir for that. But when I open the .heex file, it is not highlighted.
My .vimrc
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'airblade/vim-gitgutter'
Plugin 'junegunn/fzf.vim'
Plugin 'junegunn/fzf'
Plugin 'mileszs/ack.vim'
Plugin 'racer-rust/vim-racer'
Plugin 'rust-lang/rust.vim'
Plugin 'scrooloose/nerdtree'
Plugin 'sheerun/vim-polyglot'
" Enable to resite easily
Plugin 'simeji/winresizer'
Plugin 'tpope/vim-commentary'
" Enable to run git commands as vim commands
Plugin 'tpope/vim-fugitive'
Plugin 'unblevable/quick-scope'
" Elixir
Plugin 'elixir-editors/vim-elixir'
Plugin 'c-brenn/phoenix.vim'
Plugin 'slashmili/alchemist.vim'
Plugin 'mhinz/vim-mix-format'
Plugin 'mattreduce/vim-mix'
" Colors
Plugin 'ayu-theme/ayu-vim'
Plugin 'dracula/vim'
Plugin 'sickill/vim-monokai'
Plugin 'jacoborus/tender.vim'
call vundle#end()
let mapleader = "\<Space>"
filetype plugin indent on
set termguicolors
colorscheme tender
set number
set clipboard+=unnamed
" Do not break line
set nowrap
nnoremap <silent><C-r> :NERDTreeToggle<CR>
nnoremap <Leader>p :Files<CR>
nnoremap <Leader>u :redo<CR>
set shell=/bin/bash
set hidden
let g:racer_cmd = '~/.cargo/bin/racer'
let g:racer_experimental_completer = 1
set cursorline
syntax on
" Settings about tender colorscheme
" If you have vim >=8.0 or Neovim >= 0.1.5
if (has("termguicolors"))
set termguicolors
endif
" For Neovim 0.1.3 and 0.1.4
let $NVIM_TUI_ENABLE_TRUE_COLOR=1
" Elixir
au BufRead,BufNewFile *.ex,*.exs set filetype=elixir
au BufRead,BufNewFile *.eex,*.heex,*.leex,*.sface,*.lexs set filetype=eelixir
au BufRead,BufNewFile mix.lock set filetype=elixir
" Settings about tender colorscheme ends
" If you have vim >=8.0 or Neovim >= 0.1.5
if (has("termguicolors"))
set termguicolors
endif
" For Neovim 0.1.3 and 0.1.4
let $NVIM_TUI_ENABLE_TRUE_COLOR=1
if has("autocmd")
filetype plugin on
filetype indent on
autocmd FileType yml setlocal sw=2 sts=2 ts=2 et
autocmd FileType yaml setlocal sw=2 sts=2 ts=2 et
endif
func! STL()
let barWidth = &columns / 6
let barWidth = barWidth < 3 ? 3 : barWidth
let n = line('$') > 1 ? line('$') - 1 : line('$')
let buf_top = (line('w0') - 1) * (barWidth - 1) / n
let buf_bottom = (line('w$') ) * (barWidth - 1) / n
let cursor = (line('.') - 1) * (barWidth - 1) / n
let n1 = buf_top
let n2 = cursor - n1
let n2 = n1 + n2 >= barWidth ? barWidth - n1 - 1 : n2
let n3 = buf_bottom - cursor
let n3 = n1 + n2 + n3 >= barWidth ? barWidth - n1 - n2 - 1 : n3
let n4 = barWidth - n1 - n2 - n3 - 1
let bar = '['.repeat(' ', n1).repeat('-', n2).'@'.repeat('-', n3).repeat(' ', n4).']'
let stl_left = ' '
let stl_right = ' %<%F %m%r%h%w%=[%{&fenc},%{&ff},%Y] (%03l/%03L,%03v) '
return stl_left.bar.stl_right
endfunc
set laststatus=2
set statusline=%!STL()
And I have checked this issue:
syntax highlighting broken for `.*eex` files · Issue #562 · elixir-editors/vim-elixir · GitHub
Please help me if you are a vimmer and how to do it. Thank you.
![]()
Trending in Questions
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hello,
I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
Aludel - LLM Evaluation Workbench
Aludel is an embeddable Phoenix LiveView dashboard for evaluating and comparing LLM prompts across mult...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #ai
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming











Showing Posts 1 to 8- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
JohnnyCurran
Add the following to your
~/.vimrc:Credit to syntax highlighting broken for `.*eex` files · Issue #562 · elixir-editors/vim-elixir · GitHub
And make sure when you run
:set filetype?in a.heexfile, it shows asfiletype=eelixirYou may need to resource your
.vimrc(run:source ~/.vimrc) or quit and re-open vimPapillon6814
Hello, thank you for the reply!
Yes I had added the script into
~/.vimrc,I think my vim detects
.heexfile, but it does not highlight html in the file like this:It highlights
<%= %>, but does not highlight tags. Do you know something about that?Thank you.
sbaildon
You could optionally replace
vimwithneovimand install thenvim-treesitterplugin. You’ll get better highlighting with the treesitter grammarsJohnnyCurran
What does
:set filetype?return? For me, it showseelixirI have both HEEx and HTML tags highlighted
Papillon6814
Okay I try it, thanks!
Papillon6814
It shows like yours, but does not highlight the html parts…
ca1989
I would try vim-polyglot, it should improve a little bit (still not perfect though).
Treesitter, on the other hand, works great. I didn’t switch to neovim yet, but I am thinking about it, because I deal with heex daily…
zhabinka
Now Treesitter support heex format.
Сomplete list of languages can be found here –
https://github.com/nvim-treesitter/nvim-treesitter#supported-languages