change Vim search key , to .

20 views
Skip to first unread message

Igor Lerinc

unread,
Jan 27, 2023, 3:25:17 PM1/27/23
to vim...@googlegroups.com
I want to change the Vim search key , (semicolon) to . (dot)

When i need to go backward in search results, i use , (semicolon)

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





Dmitri Vereshchagin

unread,
Jan 27, 2023, 4:41:14 PM1/27/23
to vim...@googlegroups.com
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
Reply all
Reply to author
Forward
0 new messages