kana / vim-textobj-indent Goto Github PK
View Code? Open in Web Editor NEWVim plugin: Text objects for indented blocks of lines
Home Page: http://www.vim.org/scripts/script.php?script_id=2484
Vim plugin: Text objects for indented blocks of lines
Home Page: http://www.vim.org/scripts/script.php?script_id=2484
[A]位置にカーソルがあるときに
vaiでforブロックの中が選択されるのを期待していたのですが、
その外のインデントが選択されていまいます。
[B]位置であれば、forブロックの中が選択されます。
色々試してみたところインデントブロックの最後部が空行だと一つ外のインデントが
範囲になるように思います。
これはそういうものでしょうか?
よろしくお願いします。
#include <iostream>
int main()
{
for (auto i = 0; i != 100; ++i) {
[B] std::cout << "hello" << i << std::endl;
[A]
}
return 0;
}
Here's my input (|
is the cursor position)
group :api do
|gem 'sinatra'
gem 'slim'
end
vai
now selects
group :api do
gem 'sinatra'
gem 'slim'
That can't be right can it?
After installing vim-textobj-indent plugin under bundle/, vim began to complain
Error detected while processing /home/akira/dotfiles/.vim/bundle/vim-textobj-indent/plugin/textobj/indent.vim:
line 48:
E117: Unknown function: textobj#user#plugin
so, where is the definition of textobj#user#plugin? I couldn't find it. Isn't it implemented yet?
With the following code:
def foo():
pass
@decorator # visual select this line
def bar(): # and this line
print("some code") # and this line, cursor should be left on this line
print("some other code")
print("here we are doing real things!")
print("some more other code...")
def other_foo():
pass
So we're in visual mode, the cursor is on an indented line inside function bar
.
Now if I do ai
I'd expect to select the rest (or maybe only the inside?) of the function bar
, instead it select the whole file..
It looks like it considers the start of the visual search as the indentation to use, but I think it should take the current cursor position for this, no?
NOTE: when we're in normal mode, and the cursor is on a print in function bar
, vai
does select only the inside of the function, so that works.
As noted in the docs:
Is there any change that the behavior of extending indent level could be achieved (e.g. viii...)?
Thank you.
Holger
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.