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

kuon
I have a page with a large state that is loaded from DB, let’s call that “data”. I have a root live view that load “data” on mount and r...
New
zazaian
I recently generated the boilerplate for a new mix app using the Phoenix 1.3.1 phx.new generator and realized that the structure of the w...
New
marcelo
I wrote a small article on how to use current_user with coherence on Phoenix. There are already a couple of blogposts about it but I thin...
New
dgamidov
Hi folks, Just a short instruction. Maybe it will help somebody. https://v4-alpha.getbootstrap.com/getting-started Install boostrap...
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
Zurga
In a quest to optimize the amount of data sent between the server and client I recently decided to try to use MessagePack instead of JSON...
New
1player
A question I had when first learning contexts and Ecto was how to expand the default context API to support more flexible queries. Usuall...
New
TwistingTwists
This is a thread to note down things/best practices encountered in LiveBeats App as I explore the source code. Found this usage of r...
New
ben-pr-p
Hey all! I put together a starter-pack / instructions to set up Phoenix with the new parcel-bundler instead of brunch (or webpack). It’s...
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

Other popular topics Top

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
yurko
Here are few pieces of (common) Linux knowledge that we use for reasonably small one server apps. We use Ubuntu but this should work for ...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 45766 226
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
AstonJ
You’re a programmer, so you don’t need spoon feeding with the conventional drivel about “this is an integer.” No. You need to know what’s...
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
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
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? https://hexdocs.pm/ecto/Ecto.Repo.h...
New

We're in Beta

About us Mission Statement