Reputation: 441
I would like to map "Control-Space" for two plugins I am using for neovim:
Plug 'gaalcaras/ncm-R' (for r files)
Plug 'bfredl/nvim-ipy' (for python files)
In order to achieve this for normal mode, I have tried:
autocmd FileType r nmap <C-Space> <Plug>RDSendLine
autocmd FileType python nmap <C-Space> <Plug>(IPy-Run)
Howevver, the second mapping always overwirtes the first one (for all buffers, all file types). Obviously I cannot get this to work in a file type dependent way.
Upvotes: 0
Views: 421
Reputation: 15081
You should use buffer-specific mappings:
autocmd FileType r nmap <buffer><C-Space> <Plug>(RDSendLine)
autocmd FileType python nmap <buffer><C-Space> <Plug>(IPy-Run)
Upvotes: 2