Git Product home page Git Product logo

vim-easy-align's People

Contributors

d4d3vd4v3 avatar jan-warchol avatar junegunn avatar mgaffney avatar wilywampa avatar yanma avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vim-easy-align's Issues

Suggestion for improved interface

I do like the plugin, but after some testing and wanting to align a paragraph after --> as column delimiter, I couldn't find out how. So i thought: why not let the liveEditing accept any string as delimiter followed by and then match the lines according to the string entered.

Using <enter> as a normal mode mapping

Hi, great plugin, thanks for creating it.

I have a question about the mappings. I'd like both visual and normal mode mappings to use the same key.
At first I thought that could be <enter> so I had these mappings:

vmap <Enter> <Plug>(EasyAlign)
nmap <Enter> <Plug>(EasyAlign)

I quickly realized how foolish is that. After opening a quickfix window I couldn't select a file (because enter was remapped). Doh.

I've since started using pipe character | for both visual and normal mode. But that's not as nice as enter, especially since this plugin also uses enter for right and center alignment.

So a question: do you know of a way to use enter mapping for normal mode but in a way that it does not mess up quicklist?
Also, are there other scenarios where nmap <enter> would be an issue? (if yes, is there a way around it?)

Thanks for the help!

Silent mappings

Following your recommendation here I have the following mapping:

