Tuesday, May 31, 2011

Re: collision

thanks for your comments. It's helpful.

This issue came from view setting in my vimrc
set viewoptions=folds,options,cursor,unix,slash
set viewdir=~/.vim/view
au BufWinLeave * silent! mkview
au BufWinEnter * silent! loadview

This issue disappeared once I rm ~/.vim/view/*, re-edit markdown file.

Thanks again.

Regards,
Steven.l

2011/5/31 ZyX <zyx.vim@gmail.com>:
> Reply to message «<leader> collision»,
> sent 18:12:20 31 May 2011, Tuesday
> by Steven Lee:
>
>> In my .vimrc,  I attempt to map ",,d" to a function call, see below:
>>
>> autocmd FileType markdown nmap <silent> ,,d :call <Sid>InsertMkdDate()<CR>
>>
>> But press ",,d", prompt E81: Using <SID> not in a script conext
> I cannot reproduce this, either with or without altering the mapleader.
>
> I can expect this error when markdown filetype is set, but not when you press
> ,,d. Does this function work when you call it manually using
>    :call <SNR>{sid}_InsertMkdDate()
> ? You can get {sid} value in the output of `scriptnames', if it is your only
> vimrc it will be 1, but if system vimrc is sourced before your it may be greater
> (I have 29, 1 for /etc/vimrc).
>
> And use nnoremap, not nmap.
>
>>
>> The issue might come from mapleader setting, it's let mapleader=',' in
>> my .vimrc.
> I do not see how can this be related. Try `verbose nmap ,,d` and see whether
> your mapping was defined and not overriden by some script. In any case, when you
> complain about problems, create a script that will show the problem that should
> work with `vim -u NONE'. If it is not a vim bug, then in most cases you will
> solve your problem while creating it.
>
> Original message:
>> Hi all,
>>
>> In my .vimrc,  I attempt to map ",,d" to a function call, see below:
>>
>> autocmd FileType markdown nmap <silent> ,,d :call <Sid>InsertMkdDate()<CR>
>>
>> But press ",,d", prompt E81: Using <SID> not in a script conext
>>
>> The issue might come from mapleader setting, it's let mapleader=',' in
>> my .vimrc.
>> Is there any way to resove this issue if I stick to let mapleader=','
>> and ,,d to call function?
>>
>> Thanks,
>> Steven.l
>

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