On Mi, 22 Apr 2020, Siddhartha Kasivajhula wrote:
> Esteemed Vim Monks, > I often find myself reaching for the following feature but I don't think it's > there, so I am bringing it up for consideration. > > We can (f)ind a character or move un(t)il a character, but we can't move > "after" a character. > > The feature is analogous to f F t and T, and should be linked to , (repeat > find > backwards) and ; (repeat find forwards). > > Example (cursor indicated with |): > > |string-append > > Say we'd like to change "append" to "concatenate". The options are: > > w string|-append > W string-append| > f- string|-append > t- strin|g-append > > But what we really want to do is to move after the hyphen, that is: > > ?? string-|append > > Of course, in this particular case there are other options that would work -- > since there are no 'a's in the first word, we could do fa. But that doesn't > solve the general problem, for instance, it might be: > > |data-append > > ... and then we're out of luck. > > Another possibility is Eb for this particular case. But that still falls short > of a general solution, for instance this wouldn't work for: > > |data-append-together > > Regarding what key to use for this, maybe a modifier key would be reasonable > -- > e.g. C-f doesn't seem to be bound to anything that I know of. But at least, > providing the functionality so that it is integrated with , and ; could mean > that users could map it to a convenient keybinding that works for them. > > WDYT? If you think this is reasonable, I could create a GitHub issue or > proceed > in the recommended way. Or if it already exists, then please show me the way. We are running out of keys for a new key. Also this can be mapped using some Vimscript functions. Something like this: :nnoremap <expr> gF 'f'.nr2char(getchar()).'l' Note: A real solution probably needs also an operator-pending map as well as needs to handle some edge cases correctly (as well as needs some error handling). But that can serve as a starter :) There exists also some plugins, that allow configurable navigation within a buffer, such as easymotion or similar. Mit freundlichen Grüßen Christian -- Wie man sein Kind nicht nennen sollte: Eva N. Gelium -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/20200423153635.GJ25035%40256bit.org.
