tags:

views:

32

answers:

1

My .vimrc file has filetype mappings for different filetypes such as :

autocmd FileType sh map gf ... autocmd FileType ruby map gf ...

While rewriting a program from one language to another, I have 2 splits, one with a shell script and one with ruby. I would assume that "gf" would take on its mapping based on filetype. However, it can only hold one mapping at a time.

Is there any way to declare a mapping only for the existing file/window. I tried ":windo" and ":bufdo" but they work for all windows or buffers.

+1  A: 

Your mapping hasn't been declared buffer local as it should have. :h :map-<buffer>

Luc Hermitte
Thanks. It worked great. :help map-local gives an example. :map <buffer> ,w /[.,;]<CR>
rahul