# cat ~/.vimrc
autocmd FileType yaml setlocal ai ts=2 sw=2 et
# source ~/.vimrc
autocmd FileType yaml setlocal ts=2 sw=2 et則相當於下面這樣的參數:
ai = auto indent,自動退格對齊
set tabstop=2(ts=tabstop,即一個tab的寬度被設為2個空格辣麼寬)
set shiftwidth=2(sw=shiftwidth,即退格對齊以2個空格為準)
set expandtab(et=expandtab,將tab變成空格)
autocmd FileType yaml setlocal ts=2 sw=2 et則相當於下面這樣的參數:
ai = auto indent,自動退格對齊
set tabstop=2(ts=tabstop,即一個tab的寬度被設為2個空格辣麼寬)
set shiftwidth=2(sw=shiftwidth,即退格對齊以2個空格為準)
set expandtab(et=expandtab,將tab變成空格)
Comments