Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make use of il to cover one more useful text blocks #8

Open
pinggit opened this issue Jan 7, 2013 · 2 comments
Open

make use of il to cover one more useful text blocks #8

pinggit opened this issue Jan 7, 2013 · 2 comments

Comments

@pinggit
Copy link

pinggit commented Jan 7, 2013

hi Michael:

I've beening using vim-indent-object as an extra text-object to handle my indented text blocks
http://www.vim.org/scripts/script.php?script_id=3037

it's extremely useful in a daily base, because most of my text files are indentation-based.

however, there is one common scenario that is not (and seems should be ) covered by it:

.task 5
do this
and do that

.task 6

this is more urgent

 do this
 and do that

I know this is not a programming scenario , but I remember even in some script there is such a need to action on this kind of blocks.
currently both of the above are not covered under the text object.

and currently il is just linked to ii:

"
iI (I)nner (I)ndentation level (no lines above/below).
Note that the iI mapping is mostly included simply for completeness, it is
effectively a synonym for ii.
"

so I think it's good to make il mapping to the blocks that I mentioned above?

thanks!

regards
ping

@michaeljsmith
Copy link
Owner

Hi Ping,

It seems like Markdown has screwed up the indentation of your example, but it was clearer in your email.

I'm guessing that what you would like to happen is that when you do on the second block (ie .task 6) then it would select the entire .task 6 block?

Thanks,
Michael

@pinggit
Copy link
Author

pinggit commented Jan 10, 2013

hi Michael:
weird that your email I didn't notice..sorry.

.other tasks

  do this
  do that

.task 5
do this
and do that
.task 6
#this is more urgent
do this::
#this has to be done!
go to costco and buy ...
better before friday

  and do that::
       go to canada

so my personally usage expreriences, there are 2 things might be worth
to consider here:

  1. current indentation block + 1 LINE up
    this is non-greedy, you only refer your current indented texts plus
    one line up, which , usually is a one line title or statement about
    what the
    task is about. I guess this is a very handy for most cases.
the drawback is, what if you actually want to delete 2 lines ahead of
current indented texts?
  1. current indented block + one less indentation level up
    this is a bit greedy, you refer to current indented texts, plus
    whatever "above" them, that falls into the same upper level.
so putting your cursor at "go to costco" under task 6 and press dil 

, will delete
the 1st sub-task (do this::), which has 2 lines title, but leave
other sub-task intact.

the drawback is, if you do the same when cursor is on "do
this::" line, pressing "dil" will delete the whole upper level,
which can be the whole doc..

ideally, maybe make it user configurable?

let indent-obj-il = 0(case2)
let indent-obj-il = 1(default, case 1)
let indent-obj-il = 2

just FYI. thanks for your great work again.

On 1/8/2013 6:48 PM, Michael Smith wrote:

Hi Ping,

It seems like Markdown has screwed up the indentation of your
example, but it was clearer in your email.

I'm guessing that what you would like to happen is that when you do
on the second block (ie .task 6) then it would select the entire .task 6
block?

Thanks,
Michael


Reply to this email directly or view it on GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants