Когда я форматирую файл PHP в vim, это нормально, но когда я форматирую файл Ruby, код формата VIM плохой.
Например:
class PostsController < ApplicationController
skip_before_filter :authorize, :only => [ :index, :show ]
def index
@posts = Post.all
end
def show
@post = Post.find(:first, :conditions => [ "id = ?", params[:id]], :include => [ :user, :category, :gallery ])
@photos = Photo.where(:gallery_id => @post.gallery.id).all
end
end
Когда я ввожу команду gg = G , я получаю.
class PostsController < ApplicationController
skip_before_filter :authorize, :only => [ :index, :show ]
def index
@posts = Post.all
end
def show
@post = Post.find(:first, :conditions => [ "id = ?", params[:id]], :include => [ :user, :category, :gallery ])
@photos = Photo.where(:gallery_id => @post.gallery.id).all
end
end
Пожалуйста, помогите мне.