vim: code formatting


/ Published in: Groovy
Save to your folder(s)

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


Copy this code and paste it in your HTML
  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

URL: www.wysmedia.com

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.