0

I am binding yankstack to these keys:

(note the ^[ here are the raw char typed in with ctrl+v)

set <A-D>=^[d                                      
set <A-S-D>=^[D                                    
nmap <A-D> <Plug>yankstack_substitute_older_paste  
nmap <A-S-D> <Plug>yankstack_substitute_newer_paste

The <A-S-D> is properly interpreted, but the <A-D> is not.

Curiously, if I type :set <A-D>, I get back

     <Ä>        ^[D                    

So somehow it seems vim is thinking alt+d is equivalent to something that is not being sent by my terminal when I type Alt+D.

I had to grab another of the high-F keys (the set of which i am going to run out of eventually) to get it working:

set <F26>=^[d                                      
set <A-S-D>=^[D                                    
nmap <F26> <Plug>yankstack_substitute_older_paste  
nmap <A-S-D> <Plug>yankstack_substitute_newer_paste

Anyone know what this is all about?

Steven Lu
  • 41,389
  • 58
  • 210
  • 364
  • Take a look at Ingo's answer to a similar question http://stackoverflow.com/a/16360104/1890567 – FDinoff Aug 09 '13 at 19:12
  • What happens if you call it `` instead of ``? – echristopherson Aug 09 '13 at 21:11
  • @echristopherson It show this for `:set `: `<ä> ^[d` – Steven Lu Aug 09 '13 at 21:37
  • @FDinoff The answer you linked did not provide very much in the way of answering this question but the discussion linked from that answer is quite enlightening (though sadly it has been nearly 3 years). Thanks – Steven Lu Aug 09 '13 at 21:52
  • You may want to take a look at [vim-fixkey](https://github.com/drmikehenry/vim-fixkey). In particular, some of Dr. Mike's [documentation](https://github.com/drmikehenry/vim-fixkey/blob/master/doc/fixkey.txt). It could be that poor configuration is the problem (`TERM` set wrong plus Vim trying to work around it). – John Szakmeister Aug 11 '13 at 18:37

1 Answers1

0

Note the capital D in <A-D>; Vim treats that and <A-S-D> the same. Try using a small d:

set <A-d>=^[d                                      
nmap <A-d> <Plug>yankstack_substitute_older_paste  
echristopherson
  • 6,974
  • 2
  • 21
  • 31
  • 1
    One might be inclined to assume this. But it is demonstrably false given my description. Did you even read what I wrote? the `` binding works flawlessly, and the `` binding fails no matter what terminal sequence I set it to, because Vim thinks it is the a-with-umlaut character. Also, this answer is completely wrong because i have never seen Vim treat the different variants differently. – Steven Lu Aug 11 '13 at 05:35