I has such code:
def foo
puts "foo"
end
and as result I need:
def foo
puts "foo"
end
def bar
puts "bar"
end
I would like to perform this in command mode (could you also refer some help?) but other solutions are also welcome.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
To copy / paster use type : (with you cursor on
def fooline)It will copy the 3 lines at the end of the file. use
xGwherexis a line number to go at linex. (Useset numberto see line number)Then you can change foo in bar with command :
With
xthe first line of the block, andythe last one 🙂Hoping that helps you 🙂