Use Vim
来源:互联网 发布:scrollreveal.js实例 编辑:程序博客网 时间:2024/05/17 03:23
From: http://tldp.org/LDP/intro-linux/html/sect_06_02.html
In UNIX and MS Windows, if Vim has been properly installed, you can start this program from the shell or command line, entering the vimtutor command. This will make a copy of the tutor file, so that you can edit it without the risk of damaging the original. There are a few translated versions of the tutor. To find out if yours is available, use the two-letter language code. For French this would be vimtutor fr (if installed on the system).
キー 動作 uundo(アンドゥ)一動作分、前の状態に戻す。Ctrl + rredo(リドゥ)。アンドゥで戻した操作を、元に戻す。
6.2.2. Basic commands
6.2.2.1. Moving through the text
Moving through the text is usually possible with the arrow keys. If not, try:- h to move the cursor to the left
- l to move it to the right
- k to move up
- j to move down
6.2.2.2. Basic operations
These are some popular vi commands:- 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 newfile.
- :wq! overrides read-only permission (if you have the permission to override permissions, for instance when you are using the root account.
- /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 will replace word with anotherword throughout the file.
- yy will copy a block of text.
- n p will paste it n times.
- :recover will recover a file after an unexpected interruption.
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 will insert
- o will insert a blank line under the current cursor position and move the cursor to that line.
6.2.3. The easy way
Instead of reading the text, which is quite boring, you can use the vimtutor to learn you first Vim commands. This is a thirty minute tutorial that teaches the most basic Vimfunctionality in eight easy exercises. While you can't learn everything about vim in just half an hour, the tutor is designed to describe enough of the commands that you will be able to easily use Vim as an all-purpose editor.In UNIX and MS Windows, if Vim has been properly installed, you can start this program from the shell or command line, entering the vimtutor command. This will make a copy of the tutor file, so that you can edit it without the risk of damaging the original. There are a few translated versions of the tutor. To find out if yours is available, use the two-letter language code. For French this would be vimtutor fr (if installed on the system).
- vim-use
- Use Vim
- Use Vim
- use vim effectively
- use cscope in vim
- How to use VIM?
- Use snippets in vim
- Linux:vim basic use
- use vim like a pro
- 【skill】Use snippets in vim
- How to use Vim like an IDE
- use python in vim script of ~/.vimrc
- How to use Terminal in Vim
- How to use marks in Vim
- Use zsh term within vim mode
- play of vim Save and use vim sessions
- use VIM to clear TcxButton.Glyph inside delphi form (dfm)
- an error I encounter today when I use vim
- c# 对字符串加密解密
- CSDN博客积分规则
- 外省人
- 11g RAC环境下客户端配置TAF
- 手机联系人的相关操作,删除,插入,更新
- Use Vim
- 以太网网络变压器和中心抽头的作用
- poj 1258 prim lightblueme
- 加密工具
- 内存与链表
- 腾讯MIG刘成敏告别邮件:两年前就有退休的想法
- How To Show Line Numbers In vi / vim Text Editor
- Nginx正向代理
- poj3044