On a newly built system, opening a file in vim results in it displaying strange characters (primarily () and dm) throughout the file. This only happened with vim. It does not happen with cat, less, nano, etc. After I write or close the file, it does NOT insert these characters. They are only displayed while I am editing. Here is a portion of the /etc/profile as seen by vim: # including color. We leave out color here because not all # terminals support it. (dmif (dm[ (dm-f /etc/bash/bashrc (dm] (dm; (dmthen )dm# Bash login shells run only /etc/profile # Bash non-login shells run only /etc/bash/bashrc # Since we want to run /etc/bash/bashrc regardless, we source it # from here. It is unfortunate that there is no way to do # this *after* the user's .bash_profile runs (without putting # it in the user's dot-files), but it shouldn't make any # difference. (dm . /etc/bash/bashrc (dmelse +dmPS1=(dm'&dm\u@\h \w \$ (dm' fi else )dm# Setup a bland default prompt. Since this prompt should be useable # on color and non-color terminals, as well as shells that don't # understand sequences such as \h, don't put anything special in it. +dmPS1=(dm"*dm`whoami`&dm@*dm`uname -n (dm|*dm cut -f1 -d.`&dm *dm\$&dm (dm" fi (dm(++d++dmi Reproducible: Always Steps to Reproduce: 1. Install a new Stage 1 system 2. emerge vim 3. Open a file Actual Results: Unusual characters displayed in file. Expected Results: Characters shouldn't be displayed. When I launch with the -u NONE -U NONE, it will not display any of the strange characters in the file. However, if I add and remove a line from the end of the file, it will show them at the bottom of the screen. It happens when connected via SSH, but it does not seem to happen from the console.
The problem oddly enough was my USE flag setting. It was specifically the -* i used to deselect everything I hadn't specifically asked for. I am not sure why this caused the problem, as I haven't gone through and duplicated the flag changes that created. However, removing it and recompiling vim and all dependencies has cleared up this little issue. Is this removing some kind of hidden flag for vim, or was it one of the listed options that is now being included?
it may have been removing NLS support. It does depend on locale and terminal.
Isn't this still a bug? Perhaps I'm missing something here, but VIM is used a great deal, and the -* flag has been suggested quite often on the forums recently as a way to avoid installing new dependencies you didn't have USE flags set for. The two together are broken. Shouldn't VIM handle this flag more gracefully?
The -* is bad advice. Some of the USE flags are defaulted on purpose on some platforms, and disabled on others. Try including the ncurses or termcap-compat USE flag, and maybe it will fix your problem.
The -* seemed a little sketchy to me as well. That is why I eliminated it from my flags when I did for testing. I am not still having trouble as I removed it, and won't be adding it again. I am just putting forth the general idea of handling the -*. Though in retrospect I think that the better way of handling this is to discourage use of -*, as other packages probably do not handle this well either.