sodapopcan
I’ve heard that if you’re not embarrassed by v1 of your product Vim plugin then you’ve released too late.
I’ve been sitting on this the past couple of months and while there is plenty I still have planned (a good amount of stuff is in the works just not in this version), I decided I should cut a release so the few people who will be interested can start using what’s available.
So, I’m happy to announce mixer.vim. Mixer is somewhat similar to elixir-tools.nvim only it’s written in vim9script so that Vim users can have nice Elixir things too. It assumes you have elixir.vim installed.
Here is the features section of the README for posterity:
Features
-
Text objects
ad/id- Any macro with adoblock. Works on user-defined macros as well as keyword syntax (though the latter needs a little improvement).aD- Likeadbut include any assignment and/or attached comments (iDexists for convenience but is identical toid).af/if- A function/macro definitionaF- Likeafbut include all heads, docs, annotations,attrandslotdeclarations, and evendo_prefixed versions (iFexists for convenience but is identical toif).iS/aS- A sigilim/am- A map or structiM/aM- A moduleic/ac- A comment or documentation
-
Conveniences
'commentstring'is dynamically set in embedded HEEx/Surface.- matchit works in embedded HEEx/Surface templates.
- Automatically sets
:compilerif the appropriate plugin is found. - [experimental] Remaps
ctrl-]in templates that will jump to a phx-hook definition (it’s pretty smart about it) or event handlers on otherphx-attributes. Unfortunately this has a dependency on git-grep atm.
-
Commands
:Mixruns a mix command with autocomplete. Uses dispatch, neomake, asyncrun, or asyncdo if available.:Depsdoesn’t just wrapMix depsbut adds functionality like dynamically adding packages under your cursor (:Deps add floki, for example) or jumping to yourdeps
function no matter what you’ve called it (:Depswith no args).:Genis a unified command for runninggentasks (with autocomplete!), eg::Gen migration add_name_to_users:Gen live Accounts User users name:string age:integer
:IExstarts a:termwindow runningiex. Within a mix project it will assume-S mix. Use:IEx!to get a plain session within a mix project.
:help mixer has more!
Trending in Announcing
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries.
offset-based pagination with...
New
I needed to reuse React components from my Chrome extension in my Phoenix/LiveView backend. I noticed that for Svelte/Vue, there are live...
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
Hi all!
I want to present a small library which provides a mix task for generating an Entity-Relationship Diagram for Ecto schemas.
You...
New
Hello
Published a new library - ProcessHub!
ProcessHub is a library designed to manage process distribution within the Elixir cluster. ...
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
Other Trending Topics
New episode with Louis Pilfold - the most detailed conversation about Gleam’s design I’ve come across.
Worth knowing for the Elixir comm...
New
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself.
My main conc...
New
It’s not that it’s vocabulary is too advanced. It’s something worse.
I get lost trying to follow even a paragraph written by Claude. It’...
New
This showed up on my feed.. anyone heard of it? Just hype?
Ox Alpha is a reasoning model designed for coding, sustained ag...
New
Today we’re releasing Oban for Python. Not an Oban client in Python. Not a pythonx wrapper embedded in Elixir. Nope, it’s a fully operati...
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
- #elixirconf-us
- #ai
- #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 5- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
sodapopcan
(replying here not to avoid fully necroing the old thread)
Lol, ya I hear ya. I’m annoyed at how long I put this off for myself. For me the text objects are the star of the show here even though they need some tweaking for keyword syntax. I find
:Genvery useful as well since I seem to always typemix phx.gen.migration.Mixcan be a bit finicky depending on if you use an async runner or not. I’m happy to discuss defaults and adding options and for any feedback/contributions in general of course!There is quite a bit more coming than I’ve documented. I always get nervous before I make a repo public so I scrambled to ready it and missed some things. A lot of it is near ready just not quite polished enough for release.
ca1989
Thank you for the effort! It’s very appreciated
sodapopcan
Just a lil’ update…
Once this plugin reaches beta I don’t plan on updating here anymore but for now you’re likely gonna be getting some semi-regular updates (whatever that means).
Here’s what’s different:
:Gennow does what you probably expected it should do from the start which is load all generated files into the quickfix list and auto-jump to the first entry. And of course:Gen!is available just in case you want don’t want to do any jumping and stay right where you are.That’s it, really… unless, of course, you tried this plugin as soon as I posted it and learned that my cherry-picking fu was way off and I had neglected to include several features I claimed were there… anyway, that all that works now (probably).
sodapopcan
The
:IExcommand now includes a hacky “connected REPL” or “Discount Connected REPL” as I like to call it. You could also say it’s a “We have connected REPLs at home” if you’re into that meme. I wouldn’t go so far as to say it’s the GoBots of connected REPLs because GoBots were cooler than this.In short, you can start an iex session in a Vim
:termand every time you save the buffer it will load the changes into the terminal. It even works with parts of a buffer via ranges/counts/visual selection.In any event, it’s hard to describe so I made a short-ish screencast. It’s my first one ever so be nice if you choose to watch it… or don’t be nice, either is cool.
sodapopcan
I haven’t given an update on this project in a while so figured I’d share a newer thing. I’ve only been using it a week so it’s not super polished yet.
I’ve been playing around with htmx lately which means I’ve been using classic controllers for the first time in a while which finally gave me the push to implement the
:Rcommand. If you are unfamiliar, this is similar to rails.vim’s:Rhere for hopping to “related” files (and almost entirely different than projectionist’s idea of “related”).In a nutshell:
This is currently non-configurable since for all I know I’m the only one who uses this plugin.
I’ve also added some experimental (and so far undocumented) general Projectionist support (to try it out add
let g:mixer_enable_projections = v:trueto your vimrc). I’m still tweaking it but the big idea here is that it uses its own heuristics (not to be confused with projectionist’s codified heuristics) to determine your project’s layout and defines projections based on this. There is a lot of detail here so I won’t go into it but briefly:Edomain- Edit a file inlib/my_apporlib/core.Eweb- Edit a file inlib/my_app_weborlib/web.Emigration- With no arguments will jump to the latest migration.I’m still working on this and I may end up implementing my own version as Projectionist isn’t too well suited for typical Phoenix project layouts (if there is indeed such a thing).