Tuesday, December 4, 2012

Re: execute edit command

On 12/04/12 14:28, Chris Lott wrote:
> Why does this not work?
>
> let dnfile = strftime("%Y") . ".md"
> nmap <leader>dn execute 'e ' fnameescape(dnfile)
>
> dnfile is set properly, but when I try to invoke it, it makes a change
> to the current buffer...

It looks like you need to enter Ex mode and execute the command with
<cr>:

nnnoremap <leader>dn :execute 'e '.fnameescape(dnfile)<cr>

I don't know whether vim needs the fnameescape() in this context,
but I don't think it does anything given the content you put in it.

-tim


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