开发者

Ruby Code Autoindentation in Vim

开发者 https://www.devze.com 2023-03-10 04:07 出处:网络
I have copied a Ruby example into Vim, but it turns out that this messed up the indentation. I tried to make Vim apply the Ruby specific indentation. To do that I uncommented the following lines in th

I have copied a Ruby example into Vim, but it turns out that this messed up the indentation. I tried to make Vim apply the Ruby specific indentation. To do that I uncommented the following lines in the global vimrc file:

if has ("autocmd")
  filetype plugin indent on
endif

And pressed gg=G in Vim. Now it changes some of the indentation, but it still has some errors:

  • Class definitions don't get indented.
  • Comments don't get indented and remain at the star开发者_JS百科t of the lines.


Before paste from outer source, use this command

:set paste

then enter to insert mode and paste.

0

精彩评论

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