# vim 操作紀錄 ## 命令 ctrl-d(down):1/2 頁向下 ctrl-u(up):1/2 頁向上 ctrl-f(forward): 1 頁向下 ctrl-b(back): 1 頁向上 gj,gk:move up no mattter it's the whole setence :qa!:關閉所以window的內容並且不儲存 ## 字串搜尋 計數符合表示式格式的字串的數量 <span style="background:gray">:%s/pattern//n</span>:搜尋包含符合表示式格式字串的行數 <span style="background:gray">:%s/pattern//ng</span>:搜尋包含符合表示式格式字串的數量(g:means <span style="color:red">global</span>) ## 使用標記(mark)在檔案內或檔案之間跳躍 小寫的mark(a to z)只能在同一個buffer內跳躍;大寫的mark(A to Z)可以在不同buffer之間跳躍。 <span style="background:gray">標記標籤</span> ```bash ma(mark a) mA(mark A) ``` **展示目前有紀錄的marks:** <span style="background:gray">標記間跳躍</span> ``` 'a "跳到同一個buffer中標籤a的那一行 'A "跳到任何buffer中標籤a的那一行 `a "跳到同一個buffer中標籤a的那一個位置 `A "跳到任何buffer中標籤a的那一個位置 ``` ## 展示所有的標記 ```bash= :marks ``` ## 設定前導字元 ## 展示buffer中所有的字元 使用 **:set list**顯示隱藏的字元(換行、tab...等) ## 跳到指定的位置座標 使用:cal cursor(row number, column number) ###### tags: `vim`
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up