首頁  >  問答  >  主體

vim每次自動執行替換指令

每次用vim編輯檔都會自動執行類似 :1s/^./g/ 的指令, 自動取代首行首字.
按 http://vim.wikia.com/wiki/Troubleshooting 過了一遍還是一樣.
用vi就不會出現此問題.
附 .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
巴扎黑巴扎黑2683 天前549

全部回覆(1)我來回復

  • 滿天的星座

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

    經搜尋"vim 0000/0000/0000", 發現是vim的一個bug, 升級後就好了.
    http://stackoverflow.com/questions/31775203/vim-in-cygwin-replaces-fir...
    不只cygwin, Arch Linux下也有相同的bug.
    https://bbs.archlinux.org/viewtopic.php?id=199362

    回覆
    0
  • 取消回覆