When I open a file, eg vim .bashrc
, vim opens the file and change the first letter to g
. What I see is the following:
g To the extent possible under law, the author(s) have dedicated all
# copyright and related and neighboring rights to this software to the
...
I change g
back to #
, but after loading the file its again changed. Happens with multiple files.
Last things I have done was: installig gcc
and make
.
Why is this happening?
EDIT: My .vimrc file:
set nocompatible
set backspace=indent,eol,start
set number
set tabstop=4
syntax on
In vim's normal mode, the g prefix is used for a number of commands. Some commands go somewhere in the document, but other commands deal with file encodings and swapping upper/lower case letters. ga - show character encoding.
Type "gg" in command mode. This brings the cursor to the first line.
It's time to open up the command mode of Vim by pressing the “:” key. Now, press the “w” key from the keyword followed by the space key and the new name of a file. Tap “Enter” to execute this command on Vim. Now, the exact copy of the same file has been created in the home folder with a new filename.
Press ^ to move the cursor to the start of the current line. Press $ to move the cursor to the end of the current line.
I had the exact same problem
I found out it was a bug in my ssh client (mobaXterm).
Updating (to mobaXterm 'personal edition v9.1') resolved the issue.
I am using vim on Ubuntu Linux 16.04 via MobaXterm version 7.7. This is an older version of MobaXterm that supports command-line-settable terminal background colors.
The following change to my .bash_profile solved this problem for me:
# Fix for Vim 8.0 bug that stomps on line 1 char 1:
export TERM=linux
Strange enough, but it works for me. I created a ~/.vimrc file:
syntax on
set background=dark
The 2nd option disable the bug.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With