I recently had to change my Linux work environment from a personal Ubuntu system (having full admin rights) to a corporate Red Hat system (having very limited control on the system). Both running GNOME.

Many things seem to work differently. Above all is the gVim behaviour. I have Vim installed on two Linux machines and one Windows machine. I like the default Windows behaviour, so I set the .gvimrc file as follows:

source $VIMRUNTIME/mswin.vim

syn on
set hls
set tabstop=4
set shiftwidth=4
set smartindent
set smarttab

Some annoying differences I experience, between Red Hat and Ubuntu or Windows are:

  1. The undo (Ctrl+Z or Undo button) is acting like in Vi, that is 2nd undo, undoes the 1st one, so the last change is removed and then restored. Instead, it should be an undo history (up to the undolevel variable setting)..

  2. When in Insert mode, deleting text with the backspace key does not remove the deleted text from the screen, until I either move away from that line or exit Insert mode.

The following variables are set similarly in Red Hat and Windows:


Question: How can I make my new Red Hat gVim environment behave like the Windows and Ubuntu one?

Vim versions:

Red Hat - 7.4 (Aug 10, 2013)
Windows - 7.4 (Aug 10, 2013)
Ubuntu - 7.2 (Aug 9, 2008)

  • American English is the preferred language on the SE sites, so the spelling changes I made were correct: grammarist.com/spelling/behavior-behaviour
    – slm
    Oct 31, 2013 at 2:28
  • @slm - not trying to be argumentative here, but I never said that your spelling was incorrect. Not being a native English speaker gives me the freedom to choose my preferred spelling style. I just happen to like some British spelling more (behaviour, colour). I guess the fact that my 1st home computer was from UK, gave me some bias here... I might be wrong but I don't remember reading an SE preference in the FAQs. Thanks for some of your corrections that I did accept :-)
    – ysap
    Oct 31, 2013 at 15:37
  • @slm - BTW, if your TRS-80 was the CoCo, then you may be familiar with the DRAGON 64.
    – ysap
    Oct 31, 2013 at 15:43
  • absolutely, never thought you were argumentative, and I was only attempting to help. I saw your comment for the edit and you sounded annoyed so I was only sharing the bit about behavior/behaviour. As the OP it's your call 8-). After researching in the meta site for SO I found a Q about behaviour and it stated it's up to the OP. Not an official FAQ but enough for me to leave well enough alone. Hopefully I didn't ruffle your feathers too much 8-)
    – slm
    Oct 31, 2013 at 17:02

1 Answer 1


Sounds like your Vim is in vi-compatible mode; :set compatible? will print compatible then.

You need to create a ~/.vimrc file (empty one will suffice) to switch Vim to nocompatible mode. In general, it's recommended to put your customizations there, and leave .gvimrc for the very few GUI-only settings.

  • Thanks, but... I listed the (what I think to be the) relevant variables in the question itself, and you can see that it is set to nocompatible.
    – ysap
    Oct 30, 2013 at 20:31
  • However (!) renaming my .gvimrc to .vimrc seems to solve the two problems!
    – ysap
    Oct 30, 2013 at 20:35
  • Any idea why? The configuration variables have the same values?!
    – ysap
    Oct 30, 2013 at 20:35
  • The order is different: .gvimrc comes last, but :set nocp should be set first, because it influences many other things. Your rename was the exact right step! Oct 30, 2013 at 20:52
  • A-ha... so nocp probably changed a few more variables that I did not list. I wish one could print out the :se all screen, so I could compare values in both cases.
    – ysap
    Oct 30, 2013 at 20:55

You must log in to answer this question.

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