Friday, February 25, 2011

Create mapping with '-c' command-line option

Hello,

I'm writing a little shell function that opens vim with two files in a
split window. I'm trying to define the following mapping:

map ZZ :qa<cr>

when invoking vim, like so:

function_foo() {
vim -c "map ZZ :qa<cr>" -o file1 file2
}

However once I'm in that vim session, the '<cr>' sequence was
interpreted as four characters instead of as 'start entered command', so
my mapping is useless.

Is there something I'm missing about the way vim interprets commands
passed using the '-c' option?

--
JR

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

Post a Comment