• Skip to primary navigation
  • Skip to main content
Sal Ferrarello
  • About Sal Ferrarello
  • Speaking
  • Connect
    Mastodon GitHub Twitter (inactive)
You are here: Home / Draft / Vim Easy Align Custom Rule for $

Vim Easy Align Custom Rule for $

Last updated on December 26, 2019 by Sal Ferrarello

I use Junegunn’s Vim plugin vim-easy-align to make it easier to align my code. Unfortunately, this plugin does not have a default mapping for aligning the dollar sign ($).

Because the plugin is designed to be extensible, I was able to add support for aligning by the dollar sign ($) by adding the following to my .vimrc file

let g:easy_align_delimiters = {
\ '$': {
\      'pattern':       '$\+',
\      'right_margin':  0,
\      'stick_to_left': 0,
\      'ignore_groups': ['!Comment']  },
\ }
Sal Ferrarello
Sal Ferrarello (@salcode)
Sal is a PHP developer with a focus on the WordPress platform. He is a conference speaker with a background including Piano Player, Radio DJ, Magician/Juggler, Beach Photographer, and High School Math Teacher. Sal can be found professionally at WebDevStudios, where he works as a senior backend engineer.

Share this post:

Share on TwitterShare on FacebookShare on LinkedInShare on EmailShare on Reddit
Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Draft, Solution Tagged With: neovim, vim, vimplugin

Reader Interactions

Comments

  1. Николай says

    August 10, 2021 at 8:26 am

    It so amazing!
    Thanks!
    (and try ‘left_margin’: 1,)

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Copyright © 2023 · Bootstrap4 Genesis on Genesis Framework · WordPress · Log in