When I repeat change operations in Vim, spaces and periods are replaced ASCII character 172 (¬).

For example:

  1. In command mode I move to the word "year" and type cw and then "yr." to change the word "year" to "yr."
  2. I hit Escape, navigate to another part of the file, and attempt to replace another instance of "year" with "yr." by typing . (period) to repeat the last command.
  3. yr¬ is inserted instead.

This behavior doesn't happen if I use macros instead of . to repeat the command. For example, if I type qr before cwyr. and q after (to store the operation in register r as a macro) and then I use @r to repeat the operation, yr. is inserted properly.

I've only seen this problem on my Ubuntu machine running Ubuntu 10.04. It is a problem in both Vim and gVim and modifying or removing my .vimrc file has not fixed the problem so far.

Any idea what's going on here or how to fix this? I upgraded Vim to version 7.3 recently and I'm still having the same issue.

1 Answer 1


I can only offer some suggestions:

  1. Move/remove your system vimrc (type :version see its location)
  2. Move/remove your ~/.viminfo file
  3. Move your ~/.vim directory aside temporarily
  4. Check your $TERM environmental variable and make sure it is correct
  5. What encoding are you using on your system? What encoding does Vim show (:verbose set encoding? and :verbose set fileencoding? — with the question marks)
  • Thanks for the help. Your advice led me to find out that using set cpoptions+=< fixed the issue. I'm not entirely sure why this fixed the issue. Dec 31, 2011 at 7:54
  • This sounds like a Vim bug. What version of Vim are you running? (7.3.390 is the latest.)
    – Heptite
    Dec 31, 2011 at 18:58
  • Currently using vim 7.3, but I believe I had this problem in vim 7.2 as well. It could be a configuration issue with my specific machine. Dec 31, 2011 at 21:26
  • 1
    The output of ":version" should have an "Included patches: [...]" line that will tell you what patch level you are on. The reason I'm asking is that I keep very up to date (I compile my own Vim) and I cannot reproduce this problem, with or without "<" in 'cpoptions'.
    – Heptite
    Jan 1, 2012 at 4:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .