search

Home  >  Q&A  >  body text

vim automatically executes the replacement command every time

Every time you use vim to edit a file, a command similar to :1s/^./g/ will be automatically executed to automatically replace the first word of the first line.
Press http://vim.wikia.com/wiki/Troubleshooting and it’s still the same.
This problem will not occur if you use vi.
Attached .vimrc:

syntax on
filetype indent plugin on
set encoding=utf-8
set fileencodings=utf-8,cp936,latin1
set fileformat=unix
set fileformats=unix,dos
set number
set modeline
set tabstop=8
set expandtab
set softtabstop=4
set shiftwidth=4
set backup
set backupdir=~/backup
巴扎黑巴扎黑2774 days ago622

reply all(1)I'll reply

  • 滿天的星座

    滿天的星座2017-05-16 16:40:58

    After searching for "vim 0000/0000/0000", I found that it is a bug in vim. It will be fine after upgrading.
    http://stackoverflow.com/questions/31775203/vim-in-cygwin-replaces-fir...
    Not only cygwin, Arch Linux also has the same bug.
    https://bbs.archlinux.org/viewtopic.php?id=199362

    reply
    0
  • Cancelreply