hauleth

hauleth

How I configure Vim to work with Elixir without much clutter

Some time ago someone suggested me to write article about how I have configured my Vim to work with Elixir, now there it is:

https://medium.com/@hauleth/dumb-elixir-visual-and-improved-editor-53c23a0800e4

Comments are welcome.

Most Liked

jdumont

jdumont

Just wanted to say thank you. I’ll be digging into this more over the next few days. I recently tried to spruce up my Vim config and get a better workflow going as I realised that I was doing a lot of tasks very mechanically or have got stuck in a rut doing things a certain way that’s less than optimal.

I had a look around for some direction but didn’t find much Elixir specific advice, so your post is very timely and very welcome!

cnck1387

cnck1387

I use https://github.com/junegunn/vim-plug.

The author has a lot of great plugins, plus the name is plug. How can you not like that?!

What’s nice is you can install and remove plugins really easily but when it comes to updating, you can choose which commits to deny (you get a full changelog of commits for each plugin once the update command finishes running). Also if you do nothing, it just accepts them all (which is what I do 99.9% of the time).

hauleth

hauleth

Remember, kids… Pandajail is where pandas are sent when you use someone else’s dotfiles .

Spacemacs is just set of dotfiles that is created by other people. Your configuration should be yours and yours only. So in general you can count me as a human that do not like neither Spacemacs nor SpaceVim.

This is one of the reason. Another reason is that I started using Vim years ago (~7 I think) and it just fitted me and I do not see any reason to change it.

hauleth

hauleth

I do not use TMux since I moved all my “multiplexing” into NeoVim terminals.

hauleth

hauleth

This one very much suits into rule:

Do not use other people’s dotfiles.

I just generated one and it is so much full of clutter that I cannot even. The minimal configuration for Vim and NeoVim for Elixir:

git clone https://github.com/elixir-editors/vim-elixir ~/.local/share/pack/elixir/start/elixir
touch ~/.config/nvim/init.vim
cat ~/.vimrc <<EOF
let s:config_dir = exists('$XDG_CONFIG_DIR') ? $XDG_CONFIG_DIR : $HOME . '/.config'
let s:data_dir = exists('$XDG_DATA_HOME') ? $XDG_DATA_HOME : $HOME . '/.local/share'

exec 'set runtimepath^='.s:config_dir.'/nvim,'.s:data_dir.'/nvim/site'
exec 'set packpath^='.s:data_dir.'/nvim/site'

syntax on
filetype plugin indent on

set laststatus=2
set wildmenu

runtime init.vim
EOF

And everything is there. Anything more should be added only if you know what you are doing.

Where Next?

Popular in Guides/Tuts Top

pel_daniel
Hi! I created some animations to explain what happens internally with map &amp; reduce functions. The code is open source. Any feedback...
New
OndrejValenta
Me and my boys started a new website specifically designed for other ASP.NET programmers that struggle, as we do, with their transformati...
New
annad
I’m posting this for developers who are totally new to Phoenix like myself. This is all probably obvious to more skilled Phoenix develope...
New
tobleron
Ok, so I am so excited to share with you the most interesting setup I have made for Elixir/Phoenix today. Why? Because if you trust me, i...
New
malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
New
benwilson512
Correct if me I’m wrong, as best I can tell there aren’t any reasons to use mix run --no-halt in production vs releases. The marginal val...
New
stryrckt
I’m excited about the new LiveComponents feature in LiveView, but I haven’t seen much written on it, so I decided to write a couple of ar...
New
AstonJ
This blog post hit my timeline earlier, and I’ve also been learning about some fantastic Elixir related tips via @pragdave’s new online c...
New
niku
I write an article Parameterized testing with ExUnit.The key concept is using ExUnit.Case.register_test/4 such as ExUnit.start() defmod...
New
tonydang
I recently got inertia-phoenix (an Inertia.js adapter for Phoenix) working with Svelte. Setting up the server-side rendering (SSR) with S...
New

Other popular topics Top

shahryarjb
Hello, I get Persian date from my client and convert it to normal calendar like this: def jalali_string_to_miladi_english_number(persi...
New
William
I would like to know that is there any online source for learning Phoenix Framework for building E-Commerce Store? Any advantage on build...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 record...
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 42633 214
New
josevalim
Hi everyone, One of the features added to Elixir early on to help integration with Erlang code was the idea of overridable function defi...
New
aesmail
Hello guys, I have finally made it. I created an admin interface for a framework. It’s been on my todo list for years and with the curre...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New

We're in Beta

About us Mission Statement