Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Smarter ii #6

Closed
nashbridges opened this Issue · 2 comments

2 participants

Andrii Malyshko Kana Natsuno
Andrii Malyshko

Given code sample below:

>def hello
  output = "hello!"

  output.upcase
end

def bye
  "bye!"
end

when I run vii, I get

|def hello
| output = "hello!"

  output.upcase
end

def bye
  "bye!"
end

while vai gives me

|def hello
| output = "hello!"
|  
| output.upcase
|end
|
|def bye
| "bye!"
|end

I see current logic here, but with vii I'd rather have

|def hello
| output = "hello!"
|  
| output.upcase
|end

def bye
  "bye!"
end

i. e. do not give up on an empty line if the following line is more indented than current one.

Andrii Malyshko

However, this case is probably language specific and should be addressed in a separate plugin (I've found https://github.com/rhysd/vim-textobj-ruby, haven't tested it though)

Andrii Malyshko nashbridges closed this
Kana Natsuno
Owner

As you noticed, what you want to do is specific to Ruby language. While vim-textobj-indent provides generic text objects like ap, ip, and others. In this case, use other, language-specific, text objects instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.