justinmk / vim-sneak

The missing motion for Vim :athletic_shoe:
http://www.vim.org/scripts/script.php?script_id=4809
MIT License
3.24k stars 88 forks source link

feature ideas: land on second char? remove f/t completely? #288

Closed molleweide closed 2 years ago

molleweide commented 2 years ago

Hi,

Would a sneak 2 char 'until' similar to regular t make sense or work? I mean, so that one could pretty much abandon f/t all together and only use sneak 2-chars if should one like to do that. I am not sure how this would feel in practice but I am having a feeling that it could be quite nice?o

currently sneak lands on the first char in xy when searching, so in this case it would be x. But I am guessing that my suggestion would be have an option to also land on y?

This is brainstorming so I don't know if this makes super sense but I started thinking about if one could remove f/t al together..

justinmk commented 2 years ago

Would a sneak 2 char 'until' similar to regular t make sense or work?

This is possible , see :help sneak#wrap()

nnoremap <silent> t :<C-U>call sneak#wrap('',           2, 0, 0, 1)<CR>
nnoremap <silent> T :<C-U>call sneak#wrap('',           2, 1, 0, 1)<CR>
xnoremap <silent> t :<C-U>call sneak#wrap(visualmode(), 2, 0, 0, 1)<CR>
xnoremap <silent> T :<C-U>call sneak#wrap(visualmode(), 2, 1, 0, 1)<CR>
onoremap <silent> t :<C-U>call sneak#wrap(v:operator,   2, 0, 0, 1)<CR>
onoremap <silent> T :<C-U>call sneak#wrap(v:operator,   2, 1, 0, 1)<CR>