Posted By

callmeblessed on 01/02/09


Tagged

vim groovy Coding ident beautify


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

lukaszkorecki


vim: code formatting


 / Published in: Groovy
 

URL: www.wysmedia.com

how to "beautify" or tidying your code using vim ?

  1. For groovy : change syntax to Java .. make sure you have ; so it becomes like java. I myself always adding ; on each line of code.
  2.  
  3. after that
  4.  
  5. ESC gg = SHIFT-G
  6.  
  7. means:
  8. 1. ESC --> back to mode
  9. 2. gg --> go to first line
  10. 3. = --> indenting
  11. 4. SHIFT G --> to end of file.
  12.  
  13. for spesific lines
  14.  
  15. ESC SHIFT V (select the lines) press =
  16.  
  17. SHIFT V = enter visual mode then you can select which lines you want to format
  18. after that pressing = will format the code

Report this snippet  

You need to login to post a comment.