开发者

How can I map ":vsplit ." to <F7> in Vim?

开发者 https://www.devze.com 2022-12-11 12:25 出处:网络
I\'d like to create 开发者_开发问答a mapping for :vsplit .. I tried adding this to .vimrc... nmap <F7> verticalsplit .

I'd like to create 开发者_开发问答a mapping for :vsplit ..

I tried adding this to .vimrc...

nmap <F7> verticalsplit .

However, when I hit <F7> it goes into insert mode and inserts "calsplit .tttt". (Why "tttt"?)


Just put a : before it and a <CR> after.

nmap <F7> :vsplit .<CR>

nmap starts in normal mode so you have to give it exactly what you'd type.

You get "tttt" because your mapping was typing v (to go into Visual mode), e (jump to the end of a word), r (go into replace-mode), t (type a t and replace whatever is visually selected with ts).

0

精彩评论

暂无评论...
验证码 换一张
取 消