s40723210 cd2020

  • Home
    • Site Map
    • reveal
    • blog
  • Weeks
    • Week1-5
      • OBS Streaming
    • Week6-9
      • Article impression
    • Week10-14
      • SSH setting
    • Week15-18
    • Weeks Meeting
  • 期末報告
  • Notes
    • Linux 指令
    • vi 與 vim 的指令整理
    • Q&A
  • Assignments
    • assignment1
      • Random grouping
      • Portable system
      • Four wheel car
    • assignment2
      • DigitalProductCollaboration
      • EngineeringProductDesign
      • MechanicalDesignProcess
      • Keyboard control car
    • assignment3
      • MSModelingAndTFApproaches
      • MechatronicDesignCases
      • MechaFutureAndChallenges
      • MechaEducFutureNeed
    • Final project
      • Car gripper Implement
  • CoppeliaSim
    • BubbleRob tutorial
    • Line following BubbleRob
    • External controller tutorial
    • Simulation
    • Simulation dialog
  • Webots Tutorial
    • User Interface
    • Scene Tree
Linux 指令 << Previous Next >> Q&A

vi 與 vim 的指令整理

編輯模式

指令 說明
i 在游標位置進入編輯模式
I 在游標行的第一個非空白字元進入編輯模式
a 在游標位置後進入編輯模式
A 在游標行的最後一個字元進入編輯模式
o 向下新增一行,並進入編輯模式
O 向上新增一行,並進入編輯模式
cc 刪除游標行,並進入編輯模式
h 或 向左方向鍵 游標向左移動一個字元
j 或 向下方向鍵 游標向下移動一個字元
k 或 向上方向鍵 游標向上移動一個字元
l 或 向右方向鍵 游標向右移動一個字元
[ESC] 取消指令或退出編輯模式

刪除

指令 說明
dd 刪除游標行
行數 → dd 刪除 n 行
dG 刪除游標行到最後一行
d1G 刪除游標行到第一行
d$ 刪除游標處到最後一個字元
d0 刪除游標處到第一個字元

檔案功能

指令 說明
:w 存檔 (加 ! 表示強制存檔)
:w 檔案名稱 另存新檔
:q 退出 vi (加 ! 表示不存檔強制退出)
:wq 存檔並退出 vi
:x 存檔並退出 vi
:e 檔案名稱 編輯其它檔案
:e! 還原至檔案編修前的狀態
:r 檔案名稱 讀入檔案內容,並加到游標行的後面
:n 切換到下一個開啟的檔案
:N 切換到上一個開啟的檔案
:set nu 顯示行號
:set nonu 取消行號顯示
:files 列出所有開啟的檔案
:Ex 開啟檔案瀏覽器
:Ex 路徑 於指定路徑開啟檔案瀏覽器

Linux 指令 << Previous Next >> Q&A

Copyright © All rights reserved | This template is made with by Colorlib