5

I am looking for an Eclipse plugin that will align the equals signs on multiple lines and align words on multiple lines in columns.

Example:

def __init__(self, dim, ngram, hdim, nwords):
    self.dim = dim
    self.ncond = ngram - 1
    self.hdim = hdim
    self.nwords = nwords

should become:

def __init__(self, dim, ngram, hdim, nwords):
    self.dim    = dim
    self.ncond  = ngram - 1
    self.hdim   = hdim 
    self.nwords = nwords

Bonus point if it can also handle comments, i.e.

def __init__(self, dim, ngram, hdim, nwords):
    self.dim = dim  # word vector dimension
    self.ncond = ngram - 1  # number of conditioning words
    self.hdim = hdim  # number of hidden layer units
    self.nwords = nwords  # vocab size

should become

def __init__(self, dim, ngram, hdim, nwords):
    self.dim    = dim       # word vector dimension
    self.ncond  = ngram - 1 # number of conditioning words
    self.hdim   = hdim      # number of hidden layer units
    self.nwords = nwords    # vocab size

OCDFormat is pretty good but has an issue with some (common) operators, so I am looking for alternatives.

On Sublime I use the Sublime Alignment pluging (free):

enter image description here

enter image description here

On Notepad++ I use Code-Alignment (use: https://stackoverflow.com/q/20481399/395857).

1

You can use the Eclipse plugin columns4eclipse:

  • gratis
  • open source
  • I've tested it with Eclipse 4.3 x64 and 4.5 x64 on Windows 7 SP1 x64 Ultimate

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.