Hi all. I'd like to find a way to align the <-
or =
when selecting several lines of codes. I realized I'm spending a lot of time doing it manually.
So this :
foo <- 1
potatoe <- 22
pneumonoultramicroscopicsilicovolcanokoniosis <- 333
Would be changed into this :
foo <- 1
potatoe <- 22
pneumonoultramicroscopicsilicovolcanokoniosis <- 333
And this:
data.frame(
foo = 1,
potatoe = 22,
pneumonoultramicroscopicsilicovolcanokoniosis = 333)
Would be changed into this :
data.frame(
foo = 1,
potatoe = 22,
pneumonoultramicroscopicsilicovolcanokoniosis = 333)
(don't modify indentation, if several =
on same line align first only)
In some cases I'd like also to be able to align comments as well.
So this:
foo <- 1 # foo!
potatoe <- 22 # potatoe!
pneumonoultramicroscopicsilicovolcanokoniosis <- 333 # uh?
Would be changed into this :
foo <- 1 # foo!
potatoe <- 22 # potatoe!
pneumonoultramicroscopicsilicovolcanokoniosis <- 333 # uh?
I think I can find my way to design an addon but before I invest time on this I thought there might be an existing solution (existing addon, rstudio feature I missed, clever regex replacement, other trick...)?