nmap <Leader>& mz<Plug>(EasyAlign)ip*&`z

When calling the mapping I would like to suppress the

:EasyAlign *&

message that is returned in the command line (as seen in the image)
Is there a way to do this? I tried adding <silent> to the mapping definition but it does not work.
Thanks!! (awesome plugin btw)

screenshot-26-06-2014_14-37-13

How to use recursive alignment?

Hey! I saw the last commit implementing recursive alignment (if I read right).

I get it right, it should be able to help transform something like:

class Offer
  include DataMapper::Resource

  property :id, serial
  property :title, string, required: true
  property :description, text, required: true
  property :company_name, text, required: true
  property :company_logo, string, length: 250
  property :location, text, required: true
  property :starting_date, datetime
  property :created_at, datetime

end

Into something like:

class Offer
  include DataMapper::Resource

  property :id,            serial
  property :title,         string, required: true
  property :description,   text,   required: true
  property :company_name,  text,   required: true
  property :company_logo,  string, length: 250
  property :location,      text,   required: true
  property :starting_date, datetime
  property :created_at,    datetime

end

Am I right? If so, I'd like to know how to use it. If not, can someone explain to me what I missed? :)

For the record, all I've managed to get is:

class Offer
  include DataMapper::Resource

  property :id,            serial
  property :title,         string, required: true
  property :description,   text, required: true
  property :company_name,  text, required: true
  property :company_logo,  string, length: 250
  property :location,      text, required: true
  property :starting_date, datetime
  property :created_at,    datetime

end

Feature request/idea: Realtime interactive mode

I really like this plugin, and the interactive mode is very useful!

One thing that would be very cool, though, would be to have a realtime interactive mode. With this I mean that the selected table/lines would be aligned in realtime in an interactive mode. Something like:

  1. Select lines to be aligned
  2. Start EasyAlignRealTime (or whatever)
  3. Specify delimiter -> table is aligned at once, but we're still in interactive mode
  4. Change delimiter/alignment mode -> table updated at once, still in interactive mode
  5. Change options -> table updated at once, still in interactive mode
  6. Bonus: Add delimiter/alignment mode (first align everything, then for instance change one column if desired)
  7. Continue to change until table looks as desired, then exit interactive mode

I don't know how involved this is, but I noticed that I have already often needed several attempts to tweak my desired aligning. I think it could be very useful to tweak in realtime.

Vim Throws "using floating point as string"

The error message refers to do_align at:

 { 'pivot_len': 0.0, 'token_len': 0, 'just_len': 0, 'delim_len': 0, 'indent': 0, 'tokens': 0, 'strip_len': 0 }

The error message disappears, when I change 0.0 to '0.0' in the named function, but of course then the alignment does not work at all. I also tried with an integer instead of a float with the same result as with the string.

What I did:

  1. install easy-align with pathogen as described in the Readme.
  2. add the mappings according to the Readme to my .vim file.
  3. open DEMO.md from the package
  4. move the cursor to George Harrison
  5. vip <Enter> <Space>

I use Vim 7.3.547 on Ubuntu Linux. I also have lightline and fugitive installed.

What am I missing?

Repeat of visual <Plug>(LiveEasyAlign) broken

Since f6586ba, repeating an alignment in visual mode using <Plug>(EasyAlignRepeat) doesn't work if the first alignment was done in live visual mode. It appears to do the alignment and then immediately undo it. For example:

vmap <CR> <Plug>(LiveEasyAlign)
vmap <C-^> <Plug>(EasyAlignRepeat)

operating on this text:

1    let VCSCommandCVSExec = ''
2    let VCSCommandCVSDiffOpt = '--internal-diff'
3    let VCSCommandBZRExec = ''
4
5    let VCSCommandSVKExec = ''
6    let VCSCommandDisableMappings = 1

If I select lines 1-3 and press <CR>== it aligns the =s, but then if I select 5-6 after that and press <C-^> the problem described above happens.

I tried to fix it but could only cause more problems to show up in the Vader tests.

Alignment is funky when indentation method is tabs.

If you're using tabs to indent instead of spaces the functionality is strange.

Ex (» denotes beginning of tab)

»   »   a = 1
»   »   »   b =2
»   »   »   c = 4
»   »   »   »   f=4

Running :EasyAlign= results in this

»   »   a   = 1
»   »   »   b  = 2
»   »   »   c  = 4
»   »   »   »   f = 4

Running an align on = using shallow or deep indentation removes tabs and uses spaces. Ex:

  a = 1
  b = 2
  c = 4
  f = 4

Align N-th delimiter as custom delimiter

Is there a way to align using the N-th parameter such as:

-) or 2=

Inside of the easy_align_delimiters variable? What I'm looking to do is:

let g:easy_align_delimiters = 
{
    'pattern' : ')',
    'left_margin' : 1,
    'right_margin' : 0,
    'stick_to_left' : 0,
    'n-th_param' : '-'
}

Or something similar...

Align on '//'

Having some trouble aligning javascript comments like so:

var clientId      = null;     // chrome extension address
var connection    = null;   // connection to the mooltipass
var connected     = false;   // current connection state
var version       = 'unknown'; // connected mooltipass version
var authReq       = null;      // current authentication request

I tried the regexps //, \/\/, \\/\\/ and \\\/\\\/

Adding allign to comments

I was wondering if the plugin could be extended by adding alignment to comments. Like in the following python code:

var1 = 10 # This is a variable
var2 = 1000 # This is another variable

Which would produce:

var1 = 10   # This is a variable
var2 = 1000 # This is another variable

Also, for comment using /**/. Like

/*
* This is a comentary
*/

Which would became

/*
 * This is a comentary
 */

Aligning on <-

In the R language, it is common practice to use the combination <- for assignment. It would be nice if there were a way to align on this.

Example:

x  <- 5
something.longer<-       83

becomes

x                <- 5
something.longer <- 83

Could you suggest an easy way to achieve this using vim-easy-align?

Alignment of vim comments

let g:EasyGrepReplaceWindowMode=2   " autowriteall all changes during a search and replace session
let g:EasyGrepOptionPrefix='<leader>e' " shortcut to turn on and off certain grepoptions
let g:EasyGrepRecursive=1        " turn on recurse option for replacement
let g:EasyGrepCommand=1                " using system 'grepprg' instead of 'vimgrep

Better would be:

let g:EasyGrepReplaceWindowMode=2      " autowriteall all changes during a search and replace session
let g:EasyGrepOptionPrefix='<leader>e' " shortcut to turn on and off certain grepoptions
let g:EasyGrepRecursive=1              " turn on recurse option for replacement
let g:EasyGrepCommand=1                " using system 'grepprg' instead of 'vimgrep

My solution doesn't work:

let g:easy_align_delimiters = {
\ '"': { 'pattern': ' \(\S\+\s*[;=]\)\@=',  'left_margin': 1, 'right_margin': 1, 'stick_to_left': 0 } }

Are there any resources where I can look up those things?

Feature request: Add pattern for LaTeX

Hi,

I like your plugin! I've been using Tabular, and happened to stumble upon this plugin by chance, and I think I will make the switch!

My request is to add & as a predefined delimiter. I know that I can use regexp with <CTRL-X> and that I may define custom patterns myself, but I still feel like the & for LaTeX tables and environments is important enough that it should be included by default.

Aligning around "

I have this snippet of code:

call s:Color('CtrlPNoEntries', 'base7', 'orange') " there are no entries
call s:Color('CtrlPMatch', 'green') " the matching part
call s:Color('CtrlPLinePre', 'base2') " the '>' in the match window
call s:Color('CtrlPPrtBase', 'magenta') " wat
call s:Color('CtrlPPrtText', 'cyan') " the text in the prompt

I'm trying to align it in order to become this:

call s:Color('CtrlPNoEntries', 'base7', 'orange') " there are no entries
call s:Color('CtrlPMatch', 'green')               " the matching part
call s:Color('CtrlPLinePre', 'base2')             " the '>' in the match window
call s:Color('CtrlPPrtBase', 'magenta')           " the wft
call s:Color('CtrlPPrtText', 'cyan')              " the text in the prompt

I tried using <C-x> in interactive mode and insert " as a regex, but it doesn't seem to work. I also tried this:

let g:easy_align_delimiters = { '"': { 'pattern': '"' } }

but neither did this.

The only way I managed to make it work is by using " as the regular expression (note the two spaces), which however leaves me with extra spaces surrounding the double quotes, like this:

call s:Color('CtrlPNoEntries', 'base7', 'orange')  "  there are no entries

Am I doing something wrong? Thanks in advance, and great plugin btw!

Add option to add specific keys

Thanks for the work on this great plugin, much appreciated!I have a question, for example:

This is (example)
Yet another (example)

When I visual select that block, and align on the key ), it is an unknown delimiter key for EasyAlign.
In the very well written EasyAlign documentation, I see this are the only known delimiter keys:

Delimiter key (a single keystroke; <Space> , `=`, `:`, `.`, `|`, `&`, `,`)

So I want to be able to add custom delimiter keys like '(' or '[' or ", or even in future cases, characters like 'e' or 'o'.

Any thoughts on this?

Unknow delimiter key "working"

Hello,

The One-minute guide works for me, but not as showed in the initial gif animation.
I receive the error Unknow delimiter key: x 4 times, where x is {g,a,i,p}
and EasyAlign(_) isn't populated.

vim 7.4.540
urxvt 9.2

Edit: Oh, my bad. That's more easy than I tought, awesome.

:EasyAlign command not aligning selected text. Am I missing something?

I expected text to be aligned with these operations, but the text was not changed, while no error was raised.

Am I missing something?

  1. Select a chunk of text with visual mode

    language_model translation_table
    test_set test_references
    tune_set tune_references
    
  2. (to suppress other plugin as possible), call :'<,'>EasyAlign \␣

I'm using MacVIM 7.4, if that matters.

Thanks!

Can't align around quotes(both double and single)

I want to align some comments inside my .vimrc:

autocmd BufNewFile,BufRead *.sql set filetype=mysql " force mysql highlight
autocmd FocusLost          * silent! :wa                    " addition to autowriteall

When I select them, press Enter, then Ctrl-X for a regular expression and then Enter again. Command line shows :EasyAlign /"/ and comments are not aligned. Neither it works with \%x22(char code for ") as regex.

Add key to toggle live mode

How about a special keystroke, such as i (perhaps too naive, say <c-i>) that allows one to enter interactive mode after <plug>easyalign? In this way one can halve the mappings needed to invoke easyalign in all its variants.

Aligning on #, Perl/Python/Ruby comments

Hi, is there any reason # isn't a default alignment? Seems very useful.

I tried using both # and # as a regexp, neither worked. Any idea how to align # comments?

Thank you!

Alias for EasyAlign?

I found it not so easy to type EasyAlign full, with the shifts and so on.

Is there a possibility to have a alias. Like

<,'>Ea=

instead

<,'>EasyAlign=

Spurious undo in live interactive mode

If a delimiter exists but is in an ignored group, undo will be triggered when no changes have been made, and it undos another level for every attempted change in the command. For example:

printf("foo = %f\n", foo);
printf("foobar = %f\n", foobar);

Using <Plug>LiveEasyAlign to align the =s makes no change because the =s are in strings, but undo is triggered anyway. Easy enough to fix that I don't want to fork the repository:

diff --git a/autoload/easy_align.vim b/autoload/easy_align.vim
index dbaa73f..e0730f2 100644
--- a/autoload/easy_align.vim
+++ b/autoload/easy_align.vim
@@ -640,7 +640,9 @@ function! s:interactive(range, modes, n, d, opts, rules, vis, live, bvis)
       let output = s:process(a:range, mode, n, d, s:normalize_options(opts), regx, a:rules, a:bvis)
       let &undolevels = &undolevels " Break undo block
       call s:update_lines(output.todo)
-      let undo = 1
+      if !empty(output.todo)
+        let undo = 1
+      endif
       let rdrw = 1
     endif
     if rdrw

Suggestion: Do nothing when 'nomodifiable' is set

I have mapped CR to EasyAlign in visual mode, but sometimes I get sloppy with my fingers and accidentally select and hit enter. Sometimes I do this in plugin buffers (like gitv) that are not normal editing buffers (and have enter mapped to command). This start EasyAlign, but that doesn't make sense in that buffer.

Since EasyAlign cannot complete the operation in a 'nomodifiable' buffer, maybe it should do nothing (immediately exit)?

(My workaround solution is to unmap EasyAlign in that buffer, so this is not a big deal for me.)

Ignore custom lines

I wanted to use easy-align on a LaTeX table that looks like this:

\begin{tabular}{lrr}
    \toprule
    Parameter & & Value \\
    \midrule
    $p_0$ & & \SI{8}{bar} \\
    $T_0$ & & \SI{30}{\degreeCelsius} \\ \\

    \multicolumn{3}{l}{Some text} \\
    Component & Amount [\si{kg/h}] & Amount [\%] \\
    \midrule
    \CO   &  \num{33111} & \num{4.80} \\
    N$_2$ & \num{333} & \num{77.06} \\
    O$_2$ &  \num{333391} & \num{16.83} \\
    Argon &   \num{1122} & \num{1.31} \\
    \bottomrule
\end{tabular}

However, \multicolumn kind of screws this up by making the first column way to wide. I was wondering if it would be possible to add more options to a given pattern to ignore certain kinds of lines, for instance in this case to ignore lines with \multiline.

How to align on ->

For example, in OCaml you often have code like:

match xxx with
| [] -> ...
| x::y::xs -> ...
| _ -> ...

How would I align on the -> token using this plugin?

weird break

I found a break at autoload/easy_align.vim line 846, without while or for statement.

How To Align Several Different Things

How would I go about doing two different alignments? For example, given the following coffeescript:

  user: Ember.belongsTo('models.User', key: 'user', embedded: true)
  cost: Ember.belongsTo('models.Cost', key: 'cost', embedded: true)
  booking: Ember.belongsTo('models.Booking', key: 'booking', embedded: true)
  pageTab: Ember.belongsTo('models.pageTab', key: 'page_tab_id')

I'd like to first align the keys, then align the arguments in Ember.belongsTo, like so:

  user:    Ember.belongsTo('models.User',    key: 'user',    embedded: true)
  cost:    Ember.belongsTo('models.Cost',    key: 'cost',    embedded: true)
  booking: Ember.belongsTo('models.Booking', key: 'booking', embedded: true)
  pageTab: Ember.belongsTo('models.PageTab', key: 'page_tab_id')

Feature request: Improve speed

Hi,

I have not looked at the code for vim-easy-align, so I am not sure to which extent it is optimized or not. However, when I use the :EasyAlign command for relatively complex tables that spans multiple lines and columns, I find it is rather slow. If there is any chance of optimizing the code for more speed, that would be great!

Proper implementation of visual-repeat

  1. Repeating visual-repeat

When repeating a Visual mode operator, the operator will be applied to the
same amount of text as the last time:

  • Linewise Visual mode: The same number of lines.
  • Blockwise Visual mode: The same number of lines and columns.
  • Normal Visual mode within one line: The same number of characters.
  • Normal Visual mode with several lines: The same number of lines, in the
    last line the same number of characters as in the last line the last time.
    The start of the text is the Cursor position. If the "$" command was used as
    one of the last commands to extend the highlighted text, the repeating will
    be applied up to the rightmost column of the longest line.

Selecting range of N-th delimiter

Hi,

Is it possible to select a range of delimiter, for example the 1st and 2nd delimiter without having to repeat the EasyAlign command for each delimiter?

New feature: Ignore expression

It would be very nice to be able to add an ignore expression during aligning. For instance, given the following code:

print *, 'Plotting isentrope data:', trim(fname) // 't_p.dat'
call plot(ta,        'T', pa/1.0e5, 'p', trim(fname) // 't_p.dat')
print *, 'Plotting isentrope data:', trim(fname) // 'p_u.dat'
call plot(pa/1.0e5,  'p', ua,       'u', trim(fname) // 'p_u.dat')
print *, 'Plotting isentrope data:', trim(fname) // 'p_c.dat'
call plot(pa/1.0e5,  'p', ca,       'c', trim(fname) // 'p_c.dat')
print *, 'Plotting isentrope data:', trim(fname) // 'a_p.dat'
call plot(aa,        'A', pa/1.0e5, 'p', trim(fname) // 'a_p.dat')
print *, 'Plotting isentrope data:', trim(fname) // 'a_u.dat'
call plot(aa,        'A', ua,       'p', trim(fname) // 'a_u.dat')
print *, 'Plotting isentrope data:', trim(fname) // 'a_c.dat'
call plot(aa,        'A', ca,       'p', trim(fname) // 'a_c.dat')
print *, 'Plotting isentrope data:', trim(fname) // 'b_a.dat'
call plot(beta(:,2), '%', aa,       'A', trim(fname) // 'b_a.dat')

It would be very nice if I could select all lines, then start LiveEasyAlign, align on ,, then add an ignore expression, for instance with <CTRL-I> and ignore all lines that start with print.

Regex align [A-Z] not different from [a-z]

Shouldn't this follow regular expression rules and differentiate on letter case?

Given the following unformatted SQL:

SELECT tt.something,
tt.something_else,
tot.something,
tot.something_else
FROM this_table tt
JOIN this_other_table tot
ON tot.table = tt.table

I'd like the following final result:

SELECT tt.something,
       tt.something_else,
       tot.something,
       tot.something_else
  FROM this_table tt
  JOIN this_other_table tot
    ON tot.table = tt.table

However, the command :EasyAlign /[A-Z]*/ matches lower and upper case, providing the following:

SELECT tt.something,
    tt .something_else,
   tot .something,
   tot .something_else
  FROM this_table tt
  JOIN this_other_table tot
    ON tot.table = tt.table

The command :EasyAlign /[a-z]*/ provides the same results:

SELECT tt.something,
    tt .something_else,
   tot .something,
   tot .something_else
  FROM this_table tt
  JOIN this_other_table tot
    ON tot.table = tt.table

Error in doc file

Hi @junegunn!

Thanks for a nice plugin :). The latest version has an incorrect help file with tag: "easy-align-examples" occuring twice. It results in E154: Duplicate tag when the :helptags has been performed.

All the best

szw

plugin not working anymore with latest vim

I've compiled vim from sources with all the patches, and when I try to use easy-align all that happens is that the cursor move to the first line / first column of the file. the text I selected is not aligned at all.

It looks like the problem appeared with one of the latest patches (e.g. patch 530 seems to have modified something about ranges), but I'm not sure which one or how I can discover it. If you need some help just ask, I'll do some more tests.

here's my vim version:

VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Nov 28 2014 09:00:28)
MacOS X (unix) version
Included patches: 1-537
Compiled by Homebrew
Huge version without GUI.  Features included (+) or not (-):
+acl             +farsi           +mouse_netterm   +syntax
+arabic          +file_in_path    +mouse_sgr       +tag_binary
+autocmd         +find_in_path    -mouse_sysmouse  +tag_old_static
-balloon_eval    +float           +mouse_urxvt     -tag_any_white
-browse          +folding         +mouse_xterm     -tcl
++builtin_terms  -footer          +multi_byte      +terminfo
+byte_offset     +fork()          +multi_lang      +termresponse
+cindent         -gettext         -mzscheme        +textobjects
-clientserver    -hangul_input    +netbeans_intg   +title
+clipboard       +iconv           +path_extra      -toolbar
+cmdline_compl   +insert_expand   +perl            +user_commands
+cmdline_hist    +jumplist        +persistent_undo +vertsplit
+cmdline_info    +keymap          +postscript      +virtualedit
+comments        +langmap         +printer         +visual
+conceal         +libcall         +profile         +visualextra
+cryptv          +linebreak       +python          +viminfo
+cscope          +lispindent      -python3         +vreplace
+cursorbind      +listcmds        +quickfix        +wildignore
+cursorshape     +localmap        +reltime         +wildmenu
+dialog_con      -lua             +rightleft       +windows
+diff            +menu            +ruby            +writebackup
+digraphs        +mksession       +scrollbind      -X11
-dnd             +modify_fname    +signs           -xfontset
-ebcdic          +mouse           +smartindent     -xim
+emacs_tags      -mouseshape      -sniff           -xsmp
+eval            +mouse_dec       +startuptime     -xterm_clipboard
+ex_extra        -mouse_gpm       +statusline      -xterm_save
+extra_search    -mouse_jsbterm   -sun_workshop    -xpm
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  fall-back for $VIM: "/usr/local/share/vim"
Compilation: /usr/bin/clang -c -I. -Iproto -DHAVE_CONFIG_H   -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -DMACOS_X_UNIX  -Os -w -pipe -march=native -mmacosx-version-min=10.10 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: /usr/bin/clang   -L. -L/usr/local/lib -L/usr/local/lib -Wl,-headerpad_max_install_names -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -o vim        -lm  -lncurses -liconv -framework Cocoa   -fstack-protector  -L/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE -lperl -framework Python   -lruby.2.0.0 -lobjc

Alignment with tabs inserting spaces still

Think I found an edge-case

Running :EasyAlign= on this (_ spaces in indent area, » tabs in indentation)

»   »   n2f = {}
»   »   n2v = {}
»   »   f2v = {}
»   »   n2gv = {}
»   »   n2vt = {}

Yeilds this

_»  »   n2f  = {}
_»  »   n2v  = {}
_»  »   f2v  = {}
_»  »   n2gv = {}
_»  »   n2vt = {}

Aligning ruby dsl

When using ruby in a DSL like way, I'd like to align:

many_to_one :workspace

many_to_many :resources,
           :join_table => :asset_resources

to:

many_to_one           :workspace

many_to_many          :resources,
                      :join_table => :asset_resources

I'd like to specify the column where to align the semi colon.

How can I do that?

Error when using delimiter alignment option

If I'm calling EasyAlign with a delimiter alignment option, like :EasyAlign {'a':'l'}, I'm getting the following error:

:EasyAlign (_) {'a': 'l'}
Error detected while processing function easy_align#align..<SNR>172_align..<SNR>172_interactive:
line   55:
E716: Key not present in Dictionary: m, 1)
E116: Invalid arguments for function strpart(opts.m, 1)
E15: Invalid expression: mode . strpart(opts.m, 1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.