Am 01.11.2011 17:17, schrieb Joachim Hofmann:
Hello,
I want to set a mapping, only when a certain (Ruby-)-Filetype event appears.
I got a script where the mapping is defined, the mapping is created, and it
works.
But I don't want this mapping to be defined when vim is in diff-mode.
In my versioning system I start vim for viewing diffs with
gview -d "%1" "%2"
Problem: It seems that when the filetype is set, the diff mode is not set yet
so asking in my filetype fired script:
if &diff
map x y
...
does not solve the task, because &diff is 0 and is set to 1 later.
How/where can I solve this condition-dependent mapping?
Thank You
Joachim
Example orig mapping:
:nmap <buffer> X <Plug>DoY
Same mapping prepared for diff-mode:
:nmap <buffer><expr> X !&diff ? "<Plug>DoY" : ""
:h :map-<expr>
--
Andy
--
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