av
unread,Apr 23, 2015, 3:25:11 AM4/23/15Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to vim...@googlegroups.com
Hi,
I try to have an autocommand that would provide a mapping to the <enter> and <c-enter> keys only on a certain file name. Like myfile.txt for example.
I have tried a test like this here, and it works for the <c-Enter> mapping but not for the <Enter> one:
autocmd! BufNewFile,BufRead,BufEnter myfile.txt nmap <buffer> <Enter> :echo 'Hi!'<cr>
autocmd! BufNewFile,BufRead,BufEnter myfile.txt nmap <buffer> <c-Enter> :echo 'Test!'<cr>
And when I do :map <enter> vim says that there are "No mapping found"
Any ideas why? And please tell me if I chose the right list of events.
Thank you very much,
Alexandre