On 01/06/20 10:13 am, Gary Johnson wrote:
You wrote that you want to have <Enter> insert the date at the start
of the next line, but only in one buffer. Wouldn't making that
mapping buffer-local solve your problem? Something like this?
inoremap <buffer> <CR> <CR><C-R>=PrependTime()<CR>
function! PrependTime()
return strftime("%c")
endfunction
See
:help map-<buffer>
You would just need to execute that mapping only in the one buffer
where you wanted that behavior.
Yes, that's what I wanted. Thanks a lot. Somehow I missed this.
If other buffers are throwing error E117, then you have <Enter>
(a.k.a. <CR>) mapped in buffers where it shouldn't be mapped.
Regards,
Gary
After unmapping and remapping I checked everything works fine.
Thanks a lot everyone.
--
*Manas*
CSAM Undergraduate 2022
--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_use/c364d959-2f63-f515-5bdf-0ec6c7c671b7%40iiitd.ac.in.