Vi and Vim Stack Exchange is a question and answer site for people using the vi and Vim families of text editors. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to make some modification to the code of this plugin.

It adds / changes some default keybindings. Among them are <C-b> and <C-f> which move the cursor one character to the left / right.

The problem is they break the undo sequence, because they are mapped to <Left> and <Right>. The solution is to prefix them with <C-g>U.

However, I don't know in which version and which patch <C-g>U appeared in Vim.

I tried :helpgrep CTRL-G.*U which gave me 5 results in the quickfix list, but none of them gave me the info.

So I have 2 questions:

  • How can I find precisely when <C-g>U appeared in Vim?
  • How can I reliably test in a script if vim supports it?

Let's say I find out that <C-g>U appeared in Vim 7.4.567, would the following line be the proper way to test?:

if v:version > 704 || v:version == 704 && has("patch567")
share|improve this question
2  
I use if (v:version == 704 && has("patch393")) || v:version > 704 with set renderoptions and seems to work pretty well. – VanLaser Jan 6 at 20:55
1  
For the 1st issue, i used Google :D groups.google.com/forum/#!topic/vim_dev/uZbngIYTl5M – VanLaser Jan 6 at 20:57
1  
Thank you very much! So I just need to find out when <C-g>U was added... – saginaw Jan 6 at 20:58
1  
Ah ok so it was in patch 849, thank you very much again. If you post it as an answer I'll accept it. Could you briefly explain how you found it on vim_dev ? I'm not used to this site. – saginaw Jan 6 at 21:00
1  
romainl's answer is ok - i just used quoted text from the relevant vim's help section to search on google. – VanLaser Jan 6 at 21:02
up vote 2 down vote accepted

You can find all the patches on Vim's FTP server. <C-g>U was added in patch 7.4.849.

share|improve this answer

I simply use has('patch-7.4.849') in lh-brackets. This is enough.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.