第七章 Editing more than one file

usr_07 Editing more than one file

07.1 Edit another file
:edit foo.txt
07.2 A list of files
vim one.c two.c three.c
:next
:wnext

WHERE AM I?

        :args

MOVING TO OTHER ARGUMENTS

        :previous
        :wprevious
        :last
        :first
        :2next

AUTOMATIC WRITING

        :set autowrite

EDITING ANOTHER LIST OF FILES

        :args five.c six.c seven.h
        :args *.txt

DID YOU EDIT THE LAST FILE?

07.3 Jumping from file to file
ctrl-^

PREDEFINED MARKS

`"

回到过去

`.

回到改变的过去
FILE MARKS

mx
`x
50%mF
GmB
        :marks M
        :marks MCP
07.4 Backup files
        :set backup
        :set backupext=.bak

KEEPING THE ORIGINAL FILE

        :set patchmode=.orig
07.5 Copy text between files
        :edit thisfile
        /This
        vjjjj$y
        :edit otherfile
        /There
        p

USING REGISTERS
A register is a place where Vim stores text.

        "fyas
        "l3Y
        CTRL-Vjjww"by
        "fp
        "wdaw

APPENDING TO A FILE

        :write >> logfile
07.6 Viewing a file

To start Vim in readonly mode, use this command: >

vim -R file
view file
vim -M file
:set modifiable
:set write
07.7 Changing the file name
        :edit copy.c
        :saveas move.c
        :file move.c
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值