Can you have file type-specific key bindings in Vim?

后端 未结 6 1663
攒了一身酷
攒了一身酷 2020-12-04 10:54

In my .vimrc file, I have a key binding for commenting out that inserts double slashes (//) at the start of a line:

" the mappi         


        
6条回答
  •  北荒
    北荒 (楼主)
    2020-12-04 11:35

    You can use :map ... to make a local mapping just for the active buffer. This requires that your Vim was compiled with +localmap.

    So you can do something like

    autocmd FileType python map   ...
    

提交回复
热议问题