Friday, January 27, 2023

Re: change Vim search key , to .

On Fri, Jan 27, Igor Lerinc wrote:
>I want to change the Vim search key , (semicolon) to . (dot)
>
>When i need to go backward in search results, i use , (semicolon)

I assume that you are talking about , command that is used to repeat
latest f, t, F or T in opposite direction (:help ,).

>but , (semicolon) is <Leader> key in my config, so it wont work, I instead
>want it to make a key . (dot)

It's possible by providing non-recursive mappings for Normal,
Operator-pending and Visual modes

nnoremap . ,
onoremap . ,
xnoremap . ,

However, you may not want to shadow . command. It's used in normal mode
to repeat last change (:help .). For example, you can use double-tap
comma instead

nnoremap <Leader>, ,
onoremap <Leader>, ,
xnoremap <Leader>, ,

-Dmitri

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/Y9RE7qBp4PUW3Lsr%40angmar.

No comments:

Post a Comment