# Vimhelp: User Manual -- Chapter 07: Editing more than one file # Copyright (C) 2006 Bram Moolenaar. # Florian »eix« Rehnisch , 2008. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: vimhelp 7.0.122\n" "POT-Creation-Date: 2008-02-18 0:59+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf8\n" "Content-Transfer-Encoding: 8bit" # type: Plain text #: usr_07.txt:2 #, no-wrap msgid "*usr_07.txt*\tFor Vim version 7.0. Last change: 2006 Apr 24\n" msgstr "" # type: Plain text #: usr_07.txt:4 #, no-wrap msgid "\t\t VIM USER MANUAL - by Bram Moolenaar\n" msgstr "" # type: Plain text #: usr_07.txt:6 #, no-wrap msgid "\t\t\t Editing more than one file\n" msgstr "" # type: Plain text #: usr_07.txt:11 msgid "" "No matter how many files you have, you can edit them without leaving Vim. " "Define a list of files to work on and jump from one to the other. Copy text " "from one file and put it in another one." msgstr "" # type: Plain text #: usr_07.txt:19 msgid "" "|07.1|\tEdit another file |07.2|\tA list of files |07.3|\tJumping from file " "to file |07.4|\tBackup files |07.5|\tCopy text between files |07.6|\tViewing " "a file |07.7|\tChanging the file name" msgstr "" # type: Plain text #: usr_07.txt:23 #, no-wrap msgid "" " Next chapter: |usr_08.txt| Splitting windows\n" " Previous chapter: |usr_06.txt| Using syntax highlighting\n" "Table of contents: |usr_toc.txt|\n" msgstr "" # type: Plain text #: usr_07.txt:24 usr_07.txt:63 usr_07.txt:179 usr_07.txt:266 usr_07.txt:316 usr_07.txt:404 usr_07.txt:444 usr_07.txt:475 #, no-wrap msgid "==============================================================================\n" msgstr "" # type: Plain text #: usr_07.txt:26 #, no-wrap msgid "*07.1*\tEdit another file\n" msgstr "" # type: Plain text #: usr_07.txt:29 msgid "" "So far you had to start Vim for every file you wanted to edit. There is a " "simpler way. To start editing another file, use this command: >" msgstr "" # type: Plain text #: usr_07.txt:31 #, no-wrap msgid "\t:edit foo.txt\n" msgstr "" # type: Plain text #: usr_07.txt:35 msgid "" "You can use any file name instead of \"foo.txt\". Vim will close the " "current file and open the new one. If the current file has unsaved changes, " "however, Vim displays an error message and does not open the new file:" msgstr "" # type: Plain text #: usr_07.txt:37 #, no-wrap msgid "\tE37: No write since last change (use ! to override) ~\n" msgstr "" # type: Plain text #: usr_07.txt:42 #, no-wrap msgid "" "\tNote:\n" "\tVim puts an error ID at the start of each error message. If you do\n" "\tnot understand the message or what caused it, look in the help system\n" "\tfor this ID. In this case: >\n" msgstr "" # type: Plain text #: usr_07.txt:44 #, no-wrap msgid "\t\t:help E37\n" msgstr "" # type: Plain text #: usr_07.txt:47 msgid "" "At this point, you have a number of alternatives. You can write the file " "using this command: >" msgstr "" # type: Plain text #: usr_07.txt:49 #, no-wrap msgid "\t:write\n" msgstr "" # type: Plain text #: usr_07.txt:52 msgid "" "Or you can force Vim to discard your changes and edit the new file, using " "the force (!) character: >" msgstr "" # type: Plain text #: usr_07.txt:54 #, no-wrap msgid "\t:edit! foo.txt\n" msgstr "" # type: Plain text #: usr_07.txt:57 msgid "" "If you want to edit another file, but not write the changes in the current " "file yet, you can make it hidden: >" msgstr "" # type: Plain text #: usr_07.txt:59 #, no-wrap msgid "\t:hide edit foo.txt\n" msgstr "" # type: Plain text #: usr_07.txt:62 msgid "" "The text with changes is still there, but you can't see it. This is further " "explained in section |22.4|: The buffer list." msgstr "" # type: Plain text #: usr_07.txt:65 #, no-wrap msgid "*07.2*\tA list of files\n" msgstr "" # type: Plain text #: usr_07.txt:67 msgid "You can start Vim to edit a sequence of files. For example: >" msgstr "" # type: Plain text #: usr_07.txt:69 #, no-wrap msgid "\tvim one.c two.c three.c\n" msgstr "" # type: Plain text #: usr_07.txt:73 msgid "" "This command starts Vim and tells it that you will be editing three files. " "Vim displays just the first file. After you have done your thing in this " "file, to edit the next file you use this command: >" msgstr "" # type: Plain text #: usr_07.txt:75 usr_07.txt:190 usr_07.txt:196 #, no-wrap msgid "\t:next\n" msgstr "" # type: Plain text #: usr_07.txt:79 msgid "" "If you have unsaved changes in the current file, you will get an error " "message and the \":next\" will not work. This is the same problem as with " "\":edit\" mentioned in the previous section. To abandon the changes: >" msgstr "" # type: Plain text #: usr_07.txt:81 #, no-wrap msgid "\t:next!\n" msgstr "" # type: Plain text #: usr_07.txt:84 msgid "" "But mostly you want to save the changes and move on to the next file. There " "is a special command for this: >" msgstr "" # type: Plain text #: usr_07.txt:86 #, no-wrap msgid "\t:wnext\n" msgstr "" # type: Plain text #: usr_07.txt:88 msgid "This does the same as using two separate commands: >" msgstr "" # type: Plain text #: usr_07.txt:91 #, no-wrap msgid "" "\t:write\n" "\t:next\n" msgstr "" # type: Plain text #: usr_07.txt:94 msgid "WHERE AM I?" msgstr "" # type: Plain text #: usr_07.txt:99 #, no-wrap msgid "" "To see which file in the argument list you are editing, look in the window\n" "title. It should show something like \"(2 of 3)\". This means you are " "editing\n" "the second file out of three files.\n" " If you want to see the list of files, use this command: >\n" msgstr "" # type: Plain text #: usr_07.txt:101 #, no-wrap msgid "\t:args\n" msgstr "" # type: Plain text #: usr_07.txt:103 msgid "This is short for \"arguments\". The output might look like this:" msgstr "" # type: Plain text #: usr_07.txt:105 #, no-wrap msgid "\tone.c [two.c] three.c ~\n" msgstr "" # type: Plain text #: usr_07.txt:108 msgid "" "These are the files you started Vim with. The one you are currently " "editing, \"two.c\", is in square brackets." msgstr "" # type: Plain text #: usr_07.txt:111 msgid "MOVING TO OTHER ARGUMENTS" msgstr "" # type: Plain text #: usr_07.txt:113 msgid "To go back one file: >" msgstr "" # type: Plain text #: usr_07.txt:115 #, no-wrap msgid "\t:previous\n" msgstr "" # type: Plain text #: usr_07.txt:119 msgid "" "This is just like the \":next\" command, except that it moves in the other " "direction. Again, there is a shortcut command for when you want to write " "the file first: >" msgstr "" # type: Plain text #: usr_07.txt:121 #, no-wrap msgid "\t:wprevious\n" msgstr "" # type: Plain text #: usr_07.txt:123 msgid "To move to the very last file in the list: >" msgstr "" # type: Plain text #: usr_07.txt:125 #, no-wrap msgid "\t:last\n" msgstr "" # type: Plain text #: usr_07.txt:127 msgid "And to move back to the first one again: >" msgstr "" # type: Plain text #: usr_07.txt:129 #, no-wrap msgid "\t:first\n" msgstr "" # type: Plain text #: usr_07.txt:131 msgid "There is no \":wlast\" or \":wfirst\" command though!" msgstr "" # type: Plain text #: usr_07.txt:133 msgid "" "You can use a count for \":next\" and \":previous\". To skip two files " "forward: >" msgstr "" # type: Plain text #: usr_07.txt:135 #, no-wrap msgid "\t:2next\n" msgstr "" # type: Plain text #: usr_07.txt:138 msgid "AUTOMATIC WRITING" msgstr "" # type: Plain text #: usr_07.txt:143 msgid "" "When moving around the files and making changes, you have to remember to use " "\":write\". Otherwise you will get an error message. If you are sure you " "always want to write modified files, you can tell Vim to automatically write " "them: >" msgstr "" # type: Plain text #: usr_07.txt:145 #, no-wrap msgid "\t:set autowrite\n" msgstr "" # type: Plain text #: usr_07.txt:148 msgid "" "When you are editing a file which you may not want to write, switch it off " "again: >" msgstr "" # type: Plain text #: usr_07.txt:150 #, no-wrap msgid "\t:set noautowrite\n" msgstr "" # type: Plain text #: usr_07.txt:153 msgid "EDITING ANOTHER LIST OF FILES" msgstr "" # type: Plain text #: usr_07.txt:156 msgid "" "You can redefine the list of files without the need to exit Vim and start it " "again. Use this command to edit three other files: >" msgstr "" # type: Plain text #: usr_07.txt:158 #, no-wrap msgid "\t:args five.c six.c seven.h\n" msgstr "" # type: Plain text #: usr_07.txt:160 msgid "Or use a wildcard, like it's used in the shell: >" msgstr "" # type: Plain text #: usr_07.txt:162 #, no-wrap msgid "\t:args *.txt\n" msgstr "" # type: Plain text #: usr_07.txt:166 msgid "" "Vim will take you to the first file in the list. Again, if the current file " "has changes, you can either write the file first, or use \":args!\" (with ! " "added) to abandon the changes." msgstr "" # type: Plain text #: usr_07.txt:173 #, no-wrap msgid "" "DID YOU EDIT THE LAST FILE?\n" "\t\t\t\t\t\t\t*arglist-quit*\n" "When you use a list of files, Vim assumes you want to edit them all. To\n" "protect you from exiting too early, you will get this error when you " "didn't\n" "edit the last file in the list yet:\n" msgstr "" # type: Plain text #: usr_07.txt:175 #, no-wrap msgid "\tE173: 46 more files to edit ~\n" msgstr "" # type: Plain text #: usr_07.txt:178 msgid "" "If you really want to exit, just do it again. Then it will work (but not " "when you did other commands in between)." msgstr "" # type: Plain text #: usr_07.txt:181 #, no-wrap msgid "*07.3*\tJumping from file to file\n" msgstr "" # type: Plain text #: usr_07.txt:184 msgid "" "To quickly jump between two files, press CTRL-^ (on English-US keyboards the " "^ is above the 6 key). Example: >" msgstr "" # type: Plain text #: usr_07.txt:186 #, no-wrap msgid "\t:args one.c two.c three.c\n" msgstr "" # type: Plain text #: usr_07.txt:188 msgid "You are now in one.c. >" msgstr "" # type: Plain text #: usr_07.txt:194 msgid "" "Now you are in two.c. Now use CTRL-^ to go back to one.c. Another CTRL-^ " "and you are back in two.c. Another CTRL-^ and you are in one.c again. If " "you now do: >" msgstr "" # type: Plain text #: usr_07.txt:200 msgid "" "You are in three.c. Notice that the CTRL-^ command does not change the idea " "of where you are in the list of files. Only commands like \":next\" and " "\":previous\" do that." msgstr "" # type: Plain text #: usr_07.txt:203 msgid "" "The file you were previously editing is called the \"alternate\" file. When " "you just started Vim CTRL-^ will not work, since there isn't a previous " "file." msgstr "" # type: Plain text #: usr_07.txt:206 msgid "PREDEFINED MARKS" msgstr "" # type: Plain text #: usr_07.txt:209 msgid "" "After jumping to another file, you can use two predefined marks which are " "very useful: >" msgstr "" # type: Plain text #: usr_07.txt:211 #, no-wrap msgid "\t`\"\n" msgstr "" # type: Plain text #: usr_07.txt:215 msgid "" "This takes you to the position where the cursor was when you left the file. " "Another mark that is remembered is the position where you made the last " "change: >" msgstr "" # type: Plain text #: usr_07.txt:217 #, no-wrap msgid "\t`.\n" msgstr "" # type: Plain text #: usr_07.txt:226 msgid "" "Suppose you are editing the file \"one.txt\". Somewhere halfway the file " "you use \"x\" to delete a character. Then you go to the last line with " "\"G\" and write the file with \":w\". You edit several other files, and " "then use \":edit one.txt\" to come back to \"one.txt\". If you now use `\" " "Vim jumps to the last line of the file. Using `. takes you to the position " "where you deleted the character. Even when you move around in the file `\" " "and `. will take you to the remembered position. At least until you make " "another change or leave the file." msgstr "" # type: Plain text #: usr_07.txt:229 msgid "FILE MARKS" msgstr "" # type: Plain text #: usr_07.txt:238 #, no-wrap msgid "" "In chapter 4 was explained how you can place a mark in a file with \"mx\" " "and\n" "jump to that position with \"`x\". That works within one file. If you " "edit\n" "another file and place marks there, these are specific for that file. " "Thus\n" "each file has its own set of marks, they are local to the file.\n" " So far we were using marks with a lowercase letter. There are also " "marks\n" "with an uppercase letter. These are global, they can be used from any " "file.\n" "For example suppose that we are editing the file \"foo.txt\". Go to halfway " "the\n" "file (\"50%\") and place the F mark there (F for foo): >\n" msgstr "" # type: Plain text #: usr_07.txt:240 #, no-wrap msgid "\t50%mF\n" msgstr "" # type: Plain text #: usr_07.txt:244 #, no-wrap msgid "" "Now edit the file \"bar.txt\" and place the B mark (B for bar) at its last " "line:\n" ">\n" "\tGmB\n" msgstr "" # type: Plain text #: usr_07.txt:247 msgid "" "Now you can use the \"'F\" command to jump back to halfway foo.txt. Or edit " "yet another file, type \"'B\" and you are at the end of bar.txt again." msgstr "" # type: Plain text #: usr_07.txt:254 #, no-wrap msgid "" "The file marks are remembered until they are placed somewhere else. Thus " "you\n" "can place the mark, do hours of editing and still be able to jump back to " "that\n" "mark.\n" " It's often useful to think of a simple connection between the mark " "letter\n" "and where it is placed. For example, use the H mark in a header file, M " "in\n" "a Makefile and C in a C code file.\n" msgstr "" # type: Plain text #: usr_07.txt:256 msgid "" "To see where a specific mark is, give an argument to the \":marks\" command: " ">" msgstr "" # type: Plain text #: usr_07.txt:258 #, no-wrap msgid "\t:marks M\n" msgstr "" # type: Plain text #: usr_07.txt:260 msgid "You can also give several arguments: >" msgstr "" # type: Plain text #: usr_07.txt:262 #, no-wrap msgid "\t:marks MCP\n" msgstr "" # type: Plain text #: usr_07.txt:265 msgid "" "Don't forget that you can use CTRL-O and CTRL-I to jump to older and newer " "positions without placing marks there." msgstr "" # type: Plain text #: usr_07.txt:268 #, no-wrap msgid "*07.4*\tBackup files\n" msgstr "" # type: Plain text #: usr_07.txt:271 msgid "" "Usually Vim does not produce a backup file. If you want to have one, all " "you need to do is execute the following command: >" msgstr "" # type: Plain text #: usr_07.txt:273 #, no-wrap msgid "\t:set backup\n" msgstr "" # type: Plain text #: usr_07.txt:279 #, no-wrap msgid "" "The name of the backup file is the original file with a ~ added to the " "end.\n" "If your file is named data.txt, for example, the backup file name is\n" "data.txt~.\n" " If you do not like the fact that the backup files end with ~, you can\n" "change the extension: >\n" msgstr "" # type: Plain text #: usr_07.txt:281 #, no-wrap msgid "\t:set backupext=.bak\n" msgstr "" # type: Plain text #: usr_07.txt:286 #, no-wrap msgid "" "This will use data.txt.bak instead of data.txt~.\n" " Another option that matters here is 'backupdir'. It specifies where " "the\n" "backup file is written. The default, to write the backup in the same\n" "directory as the original file, will mostly be the right thing.\n" msgstr "" # type: Plain text #: usr_07.txt:294 #, no-wrap msgid "" "\tNote:\n" "\tWhen the 'backup' option isn't set but the 'writebackup' is, Vim will\n" "\tstill create a backup file. However, it is deleted as soon as writing\n" "\tthe file was completed successfully. This functions as a safety\n" "\tagainst losing your original file when writing fails in some way (disk\n" "\tfull is the most common cause; being hit by lightning might be\n" "\tanother, although less common).\n" msgstr "" # type: Plain text #: usr_07.txt:297 msgid "KEEPING THE ORIGINAL FILE" msgstr "" # type: Plain text #: usr_07.txt:304 #, no-wrap msgid "" "If you are editing source files, you might want to keep the file before " "you\n" "make any changes. But the backup file will be overwritten each time you " "write\n" "the file. Thus it only contains the previous version, not the first one.\n" " To make Vim keep the original file, set the 'patchmode' option. This\n" "specifies the extension used for the first backup of a changed file. " "Usually\n" "you would do this: >\n" msgstr "" # type: Plain text #: usr_07.txt:306 #, no-wrap msgid "\t:set patchmode=.orig\n" msgstr "" # type: Plain text #: usr_07.txt:315 #, no-wrap msgid "" "When you now edit the file data.txt for the first time, make changes and " "write\n" "the file, Vim will keep a copy of the unchanged file under the name\n" "\"data.txt.orig\".\n" " If you make further changes to the file, Vim will notice that\n" "\"data.txt.orig\" already exists and leave it alone. Further backup files " "will\n" "then be called \"data.txt~\" (or whatever you specified with 'backupext').\n" " If you leave 'patchmode' empty (that is the default), the original file\n" "will not be kept.\n" msgstr "" # type: Plain text #: usr_07.txt:318 #, no-wrap msgid "*07.5*\tCopy text between files\n" msgstr "" # type: Plain text #: usr_07.txt:325 #, no-wrap msgid "" "This explains how to copy text from one file to another. Let's start with " "a\n" "simple example. Edit the file that contains the text you want to copy. " "Move\n" "the cursor to the start of the text and press \"v\". This starts Visual " "mode.\n" "Now move the cursor to the end of the text and press \"y\". This yanks " "(copies)\n" "the selected text.\n" " To copy the above paragraph, you would do: >\n" msgstr "" # type: Plain text #: usr_07.txt:329 #, no-wrap msgid "" "\t:edit thisfile\n" "\t/This\n" "\tvjjjj$y\n" msgstr "" # type: Plain text #: usr_07.txt:336 #, no-wrap msgid "" "Now edit the file you want to put the text in. Move the cursor to the\n" "character where you want the text to appear after. Use \"p\" to put the " "text\n" "there. >\n" "\t:edit otherfile\n" "\t/There\n" "\tp\n" msgstr "" # type: Plain text #: usr_07.txt:344 #, no-wrap msgid "" "Of course you can use many other commands to yank the text. For example, " "to\n" "select whole lines start Visual mode with \"V\". Or use CTRL-V to select " "a\n" "rectangular block. Or use \"Y\" to yank a single line, \"yaw\" to " "yank-a-word,\n" "etc.\n" " The \"p\" command puts the text after the cursor. Use \"P\" to put the " "text\n" "before the cursor. Notice that Vim remembers if you yanked a whole line or " "a\n" "block, and puts it back that way.\n" msgstr "" # type: Plain text #: usr_07.txt:347 msgid "USING REGISTERS" msgstr "" # type: Plain text #: usr_07.txt:354 #, no-wrap msgid "" "When you want to copy several pieces of text from one file to another, " "having\n" "to switch between the files and writing the target file takes a lot of " "time.\n" "To avoid this, copy each piece of text to its own register.\n" " A register is a place where Vim stores text. Here we will use the\n" "registers named a to z (later you will find out there are others). Let's " "copy\n" "a sentence to the f register (f for First): >\n" msgstr "" # type: Plain text #: usr_07.txt:356 #, no-wrap msgid "\t\"fyas\n" msgstr "" # type: Plain text #: usr_07.txt:361 #, no-wrap msgid "" "The \"yas\" command yanks a sentence like before. It's the \"f that tells " "Vim\n" "the text should be place in the f register. This must come just before " "the\n" "yank command.\n" " Now yank three whole lines to the l register (l for line): >\n" msgstr "" # type: Plain text #: usr_07.txt:363 #, no-wrap msgid "\t\"l3Y\n" msgstr "" # type: Plain text #: usr_07.txt:366 msgid "" "The count could be before the \"l just as well. To yank a block of text to " "the b (for block) register: >" msgstr "" # type: Plain text #: usr_07.txt:368 #, no-wrap msgid "\tCTRL-Vjjww\"by\n" msgstr "" # type: Plain text #: usr_07.txt:374 #, no-wrap msgid "" "Notice that the register specification \"b is just before the \"y\" " "command.\n" "This is required. If you would have put it before the \"w\" command, it " "would\n" "not have worked.\n" " Now you have three pieces of text in the f, l and b registers. Edit\n" "another file, move around and place the text where you want it: >\n" msgstr "" # type: Plain text #: usr_07.txt:376 #, no-wrap msgid "\t\"fp\n" msgstr "" # type: Plain text #: usr_07.txt:381 #, no-wrap msgid "" "Again, the register specification \"f comes before the \"p\" command.\n" " You can put the registers in any order. And the text stays in the " "register\n" "until you yank something else into it. Thus you can put it as many times " "as\n" "you like.\n" msgstr "" # type: Plain text #: usr_07.txt:385 msgid "" "When you delete text, you can also specify a register. Use this to move " "several pieces of text around. For example, to delete-a-word and write it " "in the w register: >" msgstr "" # type: Plain text #: usr_07.txt:387 #, no-wrap msgid "\t\"wdaw\n" msgstr "" # type: Plain text #: usr_07.txt:389 msgid "Again, the register specification comes before the delete command \"d\"." msgstr "" # type: Plain text #: usr_07.txt:392 msgid "APPENDING TO A FILE" msgstr "" # type: Plain text #: usr_07.txt:394 msgid "When collecting lines of text into one file, you can use this command: >" msgstr "" # type: Plain text #: usr_07.txt:396 #, no-wrap msgid "\t:write >> logfile\n" msgstr "" # type: Plain text #: usr_07.txt:403 #, no-wrap msgid "" "This will write the text of the current file to the end of \"logfile\". " "Thus it\n" "is appended. This avoids that you have to copy the lines, edit the log " "file\n" "and put them there. Thus you save two steps. But you can only append to " "the\n" "end of a file.\n" " To append only a few lines, select them in Visual mode before typing\n" "\":write\". In chapter 10 you will learn other ways to select a range of " "lines.\n" msgstr "" # type: Plain text #: usr_07.txt:406 #, no-wrap msgid "*07.6*\tViewing a file\n" msgstr "" # type: Plain text #: usr_07.txt:411 #, no-wrap msgid "" "Sometimes you only want to see what a file contains, without the intention " "to\n" "ever write it back. There is the risk that you type \":w\" without thinking " "and\n" "overwrite the original file anyway. To avoid this, edit the file " "read-only.\n" " To start Vim in readonly mode, use this command: >\n" msgstr "" # type: Plain text #: usr_07.txt:413 #, no-wrap msgid "\tvim -R file\n" msgstr "" # type: Plain text #: usr_07.txt:415 msgid "On Unix this command should do the same thing: >" msgstr "" # type: Plain text #: usr_07.txt:417 #, no-wrap msgid "\tview file\n" msgstr "" # type: Plain text #: usr_07.txt:421 #, no-wrap msgid "" "You are now editing \"file\" in read-only mode. When you try using \":w\" " "you\n" "will get an error message and the file won't be written.\n" " When you try to make a change to the file Vim will give you a warning:\n" msgstr "" # type: Plain text #: usr_07.txt:423 #, no-wrap msgid "\tW10: Warning: Changing a readonly file ~\n" msgstr "" # type: Plain text #: usr_07.txt:428 #, no-wrap msgid "" "The change will be done though. This allows for formatting the file, for\n" "example, to be able to read it easily.\n" " If you make changes to a file and forgot that it was read-only, you can\n" "still write it. Add the ! to the write command to force writing.\n" msgstr "" # type: Plain text #: usr_07.txt:430 msgid "If you really want to forbid making changes in a file, do this: >" msgstr "" # type: Plain text #: usr_07.txt:432 #, no-wrap msgid "\tvim -M file\n" msgstr "" # type: Plain text #: usr_07.txt:435 msgid "" "Now every attempt to change the text will fail. The help files are like " "this, for example. If you try to make a change you get this error message:" msgstr "" # type: Plain text #: usr_07.txt:437 #, no-wrap msgid "\tE21: Cannot make changes, 'modifiable' is off ~\n" msgstr "" # type: Plain text #: usr_07.txt:440 msgid "" "You could use the -M argument to setup Vim to work in a viewer mode. This " "is only voluntary though, since these commands will remove the protection: >" msgstr "" # type: Plain text #: usr_07.txt:443 #, no-wrap msgid "" "\t:set modifiable\n" "\t:set write\n" msgstr "" # type: Plain text #: usr_07.txt:446 #, no-wrap msgid "*07.7*\tChanging the file name\n" msgstr "" # type: Plain text #: usr_07.txt:451 msgid "" "A clever way to start editing a new file is by using an existing file that " "contains most of what you need. For example, you start writing a new " "program to move a file. You know that you already have a program that " "copies a file, thus you start with: >" msgstr "" # type: Plain text #: usr_07.txt:453 #, no-wrap msgid "\t:edit copy.c\n" msgstr "" # type: Plain text #: usr_07.txt:456 msgid "" "You can delete the stuff you don't need. Now you need to save the file " "under a new name. The \":saveas\" command can be used for this: >" msgstr "" # type: Plain text #: usr_07.txt:458 #, no-wrap msgid "\t:saveas move.c\n" msgstr "" # type: Plain text #: usr_07.txt:464 #, no-wrap msgid "" "Vim will write the file under the given name, and edit that file. Thus " "the\n" "next time you do \":write\", it will write \"move.c\". \"copy.c\" remains\n" "unmodified.\n" " When you want to change the name of the file you are editing, but don't\n" "want to write the file, you can use this command: >\n" msgstr "" # type: Plain text #: usr_07.txt:466 #, no-wrap msgid "\t:file move.c\n" msgstr "" # type: Plain text #: usr_07.txt:470 msgid "" "Vim will mark the file as \"not edited\". This means that Vim knows this is " "not the file you started editing. When you try to write the file, you might " "get this message:" msgstr "" # type: Plain text #: usr_07.txt:472 #, no-wrap msgid "\tE13: File exists (use ! to override) ~\n" msgstr "" # type: Plain text #: usr_07.txt:474 msgid "This protects you from accidentally overwriting another file." msgstr "" # type: Plain text #: usr_07.txt:478 msgid "Next chapter: |usr_08.txt| Splitting windows" msgstr "" # type: Plain text #: usr_07.txt:479 msgid "Copyright: see |manual-copyright| vim:tw=78:ts=8:ft=help:norl:" msgstr ""