OnWorks Linux và Windows Online WorkStations

Logo

Lưu trữ trực tuyến miễn phí cho máy trạm

<Trước | Nội dung | Tiếp theo>

hình ảnhPhát âm

It's pronounced "vee-eye".


hình ảnh

6.2.2. Các lệnh cơ bản


6.2.2.1. Moving through the text


Di chuyển qua văn bản thường có thể với các phím mũi tên. Nếu không, hãy thử:


h để di chuyển con trỏ sang trái

l to move it to the right

k to move up

j to move down


SHIFT-G will put the prompt at the end of the document.


hình ảnh

6.2.2.2. Các thao tác cơ bản


These are some popular vi lệnh:


n dd will delete n lines starting from the current cursor position.

n dw will delete n words at the right side of the cursor.

x will delete the character on which the cursor is positioned

:n moves to line n of the file.

:w will save (write) the file

:q will exit the editor.

Q! forces the exit when you want to quit a file containing unsaved changes.

: wq will save and exit

:w newfile will save the text to tập tin mới.

: wq! overrides read-only permission (if you have the permission to override permissions, for instance when you are using the nguồn gốc tài khoản.

/astring will search the string in the file and position the cursor on the first match below its position.

/ will perform the same search again, moving the cursor to the next match.

:1, $s/word/anotherword/g sẽ thay thế lại lời với anotherword throughout the file.

yy will copy a block of text.

np will paste it n times.

:hồi phục will recover a file after an unexpected interruption.


hình ảnh

6.2.2.3. Commands that switch the editor to insert mode


a will append: it moves the cursor one position to the right before switching to insert mode

i sẽ chèn

o will insert a blank line under the current cursor position and move the cursor to that line.


Điện toán đám mây hệ điều hành hàng đầu tại OnWorks: