开发者

Align selected region in emacs

开发者 https://www.devze.com 2023-03-26 07:05 出处:网络
For example I write code if Foo do # do something end And then, I paste in my code many l开发者_高级运维ines.

For example I write code

if Foo do
  # do something
end

And then, I paste in my code many l开发者_高级运维ines.

if Foo do
  # do something
# do something
# do something
# do something
# do something
end

How I can fast align added lines?


Do you want to align automatically on insert, or you want to align it later? For later you can use indent-region function (bound to C-M-\). For automatic align on insert you can use following recipe (I don't remember where I took it, so I'll refer to my config) - see lines 45-66. You will need to add more modes to yank-indent-modes, but concrete mode should provide working indent function.

0

精彩评论

暂无评论...
验证码 换一张
取 消