Sunday, January 20, 2013

Passing Ctrl-Y and Ctrl-E as function argument.

Hi,

In my .vimrc, I have function to have smooth scrolling to replace Ctrl-U
and Ctrl-D (otherwise I loose context). The implementation I took from
the net was using an integer for the direction, something like

if a:up
let action="\<C-Y>"
el
let action="\<C-E>"
en

which was working great. But instead of passing 0 or 1 for the function
up value, I tried to modify the function to pass the action directly. I
then change the mapping to:

no <C-U> :call SmoothScroll("\<C-Y>")<CR>
no <C-D> :call SmoothScroll("\<C-E>")<CR>

While this works for C-U, hitting C-D returns the following error:

E114: Missing quote: "\")
E116: Invalid arguments for function SmoothScroll

I am not sure why I get this error, nor how to fix it. I also tried many
variations for writing Ctrl-E without success.

Any help would be greatly appreciated.
Thank you,
Ben.

--
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

No comments: