2017-09-22 11 views
2

では動作しません。私はvimの8.0.1097とvimの7.4上で同一のvimを設定しているが、オートインデントの挙動が異なります:vimの8でVimのオートインデントが8.0.1097

を:

if [ "$u" != "root" ] 
    then 
     a 
     b 
     c 
     fi 

とのVimで7それはうまく動作します。

Vimの8 :setショー:

--- Options --- 
    autoindent   commentstring=#%s hidden    incsearch   matchtime=2   scrolloff=7   smartcase   tabstop=4   ttymouse=xterm  t_vb= 
    background=dark  expandtab   history=700   laststatus=2  modified   shiftwidth=4  smarttab   textwidth=79  viminfo=%,'20,"50 
    cindent    filetype=sh   hlsearch   lazyredraw   ruler    showmatch   noswapfile   timeoutlen=500  wildmenu 
    cmdheight=2   helplang=en   ignorecase   linebreak   scroll=31   showtabline=2  syntax=sh   ttyfast   nowritebackup 
    backspace=eol,start,indent 
    completeopt=menuone,longest,preview 
    fileencoding=utf-8 
    fileencodings=ucs-bom,utf-8,latin1 
    fileformats=unix,dos,mac 
    grepprg=grep -nH $* 
    guicursor=n-v-c:block,o:hor50,i-ci:hor15,r-cr:hor30,sm:block,a:blinkon0 
    indentexpr=GetShIndent() 
    indentkeys=0{,0},!^F,o,O,e,0=then,0=do,0=else,0=elif,0=fi,0=esac,0=done,0=end,),0=;;,0=;&,0=fin,0=fil,0=fip,0=fir,0=fix 
    runtimepath=~/.vim,~/.vim/bundle/ctrlp,~/.vim/bundle/indentLine,~/.vim/bundle/javacomplete,~/.vim/bundle/jedi-vim,~/.vim/bundle/nerdcommenter,~/.vim/bundle/nerdtree,~/.vim/bundle/supertab,~/.vim/bundle/syntastic,~/.vim/bundle/vim-fugit 
ive,~/.vim/bundle/vim-repeat,~/.vim/bundle/vim-surround,~/.vim/bundle/vim-tmux-navigator,~/.vim/bundle/vim-trailing-whitespace,/usr/share/vim/vimfiles,/usr/share/vim/vim80,/usr/share/vim/vimfiles/after,~/.vim/bundle/jedi-vim/after,~/.vim 
/bundle/indentLine/after,~/.vim/after 
    statusline= %{HasPaste()}%F%m%r%h %w CWD: %r%{getcwd()}%h Line: %l Column: %c 
    switchbuf=useopen,usetab,newtab 
    whichwrap=b,s,<,>,h,l 
    wildignore=*.o,*~,*.pyc 

そしてVIM 7.4 :setショー:

--- Options --- 
    autoindent   commentstring=#%s filetype=sh   hlsearch   lazyredraw   scroll=31   showtabline=2  syntax=sh   ttyfast   nowritebackup 
    background=dark  cscopetag   helplang=en   ignorecase   linebreak   scrolloff=7   smartcase   tabstop=4   ttymouse=xterm  t_vb= 
    cindent    cscopeverbose  hidden    incsearch   matchtime=2   shiftwidth=4  smarttab   textwidth=79  viminfo=%,'20,"50 
    cmdheight=2   expandtab   history=700   laststatus=2  ruler    showmatch   noswapfile   timeoutlen=500  wildmenu 
    backspace=eol,start,indent 
    completeopt=menuone,longest,preview 
    cscopeprg=/usr/bin/cscope 
    fileencoding=utf-8 
    fileencodings=ucs-bom,utf-8,latin1 
    fileformats=unix,dos,mac 
    grepprg=grep -nH $* 
    guicursor=n-v-c:block,o:hor50,i-ci:hor15,r-cr:hor30,sm:block,a:blinkon0 
    indentexpr=GetShIndent() 
    indentkeys=0{,0},!^F,o,O,e,0=then,0=do,0=else,0=elif,0=fi,0=esac,0=done,),0=;;,0=;&,0=fin,0=fil,0=fip,0=fir,0=fix 
    [email protected],48-57,_,192-255,. 
    runtimepath=~/.vim,~/.vim/bundle/ctrlp,~/.vim/bundle/indentLine,~/.vim/bundle/javacomplete,~/.vim/bundle/jedi-vim,~/.vim/bundle/nerdcommenter,~/.vim/bundle/nerdtree,~/.vim/bundle/supertab,~/.vim/bundle/syntastic,~/.vim/bundle/vim-fugit 
ive,~/.vim/bundle/vim-repeat,~/.vim/bundle/vim-surround,~/.vim/bundle/vim-tmux-navigator,~/.vim/bundle/vim-trailing-whitespace,/usr/share/vim/vimfiles,/usr/share/vim/vim74,/usr/share/vim/vimfiles/after,~/.vim/bundle/jedi-vim/after,~/.vim 
/bundle/indentLine/after,~/.vim/after 
    statusline= %{HasPaste()}%F%m%r%h %w CWD: %r%{getcwd()}%h Line: %l Column: %c 
    switchbuf=useopen,usetab,newtab 
    whichwrap=b,s,<,>,h,l 
    wildignore=*.o,*~,*.pyc 

違いは以下のとおりです。

 --- Options --- 
-  autoindent   commentstring=#%s hidden    incsearch   matchtime=2   scrolloff=7   smartcase   tabstop=4   ttymouse=xterm  t_vb= 
-  background=dark  expandtab   history=700   laststatus=2  modified   shiftwidth=4  smarttab   textwidth=79  viminfo=%,'20,"50 
-  cindent    filetype=sh   hlsearch   lazyredraw   ruler    showmatch   noswapfile   timeoutlen=500  wildmenu 
-  cmdheight=2   helplang=en   ignorecase   linebreak   scroll=31   showtabline=2  syntax=sh   ttyfast   nowritebackup 
+  autoindent   commentstring=#%s filetype=sh   hlsearch   lazyredraw   scroll=31   showtabline=2  syntax=sh   ttyfast   nowritebackup 
+  background=dark  cscopetag   helplang=en   ignorecase   linebreak   scrolloff=7   smartcase   tabstop=4   ttymouse=xterm  t_vb= 
+  cindent    cscopeverbose  hidden    incsearch   matchtime=2   shiftwidth=4  smarttab   textwidth=79  viminfo=%,'20,"50 
+  cmdheight=2   expandtab   history=700   laststatus=2  ruler    showmatch   noswapfile   timeoutlen=500  wildmenu 
     backspace=eol,start,indent 
     completeopt=menuone,longest,preview 
+  cscopeprg=/usr/bin/cscope 
     fileencoding=utf-8 
     fileencodings=ucs-bom,utf-8,latin1 
     fileformats=unix,dos,mac 
     grepprg=grep -nH $* 
     guicursor=n-v-c:block,o:hor50,i-ci:hor15,r-cr:hor30,sm:block,a:blinkon0 
     indentexpr=GetShIndent() 
-  indentkeys=0{,0},!^F,o,O,e,0=then,0=do,0=else,0=elif,0=fi,0=esac,0=done,0=end,),0=;;,0=;&,0=fin,0=fil,0=fip,0=fir,0=fix 
+  indentkeys=0{,0},!^F,o,O,e,0=then,0=do,0=else,0=elif,0=fi,0=esac,0=done,),0=;;,0=;&,0=fin,0=fil,0=fip,0=fir,0=fix 
+  [email protected],48-57,_,192-255,. 
     runtimepath=~/.vim,~/.vim/bundle/ctrlp,~/.vim/bundle/indentLine,~/.vim/bundle/javacomplete,~/.vim/bundle/jedi-vim,~/.vim/bundle/nerdcommenter,~/.vim/bundle/nerdtree,~/.vim/bundle/supertab,~/.vim/bundle/syntastic,~/.vim/bundle/vim-fugit 
- ive,~/.vim/bundle/vim-repeat,~/.vim/bundle/vim-surround,~/.vim/bundle/vim-tmux-navigator,~/.vim/bundle/vim-trailing-whitespace,/usr/share/vim/vimfiles,/usr/share/vim/vim80,/usr/share/vim/vimfiles/after,~/.vim/bundle/jedi-vim/after,~/.vim 
+ ive,~/.vim/bundle/vim-repeat,~/.vim/bundle/vim-surround,~/.vim/bundle/vim-tmux-navigator,~/.vim/bundle/vim-trailing-whitespace,/usr/share/vim/vimfiles,/usr/share/vim/vim74,/usr/share/vim/vimfiles/after,~/.vim/bundle/jedi-vim/after,~/.vim 
    /bundle/indentLine/after,~/.vim/after 
     statusline= %{HasPaste()}%F%m%r%h %w CWD: %r%{getcwd()}%h Line: %l Column: %c 
     switchbuf=useopen,usetab,newtab 

トップ4の違いは、単に別の順序で実際にあります項目の数は同じです。手動でcscopeprgを設定して、vim 7.4の値と一致させようとしましたが、違いはありません。

私のvim設定がこのような動作を引き起こす原因がわかりません。私のプラグインの

一覧(最新): ctrlp indentLine javacomplete jedi-vim nerdcommenter nerdtree supertab syntastic vim-fugitive vim-repeat vim-surround vim-tmux-navigator vim-trailing-whitespace

私も自分のプラグインやvimの8のすべてがまだ故障して削除しようとしました。

ダウングレードメソッドを使用して、vimを8.0.662と8.0.1030に再インストールしました。入力中の字下げは完全に機能します。私はvimの新しいバージョンにバグがあると思います。

+0

入力するとき、またはすべてを選択して「=」を押すときを意味しますか?または両方? –

+0

'='は動作しますが、これは入力時にのみ発生します。 – Luxing

+0

':filetype'は両方のバージョンでvimを提供していますか? – dlmeetei

答えて

0

この動作は、実際にはバージョン8.0.1041で導入されたVimのbugが原因で、バージョン8.0.1154に修正されています。アップストリームから最新のバージョンにアップグレードすることでこれを解決できるはずです。