Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> Linux 系統教學 >> Linux 教學

Vim 區塊縮排與全域替換指令速查

編輯:Linux 教學

多行縮排

  1. 按 Esc 進入一般模式
  2. 按 Shift+V 進入 Visual Line 模式
  3. 用 j/k 選取範圍
  4. 按 > 增加縮排、< 減少縮排

全域替換

:%s/搜尋字串/替換字串/g          # 全檔替換所有匹配
:%s/搜尋字串/替換字串/gc         # 每次替換前確認 (c)
:%s/搜尋字串/替換字串/gi         # 忽略大小寫 (i)
:%s/搜尋字串/替換字串/gci        # 可組合使用
Copyright © Windows教程網 All Rights Reserved