18 lines
460 B
Ruby
18 lines
460 B
Ruby
Vamp.plugin "greeting", requires: ["text"]
|
|
|
|
# @param editor [Vamp::Editor]
|
|
# @param args [String]
|
|
Vamp.command "greet" do |editor, args|
|
|
# @type [String]
|
|
name = args.empty? ? "world" : args
|
|
editor.insert "Hello, #{name}!\n"
|
|
editor.message "Greeting inserted by Ruby"
|
|
end
|
|
|
|
# @param editor [Vamp::Editor]
|
|
# @param _args [String]
|
|
Vamp.command "upper" do |editor, _args|
|
|
editor.replace editor.text.upcase
|
|
editor.message "Buffer uppercased by Ruby"
|
|
end
|