# vimhelp: user manual ch.41 Write a Vim script # Copyright (C) 2006 Bram Moolenaar # This file is distributed under the same license as the vim package. # Florian 'eix' Rehnisch , 2009. # msgid "" msgstr "" "Project-Id-Version: vimhelp 7.0.230\n" "POT-Creation-Date: 2009-09-14 19:34+0300\n" "PO-Revision-Date: 2009-09-14 20:44+0200\n" "Last-Translator: Florian 'eix' Rehnisch \n" "Language-Team: German \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf8\n" "Content-Transfer-Encoding: 8bit\n" # type: Plain text #: usr_41.txt:2 #, no-wrap msgid "*usr_41.txt*\tFor Vim version 7.1. Last change: 2007 Apr 26\n" msgstr "*usr_41.txt*\tFür Vim version 7.1. Letzte Änderung: 2007-Apr-26\n" # type: Plain text #: usr_41.txt:4 #, no-wrap msgid "\t\t VIM USER MANUAL - by Bram Moolenaar\n" msgstr "\t\t VIM BENUTZERHANDBUCH - von Bram Moolenaar\n" # type: Plain text #: usr_41.txt:6 #, no-wrap msgid "\t\t\t Write a Vim script\n" msgstr "\t\t\t Ein Vim-Skript schreiben\n" # type: Plain text #: usr_41.txt:11 msgid "" "The Vim script language is used for the startup vimrc file, syntax files, " "and many other things. This chapter explains the items that can be used in " "a Vim script. There are a lot of them, thus this is a long chapter." msgstr "" "Vims Skriptsprache wird für die Startup-Datei vimrc, Syntax-Dateien und " "viele andere Dinge verwendet. Dieses Kapitel erklärt die Elemente, die in " "einem Vim-Skript benutzt werden können. Davon gibt es eine Menge, daher " "ist dies ein langes Kapitel." # type: Plain text #: usr_41.txt:28 msgid "" "|41.1|\tIntroduction |41.2|\tVariables |41.3|\tExpressions |41.4|" "\tConditionals |41.5|\tExecuting an expression |41.6|\tUsing functions " "|41.7|" "\tDefining a function |41.8|\tLists and Dictionaries |41.9|\tExceptions |" "41.10|\tVarious remarks |41.11|\tWriting a plugin |41.12|\tWriting a " "filetype plugin |41.13|\tWriting a compiler plugin |41.14|\tWriting a " "plugin " "that loads quickly |41.15|\tWriting library scripts |41.16|\tDistributing " "Vim scripts" msgstr "" "|41.1|\tEinführung\n" "|41.2|\tVariablen\n" "|41.3|\tAusdrücke\n" "|41.4|\tBedingungen\n" "|41.5|\tEinen Ausdruck ausführen\n" "|41.6|\tFunktionen benutzen\n" "|41.7|\tEine Funktion definieren\n" "|41.8|\tListen und Wörterbücher\n" "|41.9|\tAusnahmen\n" "|41.10|\tVerschiedene Anmerkungen\n" "|41.11|\tEin Plugin schreiben\n" "|41.12|\tEin Dateityp-Plugin schreiben\n" "|41.13|\tEin Kompiler-Plugin schreiben\n" "|41.14|\tEin Plugin so schreiben, dass es schnell lädt\n" "|41.15|\tBibliotheksskripte schreiben\n" "|41.16|\tVim-Skripte verteilen" # type: Plain text #: usr_41.txt:32 #, no-wrap msgid "" " Next chapter: |usr_42.txt| Add new menus\n" " Previous chapter: |usr_40.txt| Make new commands\n" "Table of contents: |usr_toc.txt|\n" msgstr "" "Nächstes Kapitel: |usr_42.txt| Neue Menüs hinzufügen\n" " Voriges Kapitel: |usr_40.txt| Neue Befehle machen\n" "Inhaltsübersicht: |usr_toc.txt|\n" # type: Plain text #: usr_41.txt:33 usr_41.txt:133 usr_41.txt:267 usr_41.txt:345 usr_41.txt:482 #: usr_41.txt:532 usr_41.txt:852 usr_41.txt:1079 usr_41.txt:1365 #: usr_41.txt:1422 usr_41.txt:1592 usr_41.txt:2005 usr_41.txt:2191 #: usr_41.txt:2237 usr_41.txt:2313 usr_41.txt:2377 usr_41.txt:2392 #, no-wrap msgid "" "===========================================================================" "===\n" msgstr "" "============================================================================" "==\n" # type: Plain text #: usr_41.txt:35 #, no-wrap msgid "*41.1*\tIntroduction\t\t\t\t*vim-script-intro* *script*\n" msgstr "*41.1*\tEinführung\t\t\t\t*vim-script-intro* *script*\n" # type: Plain text #: usr_41.txt:43 #, no-wrap msgid "" "Your first experience with Vim scripts is the vimrc file. Vim reads it " "when\n" "it starts up and executes the commands. You can set options to values you\n" "prefer. And you can use any colon command in it (commands that start with " "a\n" "\":\"; these are sometimes referred to as Ex commands or command-line " "commands).\n" " Syntax files are also Vim scripts. As are files that set options for a\n" "specific file type. A complicated macro can be defined by a separate Vim\n" "script file. You can think of other uses yourself.\n" msgstr "" "Ihre erste Erfahrung mit Vim-Skripten ist die Datei vimrc. Vim liest sie " "beim\n" "Start und führt die Befehle aus. Sie können Optionen auf Werte setzen, " "die\n" "Sie bevorzugen. Und Sie können jeden Doppelpunkt-Befehl in ihr benutzen\n" "(Befehle, die mit »:« starten, diese werden manchmal Ex-Befehle oder\n" "Befehlszeilen-Befehle genannt.\n" " Syntax-Dateien sind ebenfalls Vim-Skripte. So wie Dateien, die für " "einen\n" "bestimmten Dateityp Optionen setzen. Ein kompliziertes Makro kann in " "einer\n" "eigenen Vim-Skript-Datei definiert werden. Sie können sich nun weitere\n" "Möglichkeiten ausmalen.\n" # type: Plain text #: usr_41.txt:45 msgid "Let's start with a simple example: >" msgstr "Lassen Sie uns mit einem einfachen Beispiel beginnen: >" # type: Plain text #: usr_41.txt:60 #, no-wrap msgid "" "\t:let i = 1\n" "\t:while i < 5\n" "\t: echo \"count is\" i\n" "\t: let i += 1\n" "\t:endwhile\n" "<\n" "\tNote:\n" "\tThe \":\" characters are not really needed here. You only need to use\n" "\tthem when you type a command. In a Vim script file they can be left\n" "\tout. We will use them here anyway to make clear these are colon\n" "\tcommands and make them stand out from Normal mode commands.\n" "\tNote:\n" "\tYou can try out the examples by yanking the lines from the text here\n" "\tand executing them with :@\"\n" msgstr "" "\t:let i = 1\n" "\t:while i < 5\n" "\t: echo \"Zähler ist\" i\n" "\t: let i += 1\n" "\t:endwhile\n" "<\n" "\tAnmerkung:\n" "\tDie »:« werden hier nicht wirklich gebraucht. Sie brauchen sie nur,\n" "\twenn Sie einen Befehl in Vim tippen. In einer Vim-Skript-Datei können\n" "\tsie ausgelassen werden. Wir benutzen Sie hier dennoch, um klar zu\n" "\tmachen, dass dies Doppelpunkt-Befehle sind, und um sie sich von den\n" "\tBefehlen des Normalmodus abheben zu lassen.\n" "\tAnmerkung:\n" "\tSie können die Beispiele ausprobieren, indem Sie die Zeilen von hier\n" "\tin ein Register kopieren und sie mit :@\" ausführen.\n" # type: Plain text #: usr_41.txt:62 msgid "The output of the example code is:" msgstr "Die Ausgabe des Beispielcodes ist:" # type: Plain text #: usr_41.txt:67 #, no-wrap msgid "" "\tcount is 1 ~\n" "\tcount is 2 ~\n" "\tcount is 3 ~\n" "\tcount is 4 ~\n" msgstr "" "\tZähler ist 1 ~\n" "\tZähler ist 2 ~\n" "\tZähler ist 3 ~\n" "\tZähler ist 4 ~\n" # type: Plain text #: usr_41.txt:70 msgid "" "In the first line the \":let\" command assigns a value to a variable. The " "generic form is: >" msgstr "" "In der ersten Zeile verknüpft der Befehl »:let« einen Wert mit einer " "Variablen. Die generische Form ist: >" # type: Plain text #: usr_41.txt:72 #, no-wrap msgid "\t:let {variable} = {expression}\n" msgstr "\t:let {variable} = {ausdruck}\n" # type: Plain text #: usr_41.txt:76 #, no-wrap msgid "" "In this case the variable name is \"i\" and the expression is a simple " "value,\n" "the number one.\n" " The \":while\" command starts a loop. The generic form is: >\n" msgstr "" "In diesem Falle ist der Variablenname »i« und der Ausdruck ist ein " "einfacher\n" "Wert, die Zahl eins.\n" " Der Befehl »:while« beginnt eine Schleife. Die generische Form ist: >\n" # type: Plain text #: usr_41.txt:80 #, no-wrap msgid "" "\t:while {condition}\n" "\t: {statements}\n" "\t:endwhile\n" msgstr "" "\t:while {bedingung}\n" "\t: {anweisungen}\n" "\t:endwhile\n" # type: Plain text #: usr_41.txt:87 #, no-wrap msgid "" "The statements until the matching \":endwhile\" are executed for as long " "as the\n" "condition is true. The condition used here is the expression \"i < 5\". " "This\n" "is true when the variable i is smaller than five.\n" "\tNote:\n" "\tIf you happen to write a while loop that keeps on running, you can\n" "\tinterrupt it by pressing CTRL-C (CTRL-Break on MS-Windows).\n" msgstr "" "Die Anweisungen bis zum entsprechenden »:endwhile« werden so lange " "ausgeführt,\n" "wie die Bedingung wahr ist. Die hier benutzte Bedingung ist der Ausdruck\n" "»i < 5«. Dies ist wahr, wenn die Variable i kleiner als fünf ist.\n" "\tAnmerkung:\n" "\tFalls Sie versehentlich eine While-Schleife schreiben, die nicht\n" "\tabbricht, können Sie sie durch Drücken von CTRL-C (CTRL-Pause unter\n" "\tMS-Windows) unterbrechen.\n" # type: Plain text #: usr_41.txt:90 msgid "" "The \":echo\" command prints its arguments. In this case the string " "\"count " "is\" and the value of the variable i. Since i is one, this will print:" msgstr "" "Der Befehl »:echo« gibt seine Argumente aus. In diesem Falle die " "Zeichenkette »Zähler ist« und den Wert der Variablen i. Weil i eins ist, " "wird folgendes ausgegeben:" # type: Plain text #: usr_41.txt:92 #, no-wrap msgid "\tcount is 1 ~\n" msgstr "\tZähler ist 1 ~\n" # type: Plain text #: usr_41.txt:96 msgid "" "Then there is the \":let i += 1\" command. This does the same thing as \":" "let i = i + 1\". This adds one to the variable i and assigns the new value " "to the same variable." msgstr "" "Dann kommt der Befehl »:let i += 1«. Dies macht dasselbe wie »:let i = i " "+1«. Dies addiert eins zu der Variablen i und verknüpft den neuen Wert " "mit derselben Variablen." # type: Plain text #: usr_41.txt:99 msgid "" "The example was given to explain the commands, but would you really want to " "make such a loop it can be written much more compact: >" msgstr "" "Das Beispiel wurde aufgeführt, um die Befehle zu erläutern, aber wenn Sie " "wirklich solch eine Schleife bauen wollen, kann dies viel kompakter " "geschrieben werden: >" # type: Plain text #: usr_41.txt:103 #, no-wrap msgid "" "\t:for i in range(1, 4)\n" "\t: echo \"count is\" i\n" "\t:endfor\n" msgstr "" "\t:for i in range(1, 4)\n" "\t: echo \"Zähler ist\" i\n" "\t:endfor\n" # type: Plain text #: usr_41.txt:106 msgid "" "We won't explain how |:for| and |range()| work until later. Follow the " "links if you are impatient." msgstr "" "Wir erklären |:for| und |range()| zunächst nicht. Folgen Sie den " "Verweisen, wenn Sie ungeduldig sind." # type: Plain text #: usr_41.txt:109 msgid "THREE KINDS OF NUMBERS" msgstr "DREI ARTEN VON ZAHLEN" # type: Plain text #: usr_41.txt:115 #, no-wrap msgid "" "Numbers can be decimal, hexadecimal or octal. A hexadecimal number starts\n" "with \"0x\" or \"0X\". For example \"0x1f\" is decimal 31. An octal " "number starts\n" "with a zero. \"017\" is decimal 15. Careful: don't put a zero before a " "decimal\n" "number, it will be interpreted as an octal number!\n" " The \":echo\" command always prints decimal numbers. Example: >\n" msgstr "" "Zahlen können dezimal, hexadezimal oder oktal sein. Eine hexadezimale " "Zahl\n" "beginnt mir »0x« oder »0X«. »0x1f« ist zum Beispiel dezimal 31. Eine " "oktale\n" "Zahl beginnt mit einer Null. »017« ist dezimal 15. Achtung: setzen Sie " "keine\n" "Null vor eine dezimale Zahl, sie wird dann als oktale Zahl interprätiert!\n" " Der Befehl »:echo« gibt immer dezimale Zahlen aus. Beispiel: >\n" # type: Plain text #: usr_41.txt:118 #, no-wrap msgid "" "\t:echo 0x7f 036\n" "<\t127 30 ~\n" msgstr "" "\t:echo 0x7f 036\n" "<\t127 30 ~\n" # type: Plain text #: usr_41.txt:122 #, no-wrap msgid "" "A number is made negative with a minus sign. This also works for " "hexadecimal\n" "and octal numbers. A minus sign is also used for subtraction. Compare " "this\n" "with the previous example: >\n" msgstr "" "Eine Zahl wird mit einem Minus-Zeichen negativ gemacht. Dies funktioniert\n" "auch für hexadezimale und oktale Zahlen. Das Minus-Zeichen wird auch für " "die\n" "Substraktion verwandt. Vergleichen Sie dies mit dem vorigen Beispiel: >\n" # type: Plain text #: usr_41.txt:125 #, no-wrap msgid "" "\t:echo 0x7f -036\n" "<\t97 ~\n" msgstr "" "\t:echo 0x7f -036\n" "<\t97 ~\n" # type: Plain text #: usr_41.txt:130 msgid "" "White space in an expression is ignored. However, it's recommended to use " "it for separating items, to make the expression easier to read. For " "example, to avoid the confusion with a negative number above, put a space " "between the minus sign and the following number: >" msgstr "" "Whitespace in einem Ausdruck wird ignoriert. Dennoch empfiehlt es sich, " "ihn zu benutzen, um Elemente zu trennen, um den Ausdruck leichter lesbar " "zu machen. Um zum Beispiel oben die Verwechslung mit einer negativen Zahl " "zu vermeiden, setzen Sie ein Leerzeichen zwischen das Minus-Zeichen und " "die darauf folgende Zahl: >" # type: Plain text #: usr_41.txt:132 #, no-wrap msgid "\t:echo 0x7f - 036\n" msgstr "\t:echo 0x7f - 036\n" # type: Plain text #: usr_41.txt:135 #, no-wrap msgid "*41.2*\tVariables\n" msgstr "*41.2*\tVariablen\n" # type: Plain text #: usr_41.txt:138 msgid "" "A variable name consists of ASCII letters, digits and the underscore. It " "cannot start with a digit. Valid variable names are:" msgstr "" "Ein Variablenname besteht aus ASCII-Buchstaben, Ziffern und dem " "Unterstrich. Er kann nicht mit einer Ziffer beginnen. Gültige " "Variablennamen sind:" # type: Plain text #: usr_41.txt:144 #, no-wrap msgid "" "\tcounter\n" "\t_aap3\n" "\tvery_long_variable_name_with_underscores\n" "\tFuncLength\n" "\tLENGTH\n" msgstr "" "\tcounter\n" "\t_aap3\n" "\tvery_long_variable_name_with_underscores\n" "\tFuncLength\n" "\tLENGTH\n" # type: Plain text #: usr_41.txt:148 #, no-wrap msgid "" "Invalid names are \"foo+bar\" and \"6var\".\n" " These variables are global. To see a list of currently defined " "variables\n" "use this command: >\n" msgstr "" "Ungültige Namen sind »foo+bar« und »6var«.\n" " Diese Variablen sind global. Um eine Liste aktuell definierter " "Variablen\n" "zu sehen, benutzen Sie diesen Befehl: >\n" # type: Plain text #: usr_41.txt:150 #, no-wrap msgid "\t:let\n" msgstr "\t:let\n" # type: Plain text #: usr_41.txt:156 msgid "" "You can use global variables everywhere. This also means that when the " "variable \"count\" is used in one script file, it might also be used in " "another file. This leads to confusion at least, and real problems at " "worst. To avoid this, you can use a variable local to a script file by " "prepending \"s:\". For example, one script contains this code: >" msgstr "" "Sie können überall globale Variablen verwenden. Dies bedeutet auch, dass, " "wenn eine Variable »zaehler« in einer Skript-Datei benutzt wird, sie auch " "in einer andereren Datei benutzt werden könnte. Dies führt bestenfalls zu " "Verwirrung, schlimmstenfalls zu wirklichen Problemen. Um dies zu " "vermeiden, können Sie eine Variable lokal zu einem Skript verwenden, indem " "Sie »s:« voranstellen. Ein Skript enthält zum Beispiel diesen Code: >" # type: Plain text #: usr_41.txt:162 #, no-wrap msgid "" "\t:let s:count = 1\n" "\t:while s:count < 5\n" "\t: source other.vim\n" "\t: let s:count += 1\n" "\t:endwhile\n" msgstr "" "\t:let s:count = 1\n" "\t:while s:count < 5\n" "\t: source other.vim\n" "\t: let s:count += 1\n" "\t:endwhile\n" # type: Plain text #: usr_41.txt:167 msgid "" "Since \"s:count\" is local to this script, you can be sure that sourcing " "the " "\"other.vim\" script will not change this variable. If \"other.vim\" also " "uses an \"s:count\" variable, it will be a different copy, local to that " "script. More about script-local variables here: |script-variable|." msgstr "" "Weil »s:count« lokal zu diesem Skript ist, können Sie sicher sein, dass " "das Einlesen von »other.vim« diese Variable nicht verändert. Falls " "»other.vim« ebenfalls eine Variable »s:count« enthält, ist dies eine " "andere Einheit, lokal zu diesem Skript. Mehr über Variablen, die lokal zu " "einem Skript sind, unter: |script-variable|" # type: Plain text #: usr_41.txt:170 msgid "" "There are more kinds of variables, see |internal-variables|. The most " "often " "used ones are:" msgstr "" "Es gibt noch mehr Arten von Variablen, siehe |internal-variables|. Die am " "häufigsten gebrauchten sind:" # type: Plain text #: usr_41.txt:175 #, no-wrap msgid "" "\tb:name\t\tvariable local to a buffer\n" "\tw:name\t\tvariable local to a window\n" "\tg:name\t\tglobal variable (also in a function)\n" "\tv:name\t\tvariable predefined by Vim\n" msgstr "" "\tb:name\t\tVariable lokal zu einem Puffer\n" "\tw:name\t\tVariable lokal zu einem Fenster\n" "\tg:name\t\tglobale Variable (auch in einer Funktion)\n" "\tv:name\t\tvon Vim vordefinierte Variable\n" # type: Plain text #: usr_41.txt:178 msgid "DELETING VARIABLES" msgstr "VARIABLEN LöSCHEN" # type: Plain text #: usr_41.txt:181 msgid "" "Variables take up memory and show up in the output of the \":let\" " "command. " "To delete a variable use the \":unlet\" command. Example: >" msgstr "" "Variablen belegen Speicher und erscheinen in der Ausgabe des Befehls " "»:let«. Um eine Variable zu löschen, benutzen Sie den Befehl »:unlet«. " "Beispiel: >" # type: Plain text #: usr_41.txt:183 #, no-wrap msgid "\t:unlet s:count\n" msgstr "\t:unlet s:count\n" # type: Plain text #: usr_41.txt:187 msgid "" "This deletes the script-local variable \"s:count\" to free up the memory it " "uses. If you are not sure if the variable exists, and don't want an error " "message when it doesn't, append !: >" msgstr "" "Dies löscht die skript-lokale Variable »s:count« um den Speicher " "freizugeben, den sie belegt. Wenn Sie nicht sicher sind, ob die Variable " "existiert und Sie keine Fehlermeldung wollen, wenn sie es nicht tut, " "hängen Sie »!« an: >" # type: Plain text #: usr_41.txt:189 #, no-wrap msgid "\t:unlet! s:count\n" msgstr "\t:unlet! s:count\n" # type: Plain text #: usr_41.txt:193 msgid "" "When a script finishes, the local variables used there will not be " "automatically freed. The next time the script executes, it can still use " "the old value. Example: >" msgstr "" "Wenn ein Skript terminiert, werden die in ihm benutzten lokalen Variablen " "nicht automatisch freigegeben. Das nächste Mal, wenn das Skript " "ausgeführt wird, kann es immernoch den alten Wert benutzen. Beispiel: >" # type: Plain text #: usr_41.txt:199 #, no-wrap msgid "" "\t:if !exists(\"s:call_count\")\n" "\t: let s:call_count = 0\n" "\t:endif\n" "\t:let s:call_count = s:call_count + 1\n" "\t:echo \"called\" s:call_count \"times\"\n" msgstr "" "\t:if !exists(\"s:aufruf_zaehler\")\n" "\t: let s:aufruf_zaehler = 0\n" "\t:endif\n" "\t:let s:aufruf_zaehler = s:aufruf_zaehler + 1\n" "\t:echo s:aufruf_zaehler \"Male aufgerufen\"\n" # type: Plain text #: usr_41.txt:203 msgid "" "The \"exists()\" function checks if a variable has already been defined. " "Its argument is the name of the variable you want to check. Not the " "variable itself! If you would do this: >" msgstr "" "Die Funktion »exists()« prüft, ob eine Variable bereits definiert wurde. " "Ihr Argument ist der Name der Variablen, die man überprüfen will. Nicht " "die Variable selbst! Falls Sie dies tun würden: >" # type: Plain text #: usr_41.txt:205 #, no-wrap msgid "\t:if !exists(s:call_count)\n" msgstr "\t:if !exists(s:aufruf_zaehler)\n" # type: Plain text #: usr_41.txt:218 #, no-wrap msgid "" "Then the value of s:call_count will be used as the name of the variable " "that\n" "exists() checks. That's not what you want.\n" " The exclamation mark ! negates a value. When the value was true, it\n" "becomes false. When it was false, it becomes true. You can read it as " "\"not\".\n" "Thus \"if !exists()\" can be read as \"if not exists()\".\n" " What Vim calls true is anything that is not zero. Zero is false.\n" "\tNote:\n" "\tVim automatically converts a string to a number when it is looking for\n" "\ta number. When using a string that doesn't start with a digit the\n" "\tresulting number is zero. Thus look out for this: >\n" "\t\t:if \"true\"\n" "<\tThe \"true\" will be interpreted as a zero, thus as false!\n" msgstr "" "Dann wird der Wert von s:aufruf_zaehler als der Name der Variablen, die\n" "exists() überprüft, genommen. Das ist nicht, was Sie wollen.\n" " Das Ausrufezeichen ! negiert einen Wert. Wenn der Wert wahr war, wird " "er\n" "falsch. Wenn er falsch war, wird er wahr. Sie können es als »nicht« " "lesen.\n" "Also kann »if !exists()« als »if not exists()« gelesen werden.\n" " Was Vim als wahr betrachtet, ist alles, was nicht Null ist. Null ist\n" "falsch.\n" "\tAnmerkung:\n" "\tVim konvertiert eine Zeichenkette automatisch zu einer Zahl, wenn er\n" "\tnach einer Zahl sucht. Bei einer Zeichenkette, die nicht mit einer\n" "\tZiffer beginnt, ist die resultierende Zahl Null. Also geben Sie\n" "\thierauf acht: >\n" "\t\t:if \"true\"\n" ">\tDas »true« wird als Null interprätiert, also als falsch!\n" # type: Plain text #: usr_41.txt:221 msgid "STRING VARIABLES AND CONSTANTS" msgstr "ZEICHENKETTENVARIABLEN UND -KONSTANTEN" # type: Plain text #: usr_41.txt:228 #, no-wrap msgid "" "So far only numbers were used for the variable value. Strings can be used " "as\n" "well. Numbers and strings are the basic types of variables that Vim " "supports.\n" "The type is dynamic, it is set each time when assigning a value to the\n" "variable with \":let\". More about types in |41.8|.\n" " To assign a string value to a variable, you need to use a string " "constant.\n" "There are two types of these. First the string in double quotes: >\n" msgstr "" "So weit wurden nur Zahlen für den Variablenwert benutzt. Zeichenketten " "können\n" "auch benutzt werden. Zahlen und Zeichenketten sind die Grundtypen von\n" "Variablen, die Vim unterstützt. Der Typ ist dynamisch, er wird jedes Mal\n" "gesetzt, wenn der Variablen mit »:let« ein Wert zugewiesen wird. Mehr zu\n" "Typen in |41.8|.\n" " Um einer Variablen einen Zeichenkettenwert zuzuweisen, müssen Sie eine\n" "Zeichenkettenkonstante benutzen. Davon gibt es zwei Typen. Zuerst die\n" "Zeichenkette in doppelten Zitatzeichen: >\n" # type: Plain text #: usr_41.txt:232 #, no-wrap msgid "" "\t:let name = \"peter\"\n" "\t:echo name\n" "<\tpeter ~\n" msgstr "" "\t:let name = \"peter\"\n" "\t:echo name\n" "<\tpeter ~\n" # type: Plain text #: usr_41.txt:235 msgid "" "If you want to include a double quote inside the string, put a backslash in " "front of it: >" msgstr "" "Falls Sie ein doppeltes Zitatzeichen in die Zeichenkette einbeziehen " "wollen, stellen Sie ihm einen Rückwärtsschrägstrich voran: >" # type: Plain text #: usr_41.txt:239 #, no-wrap msgid "" "\t:let name = \"\\\"peter\\\"\"\n" "\t:echo name\n" "<\t\"peter\" ~\n" msgstr "" "\t:let name = \"\\\"peter\\\"\"\n" "\t:echo name\n" "<\t\"peter\" ~\n" # type: Plain text #: usr_41.txt:241 msgid "" "To avoid the need for a backslash, you can use a string in single quotes: >" msgstr "" "Um den Rückwärtsschrägstrich zu vermeiden, können Sie eine Zeichenkette in " "einfachen Zitatzeichen verwenden: >" # type: Plain text #: usr_41.txt:245 #, no-wrap msgid "" "\t:let name = '\"peter\"'\n" "\t:echo name\n" "<\t\"peter\" ~\n" msgstr "" "\t:let name = '\"peter\"'\n" "\t:echo name\n" "<\t\"peter\" ~\n" # type: Plain text #: usr_41.txt:252 #, no-wrap msgid "" "Inside a single-quote string all the characters are as they are. Only the\n" "single quote itself is special: you need to use two to get one. A " "backslash\n" "is taken literally, thus you can't use it to change the meaning of the\n" "character after it.\n" " In double-quote strings it is possible to use special characters. Here " "are\n" "a few useful ones:\n" msgstr "" "In einer Zeichenkette mit einfachen Zitatzeichen sind alle Zeichen wie sie\n" "sind. Nur das einzelne Zitatzeichen selbst ist besonders: Sie müssen zwei\n" "verwenden, um eins zu bekommen. Ein Rückwärtsschrägstrich wird wörtlich\n" "genommen, also können Sie ihn nicht benutzen, um die Bedeutung des " "Zeichens\n" "danach zu verändern.\n" " In Zeichenketten mit doppelten Zitatzeichen ist es möglich, besondere\n" "Zeichen zu verwenden. Hier sind ein Paar nützliche:\n" # type: Plain text #: usr_41.txt:262 #, no-wrap msgid "" "\t\\t\t\t\n" "\t\\n\t\t, line break\n" "\t\\r\t\t, \n" "\t\\e\t\t\n" "\t\\b\t\t, backspace\n" "\t\\\"\t\t\"\n" "\t\\\\\t\t\\, backslash\n" "\t\\\t\t\n" "\t\\\t\tCTRL-W\n" msgstr "" "\t\\t\t\t\n" "\t\\n\t\t, Zeilenumbruch\n" "\t\\r\t\t, \n" "\t\\e\t\t\t\t\\b\t\t, Backspace\n" "\t\\\"\t\t\"\n" "\t\\\\\t\t\\. Rückwärtsschrägstrich\n" "\t\\\t\t\n" "\t\\\t\tCTRL-W\n" # type: Plain text #: usr_41.txt:266 #, no-wrap msgid "" "The last two are just examples. The \"\\\" form can be used to " "include\n" "the special key \"name\".\n" " See |expr-quote| for the full list of special items in a string.\n" msgstr "" "Die letzten zwei sind nur Beispiele. Die Form »\\« kann benutzt " "werden,\n" "um die Sondertaste »name« einzubeziehen.\n" " Siehe |expr-quote| für die volle Liste besonderer Elemente in einer\n" "Zeichenkette.\n" # type: Plain text #: usr_41.txt:269 #, no-wrap msgid "*41.3*\tExpressions\n" msgstr "*41.3*\tAusdrücke\n" # type: Plain text #: usr_41.txt:276 #, no-wrap msgid "" "Vim has a rich, yet simple way to handle expressions. You can read the\n" "definition here: |expression-syntax|. Here we will show the most common\n" "items.\n" " The numbers, strings and variables mentioned above are expressions by\n" "themselves. Thus everywhere an expression is expected, you can use a " "number,\n" "string or variable. Other basic items in an expression are:\n" msgstr "" "Vim hat eine reichhaltige, aber dennoch einfache Weise, um Ausdrücke zu\n" "behandeln. Sie können die Definition hier lesen: |expression-syntax|. " "Hier\n" "werden wir die gebräuchlichsten zeigen.\n" " Die oben erwähnten Zahlen, Zeichenketten und Variablen sind selbst\n" "Ausdrücke. Also können Sie überall, wo ein Ausdruck erwartet wird, eine " "Zahl,\n" "Zeichenkette oder Variable verwenden. Andere Grundelemente in einem " "Ausdruck\n" "sind:\n" # type: Plain text #: usr_41.txt:280 #, no-wrap msgid "" "\t$NAME\t\tenvironment variable\n" "\t&name\t\toption\n" "\t@r\t\tregister\n" msgstr "" "\t$NAME\t\tUmgebungsvariable\n" "\t&name\t\tOption\n" "\t@r\t\tRegister\n" # type: Plain text #: usr_41.txt:282 msgid "Examples: >" msgstr "Beispiele: >" # type: Plain text #: usr_41.txt:286 #, no-wrap msgid "" "\t:echo \"The value of 'tabstop' is\" &ts\n" "\t:echo \"Your home directory is\" $HOME\n" "\t:if @a > 5\n" msgstr "" "\t:echo \"Der Wert von 'tabstop' ist\" &ts\n" "\t:echo \"Ihr Heimverzeichnis ist\" $HOME\n" "\t:if @a > 5\n" # type: Plain text #: usr_41.txt:289 msgid "" "The &name form can be used to save an option value, set it to a new value, " "do something and restore the old value. Example: >" msgstr "" "Die Form &name kann benutzt werden, um den Wert einer Option zwischen zu " "speichern, sie auf einen neuen Wert zu setzen, etwas zu tun und den alten " "Wert zu restaurieren. Beispiel: >" # type: Plain text #: usr_41.txt:294 #, no-wrap msgid "" "\t:let save_ic = &ic\n" "\t:set noic\n" "\t:/The Start/,$delete\n" "\t:let &ic = save_ic\n" msgstr "" "\t:let save_ic = &ic\n" "\t:set noic\n" "\t:/Der Beginn/,$delete\n" "\t:let &ic = save_ic\n" # type: Plain text #: usr_41.txt:298 msgid "" "This makes sure the \"The Start\" pattern is used with the 'ignorecase' " "option off. Still, it keeps the value that the user had set. (Another way " "to do this would be to add \"\\C\" to the pattern, see |/\\C|.)" msgstr "" "Dies stellt sicher, dass das Muster »Der Beginn« mit deaktivierter Option " "'ignorecase' benutzt wird. Jedoch behält es den Wert, den der Benutzer " "gesetzt hat. (Eine andere Möglichkeit, dies zu tun, wäre dem Suchmuster " "»\\C« hinzuzufügen, siehe |/\\C|.)" # type: Plain text #: usr_41.txt:301 msgid "MATHEMATICS" msgstr "MATHEMATIK" # type: Plain text #: usr_41.txt:304 msgid "" "It becomes more interesting if we combine these basic items. Let's start " "with mathematics on numbers:" msgstr "" "Es wird interessanter, wenn wir diese Grundelemente kombinieren. Lassen " "Sie " "uns mit Mathematik auf Zahlen beginnen" # type: Plain text #: usr_41.txt:310 #, no-wrap msgid "" "\ta + b\t\tadd\n" "\ta - b\t\tsubtract\n" "\ta * b\t\tmultiply\n" "\ta / b\t\tdivide\n" "\ta % b\t\tmodulo\n" msgstr "" "\ta + b\t\tAddition\n" "\ta - b\t\tSubtraktion\n" "\ta * b\t\tMultiplikation\n" "\ta / b\t\tDivision\n" "\ta % b\t\tModulo\n" # type: Plain text #: usr_41.txt:312 msgid "The usual precedence is used. Example: >" msgstr "Die gewöhnliche Präzedenz wird benutzt. Beispiel: >" # type: Plain text #: usr_41.txt:315 #, no-wrap msgid "" "\t:echo 10 + 5 * 2\n" "<\t20 ~\n" msgstr "" "\t:echo 10 + 5 * 2\n" "<\t20 ~\n" # type: Plain text #: usr_41.txt:317 msgid "Grouping is done with braces. No surprises here. Example: >" msgstr "Gruppierung mit Klammern. Keine Überraschungen hier. Beispiel: >" # type: Plain text #: usr_41.txt:320 #, no-wrap msgid "" "\t:echo (10 + 5) * 2\n" "<\t30 ~\n" msgstr "" "\t:echo (10 + 5) * 2\n" "<\t30 ~\n" # type: Plain text #: usr_41.txt:322 msgid "Strings can be concatenated with \".\". Example: >" msgstr "Zeichenketten können mit ».« verkettet werden. Beispiel: >" # type: Plain text #: usr_41.txt:325 #, no-wrap msgid "" "\t:echo \"foo\" . \"bar\"\n" "<\tfoobar ~\n" msgstr "" "\t:echo \"foo\" . \"bar\"\n" "<\tfoobar ~\n" # type: Plain text #: usr_41.txt:329 msgid "" "When the \":echo\" command gets multiple arguments, it separates them with " "a " "space. In the example the argument is a single expression, thus no space " "is " "inserted." msgstr "" "Wenn der Befehl »:echo« mehrere Argumente erhält, trennt er sie mit einem " "Leerzeichen. In diesem Beispiel ist das Argument ein einzelner Ausdruck, " "also wird kein Leerzeichen eingefügt." # type: Plain text #: usr_41.txt:331 msgid "Borrowed from the C language is the conditional expression:" msgstr "Aus der Sprache C entliehen ist der konditionale Ausdruck:" # type: Plain text #: usr_41.txt:333 #, no-wrap msgid "\ta ? b : c\n" msgstr "\ta ? b : c\n" # type: Plain text #: usr_41.txt:335 msgid "" "If \"a\" evaluates to true \"b\" is used, otherwise \"c\" is used. " "Example: " ">" msgstr "" "Falls »a« wahr ergibt, wird »b« verwandt, ansonsten wird »c« benutzt. " "Beispiel: >" # type: Plain text #: usr_41.txt:339 #, no-wrap msgid "" "\t:let i = 4\n" "\t:echo i > 5 ? \"i is big\" : \"i is small\"\n" "<\ti is small ~\n" msgstr "" "\t:let i = 4\n" "\t:echo i > 5 ? \"i is big\" : \"i is small\"\n" "<\ti is small ~\n" # type: Plain text #: usr_41.txt:342 msgid "" "The three parts of the constructs are always evaluated first, thus you " "could " "see it work as:" msgstr "" "Die drei Teile des Konstrukts werden immer zuerst berechnet, also könnten " "Sie als als das Folgende funktionieren sehen:" # type: Plain text #: usr_41.txt:344 #, no-wrap msgid "\t(a) ? (b) : (c)\n" msgstr "\t(a) ? (b) : (c)\n" # type: Plain text #: usr_41.txt:347 #, no-wrap msgid "*41.4*\tConditionals\n" msgstr "*41.4*\tBedingungen\n" # type: Plain text #: usr_41.txt:350 msgid "" "The \":if\" commands executes the following statements, until the matching " "\":endif\", only when a condition is met. The generic form is:" msgstr "" "Der Befehl »:if« führt die folgenden Anweisungen aus, bis zum " "übereinstimmenden »:endif«, nur wenn eine Bedingung erfüllt ist. Die " "generische Form ist:" # type: Plain text #: usr_41.txt:354 #, no-wrap msgid "" "\t:if {condition}\n" "\t {statements}\n" "\t:endif\n" msgstr "" "\t:if {bedingung}\n" "\t {anweisungen}\n" "\t:endif\n" # type: Plain text #: usr_41.txt:359 #, no-wrap msgid "" "Only when the expression {condition} evaluates to true (non-zero) will the\n" "{statements} be executed. These must still be valid commands. If they\n" "contain garbage, Vim won't be able to find the \":endif\".\n" " You can also use \":else\". The generic form for this is:\n" msgstr "" "Nur wenn der Ausdruck {bedingung} wahr (nicht-null) ergibt, werden die\n" "{anweisungen} ausgeführt. Dies müssen immer noch gültige Befehle sein. " "Falls\n" "sie Müll enthalten, ist es Vim nicht möglich, das »:endif« zu finden.\n" " Sie können auch »:else« verwenden. Die generische Form hierfür ist:\n" # type: Plain text #: usr_41.txt:365 #, no-wrap msgid "" "\t:if {condition}\n" "\t {statements}\n" "\t:else\n" "\t {statements}\n" "\t:endif\n" msgstr "" "\t:if {bedingung}\n" "\t {anweisungen}\n" "\t:else\n" "\t {anweisungen}\n" "\t:endif\n" # type: Plain text #: usr_41.txt:368 #, no-wrap msgid "" "The second {statements} is only executed if the first one isn't.\n" " Finally, there is \":elseif\":\n" msgstr "" "Der zweite Block {anweisungen} wird nur ausgeführt, wenn der erste nicht " "wird.\n" " Schließlich gibt es »:elseif«:\n" # type: Plain text #: usr_41.txt:374 #, no-wrap msgid "" "\t:if {condition}\n" "\t {statements}\n" "\t:elseif {condition}\n" "\t {statements}\n" "\t:endif\n" msgstr "" "\t:if {bedingung}\n" "\t {anweisungen}\n" "\t:elseif {bedingung}\n" "\t {anweisungen}\n" "\t:endif\n" # type: Plain text #: usr_41.txt:379 #, no-wrap msgid "" "This works just like using \":else\" and then \"if\", but without the need " "for an\n" "extra \":endif\".\n" " A useful example for your vimrc file is checking the 'term' option and\n" "doing something depending upon its value: >\n" msgstr "" "Dies funktioniert genauso, wie »:else« und dann »if« zu verwenden, aber " "ohne\n" "ein extra »:endif« zu benutzen.\n" " Ein nützliches Beispiel für Ihre vimrc ist, die Option 'term' zu " "prüfen,\n" "und abhängig von ihrem Wert etwas zu tun: >\n" # type: Plain text #: usr_41.txt:387 #, no-wrap msgid "" "\t:if &term == \"xterm\"\n" "\t: \" Do stuff for xterm\n" "\t:elseif &term == \"vt100\"\n" "\t: \" Do stuff for a vt100 terminal\n" "\t:else\n" "\t: \" Do something for other terminals\n" "\t:endif\n" msgstr "" "\t:if &term == \"xterm\"\n" "\t: \" Mache etwas für xterm\n" "\t:elseif &term == \"vt100\"\n" "\t: \" Mache etwas für ein VT100-Terminal\n" "\t:else\n" "\t: \" Mache etwas für andere Terminals\n" "\t:endif\n" # type: Plain text #: usr_41.txt:390 msgid "LOGIC OPERATIONS" msgstr "LOGISCHE OPERATIONEN" # type: Plain text #: usr_41.txt:393 msgid "" "We already used some of them in the examples. These are the most often " "used " "ones:" msgstr "" "Wir haben bereits einige in den Beispielen benutzt. Dies sind die am " "häufigsten verwandten:" # type: Plain text #: usr_41.txt:400 #, no-wrap msgid "" "\ta == b\t\tequal to\n" "\ta != b\t\tnot equal to\n" "\ta > b\t\tgreater than\n" "\ta >= b\t\tgreater than or equal to\n" "\ta < b\t\tless than\n" "\ta <= b\t\tless than or equal to\n" msgstr "" "\ta == b\t\tgleich\n" "\ta != b\t\tungleich\n" "\ta > b\t\tgrößer als\n" "\ta >= b\t\tgrößer als oder gleich\n" "\ta < b\t\tkleiner als\n" "\ta <= b\t\tkleiner als oder gleich\n" # type: Plain text #: usr_41.txt:402 msgid "" "The result is one if the condition is met and zero otherwise. An example: >" msgstr "" "Das Ergebnis ist eins, falls die Bedingung erfüllt ist, sonst null. Ein " "Beispiel: >" # type: Plain text #: usr_41.txt:408 #, no-wrap msgid "" "\t:if v:version >= 700\n" "\t: echo \"congratulations\"\n" "\t:else\n" "\t: echo \"you are using an old version, upgrade!\"\n" "\t:endif\n" msgstr "" "\t:if v:version >= 700\n" "\t: echo \"Gratulation\"\n" "\t:else\n" "\t: echo \"Sie benutzen eine alte Version. Aktualisieren Sie!\"\n" "\t:endif\n" # type: Plain text #: usr_41.txt:413 msgid "" "Here \"v:version\" is a variable defined by Vim, which has the value of the " "Vim version. 600 is for version 6.0. Version 6.1 has the value 601. This " "is very useful to write a script that works with multiple versions of " "Vim. |" "v:version|" msgstr "" "Hier ist »v:version« eine von Vim definierte Variable, die den Wert der " "Vim-Version hat. 600 ist für Version 6.0. Version 6.1 hat den Wert 601. " "Dies ist sehr nützlich beim Schreiben eines Skript, das mit verschiedenen " "Versionen von Vim funktionieren soll. |v:version|" # type: Plain text #: usr_41.txt:420 #, no-wrap msgid "" "The logic operators work both for numbers and strings. When comparing two\n" "strings, the mathematical difference is used. This compares byte values,\n" "which may not be right for some languages.\n" " When comparing a string with a number, the string is first converted to " "a\n" "number. This is a bit tricky, because when a string doesn't look like a\n" "number, the number zero is used. Example: >\n" msgstr "" "Die logischen Operatoren funktionieren sowohl für Zahlen wie auch für\n" "Zeichenketten. Beim Vergleich zweier Zeichenketten wird der mathematische\n" "Unterschied benutzt. Dies vergleicht Byte-Werte, was für manche Sprachen\n" "eventuell nicht richtig ist.\n" " Beim Vergleich einer Zeichenkette mit einer Zahl wird die Zeichenkette\n" "zuerst in eine Zahl verwandelt. Dies ist ein wenig verzwickt, wenn eine\n" "Zeichenkette nicht wie eine Zahl aussieht, wird die Zahl Null verwandt.\n" "Beispiel: >\n" # type: Plain text #: usr_41.txt:424 #, no-wrap msgid "" "\t:if 0 == \"one\"\n" "\t: echo \"yes\"\n" "\t:endif\n" msgstr "" "\t;if 0 == \"eins\"\n" "\t: echo \"ja\"\n" "\t:endif\n" # type: Plain text #: usr_41.txt:427 msgid "" "This will echo \"yes\", because \"one\" doesn't look like a number, thus it " "is converted to the number zero." msgstr "" "Dies gibt »ja« aus, weil »eins« nicht wie eine Zahl aussieht, es also zur " "Zahl Null konvertiert wird." # type: Plain text #: usr_41.txt:429 msgid "For strings there are two more items:" msgstr "Für Zeichenketten gibt es zwei weitere Elemente:" # type: Plain text #: usr_41.txt:432 #, no-wrap msgid "" "\ta =~ b\t\tmatches with\n" "\ta !~ b\t\tdoes not match with\n" msgstr "" "\ta =~ b\t\tstimmt mit überein\n" "\ta !~ b\t\tstimmt nicht mit überein\n" # type: Plain text #: usr_41.txt:435 msgid "" "The left item \"a\" is used as a string. The right item \"b\" is used as a " "pattern, like what's used for searching. Example: >" msgstr "" "Das linke Element »a« wird als Zeichenkette verwandt. Das rechte Element " "»b« wird als Muster benutzt, wie beim Suchen. Beispiel: >" # type: Plain text #: usr_41.txt:442 #, no-wrap msgid "" "\t:if str =~ \" \"\n" "\t: echo \"str contains a space\"\n" "\t:endif\n" "\t:if str !~ '\\.$'\n" "\t: echo \"str does not end in a full stop\"\n" "\t:endif\n" msgstr "" "\t:if str =~ \" \"\n" "\t: echo \"str enthält ein Leerzeichen\"\n" "\t:endif\n" "\t:if str !~ '\\.$'\n" "\t: echo \"str endet nicht mit einem Punkt\"\n" "\t:endif\n" # type: Plain text #: usr_41.txt:446 msgid "" "Notice the use of a single-quote string for the pattern. This is useful, " "because backslashes would need to be doubled in a double-quote string and " "patterns tend to contain many backslashes." msgstr "" "Beachten Sie den Gebrauch der einfach zitierten Zeichenkette. Dies ist " "nützlich, weil Rückwärtsschrägstriche in doppelt zitierten Zeichenketten " "verdoppelt werden müssten, und Muster dazu neigen, viele " "Rückwärtsschrägstriche zu enthalten." # type: Plain text #: usr_41.txt:452 msgid "" "The 'ignorecase' option is used when comparing strings. When you don't " "want " "that, append \"#\" to match case and \"?\" to ignore case. Thus \"==?\" " "compares two strings to be equal while ignoring case. And \"!~#\" checks " "if " "a pattern doesn't match, also checking the case of letters. For the full " "table see |expr-==|." msgstr "" "Die Option 'ignorecase' wird beim Vergleich von Zeichenketten benutzt. " "Wenn Sie dies nicht wollen, hängen Sie »#« an, für Übereinstimmung von " "Groß-/Kleinschreibung, und »?«, um dies zu ignorieren. Also vergleicht " "»==?« zwei Zeichenketten auf Gleichheit, während Groß-/Kleinschreibung " "ignoriert wird. Und »!~#« prüft, ob ein Muster nicht passt, auch " "Groß-/Kleinschreibung überprüfend. Für die volle Tabelle siehe |expr-==|." # type: Plain text #: usr_41.txt:455 msgid "MORE LOOPING" msgstr "MEHR ÜBER SCHLEIFEN" # type: Plain text #: usr_41.txt:458 msgid "" "The \":while\" command was already mentioned. Two more statements can be " "used in between the \":while\" and the \":endwhile\":" msgstr "" "Der Befehl »:while« wurde bereits erwähnt. Zwei weitere Anweisungen " "können zwischen dem »:while« und dem »:endwhile« benutzt werden:" # type: Plain text #: usr_41.txt:463 #, no-wrap msgid "" "\t:continue\t\tJump back to the start of the while loop; the\n" "\t\t\t\tloop continues.\n" "\t:break\t\t\tJump forward to the \":endwhile\"; the loop is\n" "\t\t\t\tdiscontinued.\n" msgstr "" "\t:continue\t\tSpringe zurück zum Beginn der While-Schleife;\n" "\t\t\t\tdie Schleife wird fortgesetzt.\n" "\t:break\t\t\tSpringe vorwärts zum »:endwhile«; die Schleife\n" "\t\t\t\twird abgebrochen.\n" # type: Plain text #: usr_41.txt:465 msgid "Example: >" msgstr "Beispiel: >" # type: Plain text #: usr_41.txt:476 #, no-wrap msgid "" "\t:while counter < 40\n" "\t: call do_something()\n" "\t: if skip_flag\n" "\t: continue\n" "\t: endif\n" "\t: if finished_flag\n" "\t: break\n" "\t: endif\n" "\t: sleep 50m\n" "\t:endwhile\n" msgstr "" "\t:while zaehler < 40\n" "\t: call tue_etwas()\n" "\t: if flag_ueberspringen\n" "\t: continue\n" "\t: endif\n" "\t: if flag_beendet\n" "\t: break\n" "\t: endif\n" "\t: sleep 50m\n" "\t:endwhile\n" # type: Plain text #: usr_41.txt:479 msgid "" "The \":sleep\" command makes Vim take a nap. The \"50m\" specifies fifty " "milliseconds. Another example is \":sleep 4\", which sleeps for four " "seconds." msgstr "" "Der Befehl »:sleep« lässt Vim ein Nickerchen machen. »50m« gibt fünzig " "Millisekunden an. Ein weiteres Beispiel ist »:sleep 4«, was für vier " "Sekunden schläft." # type: Plain text #: usr_41.txt:481 msgid "" "Even more looping can be done with the \":for\" command, see below in " "|41.8|." msgstr "" "Sogar noch mehr Schleifen können mit dem Befehl »:for« gemacht werden, " "siehe unten in |41.8|." # type: Plain text #: usr_41.txt:484 #, no-wrap msgid "*41.5*\tExecuting an expression\n" msgstr "*41.5*\tEinen Ausdruck ausführen\n" # type: Plain text #: usr_41.txt:489 #, no-wrap msgid "" "So far the commands in the script were executed by Vim directly. The\n" "\":execute\" command allows executing the result of an expression. This " "is a\n" "very powerful way to build commands and execute them.\n" " An example is to jump to a tag, which is contained in a variable: >\n" msgstr "" "So weit wurden die Befehle in dem Skript von Vim direkt ausgeführt. Der\n" "Befehl »:execute« erlaubt das Ausführen des Ergebnisses eines Ausdrucks. " "Dies\n" "ist eine sehr mächtige Möglichkeit, Befehle aufzubauen und sie ausführen " "zu\n" "lassen.\n" " Ein Beispiel ist ein Tag anzuspringen, das in einer Variablen enthalten\n" "ist: >\n" # type: Plain text #: usr_41.txt:491 #, no-wrap msgid "\t:execute \"tag \" . tag_name\n" msgstr "\t:execute \"tag \" . tag_name\n" # type: Plain text #: usr_41.txt:495 msgid "" "The \".\" is used to concatenate the string \"tag \" with the value of " "variable \"tag_name\". Suppose \"tag_name\" has the value \"get_cmd\", " "then " "the command that will be executed is: >" msgstr "" "Der ».« wird verwandt, um die Zeichenkette »tag « mit dem Wert der " "Variablen »tag_name« zu verketten. Angenommen, »tag_name« hat den Wert " "»get_cmd«, dann ist der ausgeführte Befehl: >" # type: Plain text #: usr_41.txt:497 #, no-wrap msgid "\t:tag get_cmd\n" msgstr "\t:tag get_cmd\n" # type: Plain text #: usr_41.txt:501 msgid "" "The \":execute\" command can only execute colon commands. The \":normal\" " "command executes Normal mode commands. However, its argument is not an " "expression but the literal command characters. Example: >" msgstr "" "Der Befehl »:execute« kann nur Doppelpunkt-Befehle ausführen. Der Befehl " "»:normal« führt Befehl des Normalmodus aus. Jedoch ist sein Argument kein " "Ausdruck, sondern die wörtlichen Befehlszeichen. Beispiel: >" # type: Plain text #: usr_41.txt:503 #, no-wrap msgid "\t:normal gg=G\n" msgstr "\t:normal gg=G\n" # type: Plain text #: usr_41.txt:507 #, no-wrap msgid "" "This jumps to the first line and formats all lines with the \"=\" " "operator.\n" " To make \":normal\" work with an expression, combine \":execute\" with " "it.\n" "Example: >\n" msgstr "" "Dies springt in die erste Zeile und formatiert alle Zeilen mit dem " "Operator\n" "»=«.\n" " Damit »:normal« mit einem Ausdruck funktioniert, kombinieren Sie\n" "»:execute« mit ihm. Beispiel: >\n" # type: Plain text #: usr_41.txt:509 #, no-wrap msgid "\t:execute \"normal \" . normal_commands\n" msgstr "\t:execute \"normal \" . normal_befehle\n" # type: Plain text #: usr_41.txt:514 #, no-wrap msgid "" "The variable \"normal_commands\" must contain the Normal mode commands.\n" " Make sure that the argument for \":normal\" is a complete command. " "Otherwise\n" "Vim will run into the end of the argument and abort the command. For " "example,\n" "if you start Insert mode, you must leave Insert mode as well. This works: " ">\n" msgstr "" "Die Variable »normal_befehle« muss die Normal-Modus-Befehle enthalten.\n" " Stellen Sie sicher, dass das Argument für »:normal« ein vollständiger\n" "Befehl ist. Ansonsten läuft Vim in das Ende des Arguments und führt den\n" "Befehl nicht aus. Falls Sie zum Beispiel den Einfüge-Modus starten, " "müssen\n" "Sie auch den Einfüge-Modus verlassen. Dies funktioniert: >\n" # type: Plain text #: usr_41.txt:516 #, no-wrap msgid "\t:execute \"normal Inew text \\\"\n" msgstr "\t:execute \"normal INeuer Text \\\"\n" # type: Plain text #: usr_41.txt:520 msgid "" "This inserts \"new text \" in the current line. Notice the use of the " "special key \"\\\". This avoids having to enter a real " "character " "in your script." msgstr "" "Dies fügt »Neuer Text « in der aktuellen Zeile ein. Beachten Sie den " "Gebrauch der Sondersequenz »\\«. Dies vermeidet, dass sie ein " "wirkliches -Zeichen in Ihr Skript einfügen müssen." # type: Plain text #: usr_41.txt:523 msgid "" "If you don't want to execute a string but evaluate it to get its expression " "value, you can use the eval() function: >" msgstr "" "Falls Sie eine Zeichenkette nicht ausführen, sondern auswerten möchten, um " "ihren Ausdruckswert zu bekommen, können Sie die Funktion eval() benutzen: >" # type: Plain text #: usr_41.txt:526 #, no-wrap msgid "" "\t:let optname = \"path\"\n" "\t:let optval = eval('&' . optname)\n" msgstr "" "\t:let optname = \"path\"\n" "\t:let optval = eval('&' . optname)\n" # type: Plain text #: usr_41.txt:531 #, no-wrap msgid "" "A \"&\" character is prepended to \"path\", thus the argument to eval() is\n" "\"&path\". The result will then be the value of the 'path' option.\n" " The same thing can be done with: >\n" "\t:exe 'let optval = &' . optname\n" msgstr "" "Ein »&«-Zeichen wird »path« vorangestellt, also ist das Argument für " "eval()\n" "»&path«. Das Ergebnis ist dann der Wert der Option 'path'.\n" " Dasselbe kann mit dem folgenden gemacht werden: >\n" "\t:exe 'let optval = &' . optname\n" # type: Plain text #: usr_41.txt:534 #, no-wrap msgid "*41.6*\tUsing functions\n" msgstr "*41.6*\tFunktionen benutzen\n" # type: Plain text #: usr_41.txt:538 msgid "" "Vim defines many functions and provides a large amount of functionality " "that " "way. A few examples will be given in this section. You can find the whole " "list here: |functions|." msgstr "" "Vim definiert viele Funktionen und bietet so einen großen Betrag an " "Funktionalität. Einige wenige Beispiele werden in diesem Abschnitt " "gegeben. Sie können die ganze Liste hier finden: |functions|." # type: Plain text #: usr_41.txt:541 msgid "" "A function is called with the \":call\" command. The parameters are passed " "in between braces, separated by commas. Example: >" msgstr "" "Eine Funktion wird mit dem Befehl »:call« aufgerufen. Die Parameter " "werden in Klammern übergeben, getrennt durch Kommata. Beispiel: >" # type: Plain text #: usr_41.txt:543 #, no-wrap msgid "\t:call search(\"Date: \", \"W\")\n" msgstr "\t:call search(\"Date: \", \"W\")\n" # type: Plain text #: usr_41.txt:548 msgid "" "This calls the search() function, with arguments \"Date: \" and \"W\". The " "search() function uses its first argument as a search pattern and the " "second " "one as flags. The \"W\" flag means the search doesn't wrap around the end " "of the file." msgstr "" "Dies ruft die Funktion search() auf, mit den Argumenten »Date: « und »W«. " "Die Funktion search() benutzt ihr erstes Argument als Suchmuster und das " "zweite als Flags. Das Kennzeichen »W« bedeutet, dass die Suche am Ende " "der Datei nicht an ihrem Beginn fortgesetzt werden soll (wrap around)." # type: Plain text #: usr_41.txt:550 msgid "A function can be called in an expression. Example: >" msgstr "Eine Funktion kann in einem Ausdruck aufgerufen werden. Beispiel: >" # type: Plain text #: usr_41.txt:554 #, no-wrap msgid "" "\t:let line = getline(\".\")\n" "\t:let repl = substitute(line, '\\a', \"*\", \"g\")\n" "\t:call setline(\".\", repl)\n" msgstr "" "\t:let zeile = getline(\".\")\n" "\t:let ersetzt = substitute(zeile, '\\a', \"*\", \"g\")\n" "\t:call setline(\".\", ersetzt)\n" # type: Plain text #: usr_41.txt:566 #, no-wrap msgid "" "The getline() function obtains a line from the current buffer. Its " "argument\n" "is a specification of the line number. In this case \".\" is used, which " "means\n" "the line where the cursor is.\n" " The substitute() function does something similar to the \":substitute\"\n" "command. The first argument is the string on which to perform the\n" "substitution. The second argument is the pattern, the third the " "replacement\n" "string. Finally, the last arguments are the flags.\n" " The setline() function sets the line, specified by the first argument, " "to a\n" "new string, the second argument. In this example the line under the " "cursor is\n" "replaced with the result of the substitute(). Thus the effect of the " "three\n" "statements is equal to: >\n" msgstr "" "Die Funktion getline() holt eine Zeile aus dem aktuellen Puffer. Ihr " "Argument\n" "ist eine Spezifikation der Zeilennummer. In diesem Falle wird ».« " "benutzt,\n" "was die Zeile meint, wo sich der Cursor befindet.\n" " Die Funktion substitute() tut etwas ähnliches wie der Befehl " "»:substitute«.\n" "Das erste Argument ist die Zeichenkette, auf der die Ersetzung stattfinden\n" "soll. Das zweite Argument ist das Muster, das dritte die\n" "Ersetzungszeichenkette. Schließlich sind die letzten Argumente die Flags.\n" " Die Funktion setline() setzt die Zeile, die durch das erste Argument\n" "spezifiziert wird, auf eine neue Zeichenkette, das zweite Argument. In " "diesem\n" "Beispiel wird die Zeile unter dem Cursor ersetzt durch das Ergebnis von\n" "substitute(). Also ist der Effekt der drei Anweisungen gleich: >\n" # type: Plain text #: usr_41.txt:568 #, no-wrap msgid "\t:substitute/\\a/*/g\n" msgstr "\t:substitute/\\a/*/g\n" # type: Plain text #: usr_41.txt:571 msgid "" "Using the functions becomes more interesting when you do more work before " "and after the substitute() call." msgstr "" "Die Funktionen benutzen wird interessanter, wenn Sie mehr Arbeit vor und " "nach dem Aufruf von substitute() erledigen." # type: Plain text #: usr_41.txt:574 #, no-wrap msgid "FUNCTIONS\t\t\t\t\t\t*function-list*\n" msgstr "FUNKTIONEN\t\t\t\t\t\t*function-list*\n" # type: Plain text #: usr_41.txt:578 msgid "" "There are many functions. We will mention them here, grouped by what they " "are used for. You can find an alphabetical list here: |functions|. Use " "CTRL-] on the function name to jump to detailed help on it." msgstr "" "Es gibt viele Funktionen. Wir werden Sie hier erwähnen, gruppiert nach " "ihrem Verwendungszweck. Sie können hier eine alphabetische Liste finden: " "|functions|. Benutzen Sie CTRL-] auf dem Funktionsnamen, um zu einer " "detailierten Hilfe zu ihr zu springen." # type: Plain text #: usr_41.txt:604 #, no-wrap msgid "" "String manipulation:\n" "\tnr2char()\t\tget a character by its ASCII value\n" "\tchar2nr()\t\tget ASCII value of a character\n" "\tstr2nr()\t\tconvert a string to a number\n" "\tprintf()\t\tformat a string according to % items\n" "\tescape()\t\tescape characters in a string with a '\\'\n" "\ttr()\t\t\ttranslate characters from one set to another\n" "\tstrtrans()\t\ttranslate a string to make it printable\n" "\ttolower()\t\tturn a string to lowercase\n" "\ttoupper()\t\tturn a string to uppercase\n" "\tmatch()\t\t\tposition where a pattern matches in a string\n" "\tmatchend()\t\tposition where a pattern match ends in a string\n" "\tmatchstr()\t\tmatch of a pattern in a string\n" "\tmatchlist()\t\tlike matchstr() and also return submatches\n" "\tstridx()\t\tfirst index of a short string in a long string\n" "\tstrridx()\t\tlast index of a short string in a long string\n" "\tstrlen()\t\tlength of a string\n" "\tsubstitute()\t\tsubstitute a pattern match with a string\n" "\tsubmatch()\t\tget a specific match in a \":substitute\"\n" "\tstrpart()\t\tget part of a string\n" "\texpand()\t\texpand special keywords\n" "\ticonv()\t\t\tconvert text from one encoding to another\n" "\tbyteidx()\t\tbyte index of a character in a string\n" "\trepeat()\t\trepeat a string multiple times\n" "\teval()\t\t\tevaluate a string expression\n" msgstr "" "\tnr2char()\t\tgibt ein Zeichen nach seinem ASCII-Wert\n" "\tchar2nr()\t\tgibt den ASCII-Wert eines Zeichens\n" "\tstr2nr()\t\tkonvertiert eine Zeichenkette in eine Zahl\n" "\tprintf()\t\tformatiert eine Zeichenkette nach %-Elementen\n" "\tescape()\t\tschützt Zeichen in einer Zeichenkette mit\n" "\t\t\t\teinem »\\«\n" "\ttr()\t\t\tübersetzt Zeichen von einer Menge in eine\n" "\t\t\t\tandere\n" "\tstrtrans()\t\tübersetzt eine Zeichenkette, um sie druckbar\n" "\t\t\t\tzu machen\n" "\ttolower()\t\tkonvertiert eine Zeichenkette in\n" "\t\t\t\tKleinbuchstaben\n" "\ttoupper()\t\tkonvertiert eine Zeichenkette in\n" "\t\t\t\tGroßbuchstaben\n" "\tmatch()\t\t\tPosition, wo ein Muster in einer Zeichenkette\n" "\t\t\t\tübereinstimmt\n" "\tmatchend()\t\tPostion, wo eine Musterübereinstimmung in\n" "\t\t\t\teiner Zeichenkette endet\n" "\tmatchstr()\t\tÜbereinstimmung eines Musters in einer\n" "\t\t\t\tZeichenkette\n" "\tmatchlist()\t\twie matchstr(), gibt auch\n" "\t\t\t\tUnterübereinstimmungen zurück\n" "\tstridx()\t\terster Index einer kurzen in einer langen\n" "\t\t\t\tZeichenkette\n" "\tstrridx()\t\tletzter Index einer kurzen in einer langen\n" "\t\t\t\tZeichenkette\n" "\tstrlen()\t\tLänge einer Zeichenkette\n" "\tsubstitute()\t\tersetze eine Musterübereinstimmung durch eine\n" "\t\t\t\tZeichenkette\n" "\tsubmatch\t\tliefert eine bestimmte Übereinstimmung in\n" "\t\t\t\teinem »:substitute«\n" "\tstrpart()\t\tliefert Teil einer Zeichenkette\n" "\texpand()\t\texpandiert besondere Schlüsselwörter\n" "\ticonv()\t\t\tkonvertiert Text von einer Kodierung\n" "\t\t\t\tin eine andere\n" "\tbyteidx()\t\tByte-Index eines Zeichens in einer Zeichenkette\n" "\trepeat()\t\twiederholt eine Zeichenkette mehrere Male\n" "\teval()\t\t\twertet einen Zeichenkettenausdruck aus\n" # type: Plain text #: usr_41.txt:629 #, no-wrap msgid "" "List manipulation:\n" "\tget()\t\t\tget an item without error for wrong index\n" "\tlen()\t\t\tnumber of items in a List\n" "\tempty()\t\t\tcheck if List is empty\n" "\tinsert()\t\tinsert an item somewhere in a List\n" "\tadd()\t\t\tappend an item to a List\n" "\textend()\t\tappend a List to a List\n" "\tremove()\t\tremove one or more items from a List\n" "\tcopy()\t\t\tmake a shallow copy of a List\n" "\tdeepcopy()\t\tmake a full copy of a List\n" "\tfilter()\t\tremove selected items from a List\n" "\tmap()\t\t\tchange each List item\n" "\tsort()\t\t\tsort a List\n" "\treverse()\t\treverse the order of a List\n" "\tsplit()\t\t\tsplit a String into a List\n" "\tjoin()\t\t\tjoin List items into a String\n" "\trange()\t\t\treturn a List with a sequence of numbers\n" "\tstring()\t\tString representation of a List\n" "\tcall()\t\t\tcall a function with List as arguments\n" "\tindex()\t\t\tindex of a value in a List\n" "\tmax()\t\t\tmaximum value in a List\n" "\tmin()\t\t\tminimum value in a List\n" "\tcount()\t\t\tcount number of times a value appears in a List\n" "\trepeat()\t\trepeat a List multiple times\n" msgstr "" "Listen-Manipulation:\n" "\tget()\t\t\tliefert ein Element ohne Fehler für falschen\n" "\t\t\t\tIndex\n" "\tlen()\t\t\tAnzahl Elemente in einer Liste\n" "\tempty()\t\t\tprüft, ob eine Liste leer ist\n" "\tinsert()\t\tfügt ein Element irgendwo in einer Liste ein\n" "\tadd()\t\t\thängt ein Element an eine Liste an\n" "\textend()\t\thängt eine Liste an eine Liste an\n" "\tremove()\t\tentfernt ein oder mehrere Elemente\n" "\t\t\t\taus einer Liste\n" "\tcopy()\t\t\tmacht eine oberflächliche Kopie einer Liste\n" "\tdeepcopy()\t\tmacht eine volle Kopie einer Liste\n" "\tfilter()\t\tentfernt ausgewählte Elemente einer Liste\n" "\tmap()\t\t\tändert jedes Listenelement\n" "\tsort()\t\t\tsortiert eine Liste\n" "\treverse()\t\tkehrt die Reihenfolge einer Liste um\n" "\tsplit()\t\t\tspaltet eine Zeichenkette in eine Liste\n" "\tjoin()\t\t\tfügt Listenelemente zu einer Zeichenkette\n" "\t\t\t\tzusammen\n" "\trange()\t\t\tgibt eine Liste mit einer Folge von Zahlen\n" "\t\t\t\tzurück\n" "\tstring()\t\tZeichenkettenrepräsentation einer Liste\n" "\tcall()\t\t\truft eine Funktion auf mit Liste als Argumente\n" "\tindex()\t\t\tIndex eines Werts in einer Liste\n" "\tmax()\t\t\tmaximaler Wert in einer Liste\n" "\tmin()\t\t\tminimaler Wert in einer Liste\n" "\tcount()\t\t\tzählt Anzahl, wie oft ein Wert in einer Liste\n" "\t\t\t\terscheint\n" "\trepeat()\t\twiederholt eine Liste mehrere Male\n" # type: Plain text #: usr_41.txt:648 #, no-wrap msgid "" "Dictionary manipulation:\n" "\tget()\t\t\tget an entry without an error for a wrong key\n" "\tlen()\t\t\tnumber of entries in a Dictionary\n" "\thas_key()\t\tcheck whether a key appears in a Dictionary\n" "\tempty()\t\t\tcheck if Dictionary is empty\n" "\tremove()\t\tremove an entry from a Dictionary\n" "\textend()\t\tadd entries from one Dictionary to another\n" "\tfilter()\t\tremove selected entries from a Dictionary\n" "\tmap()\t\t\tchange each Dictionary entry\n" "\tkeys()\t\t\tget List of Dictionary keys\n" "\tvalues()\t\tget List of Dictionary values\n" "\titems()\t\t\tget List of Dictionary key-value pairs\n" "\tcopy()\t\t\tmake a shallow copy of a Dictionary\n" "\tdeepcopy()\t\tmake a full copy of a Dictionary\n" "\tstring()\t\tString representation of a Dictionary\n" "\tmax()\t\t\tmaximum value in a Dictionary\n" "\tmin()\t\t\tminimum value in a Dictionary\n" "\tcount()\t\t\tcount number of times a value appears\n" msgstr "" "Wörterbuch-Manipulation:\n" "\tget()\t\t\tliefert einen Eintrag ohne einen Fehler\n" "\t\t\t\tfür einen falschen Schlüssel\n" "\tlen()\t\t\tAnzahl von Einträgen in einem Wörterbuch\n" "\thas_key()\t\tprüft, ob ein Schlüssel in einem Wörterbuch\n" "\t\t\t\terscheint\n" "\tempty()\t\t\tprüft, ob ein Wörterbuch leer ist\n" "\tremove()\t\tentfernt einen Eintrag aus einem Wörterbuch\n" "\textend()\t\tkopiert Einträge von einem Wörterbuch\n" "\t\t\t\tin ein anderes\n" "\tfilter()\t\tentfernt ausgewählte Einträge\n" "\t\t\t\taus einem Wörterbuch\n" "\tmap()\t\t\tändert jeden Wörterbuch-Eintrag\n" "\tkeys()\t\t\tliefert Liste von Wörterbuch-Schlüsseln\n" "\tvalues()\t\tliefert Liste von Wörterbuch-Werten\n" "\titems()\t\t\tliefert Liste von\n" "\t\t\t\tWörterbuch-Schlüssel-Wert-Paaren\n" "\tcopy()\t\t\tmacht eine oberflächliche Kopie\n" "\t\t\t\teines Wörterbuchs\n" "\tdeepcopy\t\tmacht eine volle Kopie eines Wörterbuchs\n" "\tstring()\t\tZeichenkettenrepräsentation eines Wörterbuchs\n" "\tmax()\t\t\tmaximaler Wert in einem Wörterbuch\n" "\tmin()\t\t\tminimaler Wert in einem Wörterbuch\n" "\tcount()\t\t\tAnzahl, wie oft ein Wert erscheint\n" # type: Plain text #: usr_41.txt:660 #, no-wrap msgid "" "Variables:\n" "\ttype()\t\t\ttype of a variable\n" "\tislocked()\t\tcheck if a variable is locked\n" "\tfunction()\t\tget a Funcref for a function name\n" "\tgetbufvar()\t\tget a variable value from a specific buffer\n" "\tsetbufvar()\t\tset a variable in a specific buffer\n" "\tgetwinvar()\t\tget a variable from specific window\n" "\tgettabwinvar()\t\tget a variable from specific window & tab page\n" "\tsetwinvar()\t\tset a variable in a specific window\n" "\tsettabwinvar()\t\tset a variable in a specific window & tab page\n" "\tgarbagecollect()\tpossibly free memory\n" msgstr "" "Variablen:\n" "\ttype()\t\t\tTyp einer Variablen\n" "\tislocked()\t\tprüft, ob eine Variable gelockt ist\n" "\tfunction()\t\tliefert eine Funktionsreferenz für einen\n" "\t\t\t\tFunktionsnamen\n" "\tgetbufvar()\t\tliefert einen Variablenwert aus einem\n" "\t\t\t\tbestimmten Puffer\n" "\tsetbufvar()\t\tsetzt eine Variable in einem bestimmten Puffer\n" "\tgetwinvar()\t\tliefert eine Variable aus einem bestimmten\n" "\t\t\t\tFenster\n" "\tgettabwinvar()\t\tliefert eine Variable für bestimmtes Fenster\n" "\t\t\t\tund Reiterseite\n" "\tsetwinvar()\t\tsetzt eine Variable in einem bestimmten\n" "\t\t\t\tFenster\n" "\tsettabwinvar()\t\tsetzt eine Variable für bestimmtes Fenster und\n" "\t\t\t\tReiterseite\n" "\tgarbagecollect()\tgibt möglicherweise Speicher frei\n" # type: Plain text #: usr_41.txt:673 #, no-wrap msgid "" "Cursor and mark position:\n" "\tcol()\t\t\tcolumn number of the cursor or a mark\n" "\tvirtcol()\t\tscreen column of the cursor or a mark\n" "\tline()\t\t\tline number of the cursor or mark\n" "\twincol()\t\twindow column number of the cursor\n" "\twinline()\t\twindow line number of the cursor\n" "\tcursor()\t\tposition the cursor at a line/column\n" "\tgetpos()\t\tget position of cursor, mark, etc.\n" "\tsetpos()\t\tset position of cursor, mark, etc.\n" "\tbyte2line()\t\tget line number at a specific byte count\n" "\tline2byte()\t\tbyte count at a specific line\n" "\tdiff_filler()\t\tget the number of filler lines above a line\n" msgstr "" "Cursor- und Markierungs-Position:\n" "\tcol()\t\t\tSpaltennummer von Cursor oder einer Markierung\n" "\tvirtcol()\t\tBildschirmspalte von Cursor oder einer\n" "\t\t\t\tMarkierung\n" "\tline()\t\t\tZeilennummer von Cursor oder einer Markierung\n" "\twincol()\t\tFensterspaltennummer des Cursors\n" "\twinline()\t\tFensterzeilennummer des Cursors\n" "\tcursor()\t\tpositioniert den Cursor auf einer Zeile/Spalte\n" "\tgetpos()\t\tliefert Position von Cursor, Markierung usw.\n" "\tsetpos()\t\tsetzt Position von Cursor, Markierung usw.\n" "\tbyte2line()\t\tliefert Zeilennummer bei einer bestimmten\n" "\t\t\t\tByte-Anzahl\n" "\tline2byte()\t\tByte-Anzahl bei einer bestimmten Zeile\n" "\tdiff_filler()\t\tliefert die Anzahl von Füllzeilen über einer\n" "\t\t\t\tZeile\n" # type: Plain text #: usr_41.txt:688 #, no-wrap msgid "" "Working with text in the current buffer:\n" "\tgetline()\t\tget a line or list of lines from the buffer\n" "\tsetline()\t\treplace a line in the buffer\n" "\tappend()\t\tappend line or list of lines in the buffer\n" "\tindent()\t\tindent of a specific line\n" "\tcindent()\t\tindent according to C indenting\n" "\tlispindent()\t\tindent according to Lisp indenting\n" "\tnextnonblank()\t\tfind next non-blank line\n" "\tprevnonblank()\t\tfind previous non-blank line\n" "\tsearch()\t\tfind a match for a pattern\n" "\tsearchpos()\t\tfind a match for a pattern\n" "\tsearchpair()\t\tfind the other end of a start/skip/end\n" "\tsearchpairpos()\t\tfind the other end of a start/skip/end\n" "\tsearchdecl()\t\tsearch for the declaration of a name\n" msgstr "" "Arbeiten mit dem Text im aktuellen Puffer:\n" "\tgetline()\t\tliefert eine Zeile oder Liste von Zeilen aus\n" "\t\t\t\tdem aktuellen Puffer\n" "\tsetline()\t\tersetzt eine Zeile im Puffer\n" "\tappend()\t\tfügt eine Zeile oder Liste von Zeilen im\n" "\t\t\t\tPuffer an\n" "\tindent()\t\tEinrückung einer bestimmten Zeile\n" "\tcindent()\t\trückt eine Zeile nach Einrückung für C ein\n" "\tlispindent()\t\trückt eine Zeile nach Einrückung für Lisp ein\n" "\tnextnonblank()\t\tfindet nächste nicht-leere Zeile\n" "\tprevnonblank()\t\tfindet vorige nicht-leere Zeile\n" "\tsearch()\t\tfindet eine Übereinstimmung für ein Muster\n" "\tsearchpos()\t\tfindet eine Übereinstimmung für ein Muster\n" "\tsearchpair()\t\tfindet das andere Ende eines Start/Skip/End\n" "\tsearchpairpos()\t\tfindet das andere Ende eines Start/Skip/End\n" "\tsearchdecl()\t\tsucht nach der Deklaration eines Namens\n" # type: Plain text #: usr_41.txt:715 #, no-wrap msgid "" "System functions and manipulation of files:\n" "\tglob()\t\t\texpand wildcards\n" "\tglobpath()\t\texpand wildcards in a number of directories\n" "\tfindfile()\t\tfind a file in a list of directories\n" "\tfinddir()\t\tfind a directory in a list of directories\n" "\tresolve()\t\tfind out where a shortcut points to\n" "\tfnamemodify()\t\tmodify a file name\n" "\tpathshorten()\t\tshorten directory names in a path\n" "\tsimplify()\t\tsimplify a path without changing its meaning\n" "\texecutable()\t\tcheck if an executable program exists\n" "\tfilereadable()\t\tcheck if a file can be read\n" "\tfilewritable()\t\tcheck if a file can be written to\n" "\tgetfperm()\t\tget the permissions of a file\n" "\tgetftype()\t\tget the kind of a file\n" "\tisdirectory()\t\tcheck if a directory exists\n" "\tgetfsize()\t\tget the size of a file\n" "\tgetcwd()\t\tget the current working directory\n" "\thaslocaldir()\t\tcheck if current window used |:lcd|\n" "\ttempname()\t\tget the name of a temporary file\n" "\tmkdir()\t\t\tcreate a new directory\n" "\tdelete()\t\tdelete a file\n" "\trename()\t\trename a file\n" "\tsystem()\t\tget the result of a shell command\n" "\thostname()\t\tname of the system\n" "\treadfile()\t\tread a file into a List of lines\n" "\twritefile()\t\twrite a List of lines into a file\n" msgstr "" "Systemfunktionen und Manipulation von Dateien:\n" "\tglob()\t\t\texpandiere Wildcards\n" "\tglobpath()\t\texpandiere Wildcards in einer Reihe von\n" "\t\t\t\tVerzeichnissen\n" "\tfindfile()\t\tfindet eine Datei in einer Liste von\n" "\t\t\t\tVerzeichnissen\n" "\tfinddir()\t\tfindet ein Verzeichnis in einer Liste von\n" "\t\t\t\tVerzeichnissen\n" "\tresolve()\t\tfindet heraus, wohin ein Shortcut zeigt\n" "\tfnamemodify()\t\tmodifiziert einen Dateinamen\n" "\tpathshorten()\t\tverkürzt Verzeichnisnamen in einem Pfad\n" "\tsimplify()\t\tvereinfacht einen Pfad, ohne seine Bedeutung\n" "\t\t\t\tzu verändern\n" "\texecutable()\t\tprüft, ob ein ausführbares Programm existiert\n" "\tfilereadable()\t\tprüft, ob eine Datei gelesen werden kann\n" "\tfilewritable()\t\tprüft, ob in eine Datei geschrieben werden kann\n" "\tgetfperm()\t\tliefert die Zugriffsrechte einer Datei\n" "\tgetftype()\t\tliefert die Art einer Datei\n" "\tisdirectory()\t\tprüft, ob ein Verzeichnis existiert\n" "\tgetfsize()\t\tliefert die Größe einer Datei\n" "\tgetcwd()\t\tliefert das aktuelle Arbeitsverzeichnis\n" "\thaslocaldir()\t\tprüft, ob das aktuelle Fenster |:lcd| benutzt\n" "\t\t\t\that\n" "\ttempname()\t\tliefert den Namen einer temporären Datei\n" "\tmkdir()\t\t\terzeugt ein neues Verzeichnis\n" "\tdelete()\t\tlöscht eine Datei\n" "\trename()\t\tbenennt eine Datei um\n" "\tsystem()\t\tliefert das Ergebnis eines Shell-Befehls\n" "\thostname()\t\tRechnername\n" "\treadfile()\t\tlese eine Datei in eine Liste von Zeilen\n" "\twritefile()\t\tschreibe eine Liste von Zeilen in eine Datei\n" # type: Plain text #: usr_41.txt:722 #, no-wrap msgid "" "Date and Time:\n" "\tgetftime()\t\tget last modification time of a file\n" "\tlocaltime()\t\tget current time in seconds\n" "\tstrftime()\t\tconvert time to a string\n" "\treltime()\t\tget the current or elapsed time accurately\n" "\treltimestr()\t\tconvert reltime() result to a string\n" msgstr "" "Datum und Zeit:\n" "\tgetftime()\t\tliefert Zeit der letzten Modifikation\n" "\t\t\t\teiner Datei\n" "\tlocaltime()\t\tliefert aktuelle Zeit in Sekunden\n" "\tstrftime()\t\tkonvertiert Zeit in eine Zeichenkette\n" "\treltime()\t\tliefert die aktuelle oder vergangene Zeit\n" "\t\t\t\takkurat\n" "\treltimestr()\t\tkonvertiert Ergebnis von reltime() in eine\n" "\t\t\t\tZeichenkette\n" # type: Plain text #: usr_41.txt:739 #, no-wrap msgid "" "Buffers, windows and the argument list:\n" "\targc()\t\t\tnumber of entries in the argument list\n" "\targidx()\t\tcurrent position in the argument list\n" "\targv()\t\t\tget one entry from the argument list\n" "\tbufexists()\t\tcheck if a buffer exists\n" "\tbuflisted()\t\tcheck if a buffer exists and is listed\n" "\tbufloaded()\t\tcheck if a buffer exists and is loaded\n" "\tbufname()\t\tget the name of a specific buffer\n" "\tbufnr()\t\t\tget the buffer number of a specific buffer\n" "\ttabpagebuflist()\treturn List of buffers in a tab page\n" "\ttabpagenr()\t\tget the number of a tab page\n" "\ttabpagewinnr()\t\tlike winnr() for a specified tab page\n" "\twinnr()\t\t\tget the window number for the current window\n" "\tbufwinnr()\t\tget the window number of a specific buffer\n" "\twinbufnr()\t\tget the buffer number of a specific window\n" "\tgetbufline()\t\tget a list of lines from the specified buffer\n" msgstr "" "Puffer, Fenster und die Argumentenliste:\n" "\targc()\t\t\tAnzahl von Einträgen in der Argumentenliste\n" "\targidx()\t\taktuelle Position in der Argumentenliste\n" "\targv()\t\t\tliefert einen Eintrag aus der Argumentenliste\n" "\tbufexists()\t\tprüft, ob ein Puffer existiert\n" "\tbuflisted()\t\tprüft, ob ein Puffer existiert und gelistet ist\n" "\tbufloaded()\t\tprüft, ob ein Puffer existiert und geladen ist\n" "\tbufname()\t\tliefert den Namen eines bestimmten Puffers\n" "\tbufnr()\t\t\tliefert die Puffernummer eines bestimmten\n" "\t\t\t\tPuffers\n" "\ttabpagebuflist()\tgibt eine Liste der Puffer in einer\n" "\t\t\t\tReiterseite zurück\n" "\ttabpagenr()\t\tliefert die Nummer einer Reiterseite\n" "\ttabpagewinnr()\t\twie winnr() für eine bestimmte Reiterseite\n" "\twinnr()\t\t\tliefert die Fensternummer für das aktuelle\n" "\t\t\t\tFenster\n" "\tbufwinnr()\t\tliefert die Fensternummer eines bestimmten\n" "\t\t\t\tPuffers\n" "\twinbufnr()\t\tliefert die Puffernummer eines bestimmten\n" "\t\t\t\tFensters\n" "\tgetbufline()\t\tliefert eine Liste von Zeilen aus dem\n" "\t\t\t\tbestimmten Puffer\n" # type: Plain text #: usr_41.txt:745 #, no-wrap msgid "" "Command line:\n" "\tgetcmdline()\t\tget the current command line\n" "\tgetcmdpos()\t\tget position of the cursor in the command line\n" "\tsetcmdpos()\t\tset position of the cursor in the command line\n" "\tgetcmdtype()\t\treturn the current command-line type\n" msgstr "" "Befehlszeile:\n" "\tgetcmdline()\t\tliefert die aktuelle Befehlszeile\n" "\tgetcmdpos()\t\tliefert Position des Cursors in der Befehlszeile\n" "\tsetcmdpos()\t\tsetzt Position des Cursors in der Befehlszeile\n" "\tgetcmdtype()\t\tgibt den Typ der aktuellen Befehlszeile zurück\n" # type: Plain text #: usr_41.txt:751 #, no-wrap msgid "" "Quickfix and location lists:\n" "\tgetqflist()\t\tlist of quickfix errors\n" "\tsetqflist()\t\tmodify a quickfix list\n" "\tgetloclist()\t\tlist of location list items\n" "\tsetloclist()\t\tmodify a location list\n" msgstr "" "Quickfix und Lokationslisten:\n" "\tgetqflist()\t\tListe von Quickfix-Fehlern\n" "\tsetqflist()\t\tmodifiziere eine Quickfix-Liste\n" "\tgetloclist()\t\tListe von Lokationslisten-Elementen\n" "\tsetloclist()\t\tmodifiziere eine Lokationsliste\n" # type: Plain text #: usr_41.txt:757 #, no-wrap msgid "" "Insert mode completion:\n" "\tcomplete()\t\tset found matches\n" "\tcomplete_add()\t\tadd to found matches\n" "\tcomplete_check()\tcheck if completion should be aborted\n" "\tpumvisible()\t\tcheck if the popup menu is displayed\n" msgstr "" "Vervollständigung im Einfügemodus:\n" "\tcomplete()\t\tsetzt gefundene Übereinstimmungen\n" "\tcomplete_add()\t\tfügt zu gefundenen Übereinstimmungen hinzu\n" "\tcomplete_check()\tprüft, ob Vervollständigung abgebrochen werden\n" "\t\t\t\tsollte\n" "\tpumvisible()\t\tprüft, ob das Aufklapp-Menü angezeigt wird\n" # type: Plain text #: usr_41.txt:764 #, no-wrap msgid "" "Folding:\n" "\tfoldclosed()\t\tcheck for a closed fold at a specific line\n" "\tfoldclosedend()\t\tlike foldclosed() but return the last line\n" "\tfoldlevel()\t\tcheck for the fold level at a specific line\n" "\tfoldtext()\t\tgenerate the line displayed for a closed fold\n" "\tfoldtextresult()\tget the text displayed for a closed fold\n" msgstr "" "Falten:\n" "\tfoldclosed()\t\tprüft auf eine geschlossene Faltung in einer\n" "\t\t\t\tbestimmten Zeile\n" "\tfoldclosedend()\t\twie foldclosed(), aber gibt die letzte Zeile\n" "\t\t\t\tzurück\n" "\tfoldlevel()\t\tprüft auf die Faltungsebene in einer\n" "\t\t\t\tbestimmten Zeile\n" "\tfoldtext()\t\terzeugt die für eine geschlossene Faltung\n" "\t\t\t\tangezeigte Zeile\n" "\tfoldtextresult()\tliefert den für eine geschlossene Faltung\n" "\t\t\t\tangezeigten Text\n" # type: Plain text #: usr_41.txt:782 #, no-wrap msgid "" "Syntax and highlighting:\n" "\tclearmatches()\t\tclear all matches defined by |matchadd()| and\n" "\t\t\t\tthe |:match| commands\n" "\tgetmatches()\t\tget all matches defined by |matchadd()| and\n" "\t\t\t\tthe |:match| commands\n" "\thlexists()\t\tcheck if a highlight group exists\n" "\thlID()\t\t\tget ID of a highlight group\n" "\tsynID()\t\t\tget syntax ID at a specific position\n" "\tsynIDattr()\t\tget a specific attribute of a syntax ID\n" "\tsynIDtrans()\t\tget translated syntax ID\n" "\tdiff_hlID()\t\tget highlight ID for diff mode at a position\n" "\tmatchadd()\t\tdefine a pattern to highlight (a \"match\")\n" "\tmatcharg()\t\tget info about |:match| arguments\n" "\tmatchdelete()\t\tdelete a match defined by |matchadd()| or a\n" "\t\t\t\t|:match| command\n" "\tsetmatches()\t\trestore a list of matches saved by\n" "\t\t\t\t|getmatches()|\n" msgstr "" "Syntax und Hervorhebung:\n" "\tclearmatches()\t\tlöscht alle von |matchadd()| und den |:match|-\n" "\t\t\t\tBefehlen definierte Übereinstimmungen\n" "\tgetmatches()\t\tholt alle von |matchadd()| und den |:match|-\n" "\t\t\t\tBefehlen definierten Übereinstimmungen\n" "\thlexists()\t\tprüft, ob eine Hervorhebungsgruppe existiert\n" "\thlID()\t\t\tliefert ID einer Hervorhebungsgruppe\n" "\tsynID()\t\t\tliefert Syntax-ID an einer bestimmten Position\n" "\tsynIDattr()\t\tliefert ein bestimmtes Attribut einer Syntax-ID\n" "\tsynIDtrans()\t\tliefert übersetzte Syntax-ID\n" "\tdiff_hlID()\t\tliefert Hervorhebungs-ID für den Diff-Modus\n" "\t\t\t\tan einer Position\n" "\tmatcharg()\t\tliefert Informationen über Argumente\n" "\t\t\t\tvon |:match|\n" "\tmatchdelete()\t\tlöscht eine von |matchadd()| oder den |:match|-\n" "\t\t\t\tBefehlen definierte Übereinstimmungen\n" "\tsetmatches()\t\tstellt eine von |getmatches()| gespeicherte\n" "\t\t\t\tListe von Übereinstimmungen wieder her\n" # type: Plain text #: usr_41.txt:787 #, no-wrap msgid "" "Spelling:\n" "\tspellbadword()\t\tlocate badly spelled word at or after cursor\n" "\tspellsuggest()\t\treturn suggested spelling corrections\n" "\tsoundfold()\t\treturn the sound-a-like equivalent of a word\n" msgstr "" "Rechtschreibkontrolle:\n" "\tspellbadword()\t\tlokalisiert falsch geschriebenes Wort am\n" "\t\t\t\toder nach dem Cursor\n" "\tspellsuggest()\t\tliefert vorgeschlagene Schreibungskorrekturen\n" "\t\t\t\tzurück\n" "\tsoundfold()\t\tliefert die ähnlich klingende Entsprechung\n" "\t\t\t\teines Wortes zurück\n" # type: Plain text #: usr_41.txt:793 #, no-wrap msgid "" "History:\n" "\thistadd()\t\tadd an item to a history\n" "\thistdel()\t\tdelete an item from a history\n" "\thistget()\t\tget an item from a history\n" "\thistnr()\t\tget highest index of a history list\n" msgstr "" "Verläufe:\n" "\thistadd()\t\tfügt ein Element einem Verlauf hinzu\n" "\thistdel()\t\tlöscht ein Element aus einem Verlauf\n" "\thistget()\t\tliefert ein Element aus einem Verlauf\n" "\thistnr()\t\tliefert den höchsten Index einer Verlaufsliste\n" # type: Plain text #: usr_41.txt:806 #, no-wrap msgid "" "Interactive:\n" "\tbrowse()\t\tput up a file requester\n" "\tbrowsedir()\t\tput up a directory requester\n" "\tconfirm()\t\tlet the user make a choice\n" "\tgetchar()\t\tget a character from the user\n" "\tgetcharmod()\t\tget modifiers for the last typed character\n" "\tinput()\t\t\tget a line from the user\n" "\tinputlist()\t\tlet the user pick an entry from a list\n" "\tinputsecret()\t\tget a line from the user without showing it\n" "\tinputdialog()\t\tget a line from the user in a dialog\n" "\tinputsave()\t\tsave and clear typeahead\n" "\tinputrestore()\t\trestore typeahead\n" msgstr "" "Interaktiv:\n" "\tbrowse()\t\tstellt eine Datei-Anfrage zur Verfügung\n" "\tbrowsedir()\t\tstellt eine Verzeichnis-Anfrage zur Verfügung\n" "\tconfirm()\t\tlässt den Benutzer eine Auswahl machen\n" "\tgetchar()\t\tholt ein Zeichen vom Benutzer\n" "\tgetcharmod()\t\tliefert die Modifikatoren für das letzte\n" "\t\t\t\teingegebene Zeichen\n" "\tinput()\t\t\tholt eine Zeile vom Benutzer\n" "\tinputlist()\t\tlässt den Benutzer einen Eintrag aus einer\n" "\t\t\t\tListe auswählen\n" "\tinputsecret()\t\tholt eine Zeile vom Benutzer ohne sie\n" "\t\t\t\tanzuzeigen\n" "\tinputdialog()\t\tholt eine Zeile vom Benutzer in einem Dialog\n" "\tinputsave()\t\tspeichert und löscht Vorauseingabe\n" "\tinputrestore()\t\tstellt die Vorauseingabe wieder her\n" # type: Plain text #: usr_41.txt:811 #, no-wrap msgid "" "GUI:\n" "\tgetfontname()\t\tget name of current font being used\n" "\tgetwinposx()\t\tX position of the GUI Vim window\n" "\tgetwinposy()\t\tY position of the GUI Vim window\n" msgstr "" "GUI:\n" "\tgetfontname()\t\tliefert den Namen des aktuell benutzten\n" "\t\t\t\tSchriftstils\n" "\tgetwinposx()\t\tX-Position des GUI-Vim-Fensters\n" "\tgetwinposy()\t\tY-Position des GUI-Vim-Fensters\n" # type: Plain text #: usr_41.txt:821 #, no-wrap msgid "" "Vim server:\n" "\tserverlist()\t\treturn the list of server names\n" "\tremote_send()\t\tsend command characters to a Vim server\n" "\tremote_expr()\t\tevaluate an expression in a Vim server\n" "\tserver2client()\t\tsend a reply to a client of a Vim server\n" "\tremote_peek()\t\tcheck if there is a reply from a Vim server\n" "\tremote_read()\t\tread a reply from a Vim server\n" "\tforeground()\t\tmove the Vim window to the foreground\n" "\tremote_foreground()\tmove the Vim server window to the foreground\n" msgstr "" "Vim-Server:\n" "\tserverlist()\t\tgibt eine Liste von Server-Namen zurück\n" "\tremote_send()\t\tsendet Befehlszeichen an einen Vim-Server\n" "\tremote_expr()\t\twertet einen Ausdruck in einem Vim-Server aus\n" "\tserver2client()\t\tsendet eine Antwort an einen Client eines\n" "\t\t\t\tVim-Servers\n" "\tremote_peek()\t\tprüft, ob es eine Antwort von einem Vim-Server\n" "\t\t\t\tgibt\n" "\tremote_read()\t\tliest eine Antwort von einem Vim-Server\n" "\tforeground()\t\tbewegt das Vim-Fenster in den Vordergrund\n" "\tremote_foreground()\tbewegt das Fenster des Vim-Servers in den\n" "\t\t\t\tVordergrund\n" # type: Plain text #: usr_41.txt:828 #, no-wrap msgid "" "Window size and position:\n" "\twinheight()\t\tget height of a specific window\n" "\twinwidth()\t\tget width of a specific window\n" "\twinrestcmd()\t\treturn command to restore window sizes\n" "\twinsaveview()\t\tget view of current window\n" "\twinrestview()\t\trestore saved view of current window\n" msgstr "" "Fenster-Größe und -Position:\n" "\twinheight()\t\tliefert die Höhe eines bestimmten Fensters\n" "\twinwidth()\t\tliefert die Breite eines bestimmten Fensters\n" "\twinrestcmd()\t\tgibt Befehl zurück, um Fenstergrößen\n" "\t\t\t\twiederherzustellen\n" "\twinsaveview()\t\tliefert Ansicht des aktuellen Fensters\n" "\twinrestview()\t\tstellt gespeicherte Ansicht des aktuellen\n" "\t\t\t\tFensters wieder her\n" # type: Plain text #: usr_41.txt:841 #, no-wrap msgid "" "Various:\n" "\tmode()\t\t\tget current editing mode\n" "\tvisualmode()\t\tlast visual mode used\n" "\thasmapto()\t\tcheck if a mapping exists\n" "\tmapcheck()\t\tcheck if a matching mapping exists\n" "\tmaparg()\t\tget rhs of a mapping\n" "\texists()\t\tcheck if a variable, function, etc. exists\n" "\thas()\t\t\tcheck if a feature is supported in Vim\n" "\tchangenr()\t\treturn number of most recent change\n" "\tcscope_connection()\tcheck if a cscope connection exists\n" "\tdid_filetype()\t\tcheck if a FileType autocommand was used\n" "\teventhandler()\t\tcheck if invoked by an event handler\n" msgstr "" "Verschiedenes:\n" "\tmode()\t\t\tliefert aktuelle Editiermodus\n" "\tvisualmode()\t\tder letzte benutzte visuelle Modus\n" "\thasmapto()\t\tprüft, ob eine Belegung existiert\n" "\tmapcheck()\t\tprüft, ob eine passende Belegung existiert\n" "\tmaparg()\t\tliefert die rechte Seite einer Belegung\n" "\texists()\t\tprüft, ob eine Variable, Funktion usw.\n" "\t\t\t\texistiert\n" "\thas()\t\t\tprüft, ob ein Feature von Vim unterstützt wird\n" "\tchangenr()\t\tgibt die Nummer der letzten Änderung zurück\n" "\tcscope_connection()\tprüft, ob eine CScope-Anbindung existiert\n" "\tdid_filetype()\t\tprüft, ob ein automatischer Befehl eines\n" "\t\t\t\tDateityps benutzt wurde\n" "\teventhandler()\t\tprüft, ob von einem Ereignis-Behandler\n" "\t\t\t\taufgerufen wurde\n" # type: Plain text #: usr_41.txt:844 #, no-wrap msgid "" "\tlibcall()\t\tcall a function in an external library\n" "\tlibcallnr()\t\tidem, returning a number\n" msgstr "" "\tlibcall()\t\truft eine Funktion in einer externen\n" "\t\t\t\tBibliothek auf\n" "\tlibcallnr()\t\tebenso, gibt eine Zahl zurück\n" # type: Plain text #: usr_41.txt:848 #, no-wrap msgid "" "\tgetreg()\t\tget contents of a register\n" "\tgetregtype()\t\tget type of a register\n" "\tsetreg()\t\tset contents and type of a register\n" msgstr "" "\tgetreg()\t\tliefert Inhalt eines Registers\n" "\tgetregtype()\t\tliefert Typ eines Registers\n" "\tsetreg()\t\tsetzt Inhalt und Typ eines Registers\n" # type: Plain text #: usr_41.txt:851 #, no-wrap msgid "" "\ttaglist()\t\tget list of matching tags\n" "\ttagfiles()\t\tget a list of tags files\n" msgstr "" "\ttaglist()\t\tliefert Liste passender Tags\n" "\ttagfiles()\t\tliefert Liste von Tag-Dateien\n" # type: Plain text #: usr_41.txt:854 #, no-wrap msgid "*41.7*\tDefining a function\n" msgstr "*41.7*\tEine Funktion definieren\n" # type: Plain text #: usr_41.txt:857 msgid "" "Vim enables you to define your own functions. The basic function " "declaration begins as follows: >" msgstr "" "Vim ermöglicht es Ihnen, eigene Funktionen zu definieren. Die " "grundlegende Funktions-Deklaration beginnt wie folgt: >" # type: Plain text #: usr_41.txt:864 #, no-wrap msgid "" "\t:function {name}({var1}, {var2}, ...)\n" "\t: {body}\n" "\t:endfunction\n" "<\n" "\tNote:\n" "\tFunction names must begin with a capital letter.\n" msgstr "" "\t:function {name}({var1}, {var2}, ...)\n" "\t: {body}\n" "\t:endfunction\n" "<\n" "\tAnmerkung:\n" "\tFunktions-Namen müssen mit einem Großbuchstaben beginnen.\n" # type: Plain text #: usr_41.txt:867 msgid "" "Let's define a short function to return the smaller of two numbers. It " "starts with this line: >" msgstr "" "Lassen Sie uns eine kurze Funktion definieren, die die kleinere von zwei " "Zahlen zurückgibt. Sie beginnt mit dieser Zeile: >" # type: Plain text #: usr_41.txt:869 #, no-wrap msgid "\t:function Min(num1, num2)\n" msgstr "\t:function Min(num1, num2)\n" # type: Plain text #: usr_41.txt:875 #, no-wrap msgid "" "This tells Vim that the function is named \"Min\" and it takes two " "arguments:\n" "\"num1\" and \"num2\".\n" " The first thing you need to do is to check to see which number is " "smaller:\n" " >\n" "\t: if a:num1 < a:num2\n" msgstr "" "Dies sagt Vim, dass die Funktion »Min« heißt und zwei Argumente nimmt, " "»num1«\n" "und »num2«.\n" " Als erstes müssen wir überprüfen, welche Zahl kleiner ist:\n" " >\n" "\t: if a:num1 < a:num2\n" # type: Plain text #: usr_41.txt:878 msgid "" "The special prefix \"a:\" tells Vim that the variable is a function " "argument. Let's assign the variable \"smaller\" the value of the smallest " "number: >" msgstr "" "Das besondere Präfix »a:« sagt Vim, dass die Variable ein " "Funktions-Argument ist. Weisen wir nun der Variablen »smaller« den Wert " "der kleineren Zahl zu: >" # type: Plain text #: usr_41.txt:884 #, no-wrap msgid "" "\t: if a:num1 < a:num2\n" "\t: let smaller = a:num1\n" "\t: else\n" "\t: let smaller = a:num2\n" "\t: endif\n" msgstr "" "\t: if a:num1 < a:num2\n" "\t: let smaller = a:num1\n" "\t: else\n" "\t: let smaller = a:num2\n" "\t: endif\n" # type: Plain text #: usr_41.txt:887 msgid "" "The variable \"smaller\" is a local variable. Variables used inside a " "function are local unless prefixed by something like \"g:\", \"a:\", or \"s:" "\"." msgstr "" "Die Variable »smaller« ist eine lokale Variable. In einer Funktion " "benutzte Variablen sind lokal, solange ihnen nicht etwas wie »g:«, »a:« " "oder »s:« vorangestellt wird." # type: Plain text #: usr_41.txt:893 #, no-wrap msgid "" "\tNote:\n" "\tTo access a global variable from inside a function you must prepend\n" "\t\"g:\" to it. Thus \"g:count\" inside a function is used for the global\n" "\tvariable \"count\", and \"count\" is another variable, local to the\n" "\tfunction.\n" msgstr "" "\tAnmerkung:\n" "\tUm innerhalb einer Funktion auf eine globale Variable zuzugreifen,\n" "\tmüssen Sie ihr »g:« voranstellen. Also wird innerhalb einer Funktion\n" "\t»g:count« für die globale Funktion »count« verwandt, und ein einfaches\n" "\t»count« ist eine andere Variable, die zur Funktion lokal ist.\n" # type: Plain text #: usr_41.txt:896 msgid "" "You now use the \":return\" statement to return the smallest number to the " "user. Finally, you end the function: >" msgstr "" "Nun benutzen wir die Anweisung »:return« um die kleinere Zahl an den " "Aufrufer zurückzugeben. Die Funktion endet schließlich: >" # type: Plain text #: usr_41.txt:899 #, no-wrap msgid "" "\t: return smaller\n" "\t:endfunction\n" msgstr "" "\t: return smaller\n" "\t:endfunction\n" # type: Plain text #: usr_41.txt:901 msgid "The complete function definition is as follows: >" msgstr "Die vollständige Funktions-Definition ist wie folgt: >" # type: Plain text #: usr_41.txt:910 #, no-wrap msgid "" "\t:function Min(num1, num2)\n" "\t: if a:num1 < a:num2\n" "\t: let smaller = a:num1\n" "\t: else\n" "\t: let smaller = a:num2\n" "\t: endif\n" "\t: return smaller\n" "\t:endfunction\n" msgstr "" "\t:function Min(num1, num2)\n" "\t: if a:num1 < a:num2\n" "\t: let smaller = a:num1\n" "\t: else\n" "\t: let smaller = a:num2\n" "\t: endif\n" "\t: return smaller\n" "\t:endfunction\n" # type: Plain text #: usr_41.txt:912 msgid "For people who like short functions, this does the same thing: >" msgstr "Für Leute, die kurze Funktionen mögen, leistet dies dasselbe: >" # type: Plain text #: usr_41.txt:919 #, no-wrap msgid "" "\t:function Min(num1, num2)\n" "\t: if a:num1 < a:num2\n" "\t: return a:num1\n" "\t: endif\n" "\t: return a:num2\n" "\t:endfunction\n" msgstr "" "\t:function Min(num1, num2)\n" "\t: if a:num1 < a:num2\n" "\t: return a:num1\n" "\t: endif\n" "\t: return a:num2\n" "\t:endfunction\n" # type: Plain text #: usr_41.txt:923 msgid "" "A user defined function is called in exactly the same way as a built-in " "function. Only the name is different. The Min function can be used like " "this: >" msgstr "" "Eine benutzerdefinierte Funktion wird genauso aufgerufen, wie eine " "eingebaute. Nur der Name ist verschieden. Die Funktion Min kann so " "benutzt " "werden: >" # type: Plain text #: usr_41.txt:925 #, no-wrap msgid "\t:echo Min(5, 8)\n" msgstr "\t:echo Min(5, 8)\n" # type: Plain text #: usr_41.txt:930 msgid "" "Only now will the function be executed and the lines be interpreted by " "Vim. " "If there are mistakes, like using an undefined variable or function, you " "will now get an error message. When defining the function these errors are " "not detected." msgstr "" "Erst jetzt wird die Funktion ausgeführt, und die Zeilen werden von Vim " "interpretiert. Falls es Fehler gibt, wie das Nutzen einer undefinierten " "Variablen oder Funktion, erhalten Sie nun eine Fehlermeldung. Beim " "Definieren der Funktion werden diese Fehler nicht erkannt." # type: Plain text #: usr_41.txt:933 msgid "" "When a function reaches \":endfunction\" or \":return\" is used without an " "argument, the function returns zero." msgstr "" "Wenn eine Funktion »:endfunction« erreicht, oder »:return« wird ohne " "Argument benutzt, gibt die Funktion Null zurück." # type: Plain text #: usr_41.txt:936 msgid "" "To redefine a function that already exists, use the ! for the \":function\" " "command: >" msgstr "" "Um eine bereits existierende Funktion erneut zu definieren, benutzen Sie " "»:function« mit dem !-Modifikator: >" # type: Plain text #: usr_41.txt:938 #, no-wrap msgid "\t:function! Min(num1, num2, num3)\n" msgstr "\t:function! Min(num1, num2, num3)\n" # type: Plain text #: usr_41.txt:941 msgid "USING A RANGE" msgstr "EINEN BEREICH BENUTZEN" # type: Plain text #: usr_41.txt:948 #, no-wrap msgid "" "The \":call\" command can be given a line range. This can have one of two\n" "meanings. When a function has been defined with the \"range\" keyword, it " "will\n" "take care of the line range itself.\n" " The function will be passed the variables \"a:firstline\" and " "\"a:lastline\".\n" "These will have the line numbers from the range the function was called " "with.\n" "Example: >\n" msgstr "" "Dem Befehl »:call« kann ein Zeilenbereich gegeben werden. Dies kann eine " "von\n" "zwei Bedeutungen haben. Wenn eine Funktion mit dem Schlüsselwort »range«\n" "definiert wurde, kümmert sie sich selbst um den Zeilenbereich.\n" " Der Funktion werden die Variablen »a:firstline« und »a:lastline« " "übergeben.\n" "Diese haben die Zeilennummern des Bereiches, mit dem die Funktion " "aufgerufen\n" "wurde. Beispiel: >\n" # type: Plain text #: usr_41.txt:958 #, no-wrap msgid "" "\t:function Count_words() range\n" "\t: let n = a:firstline\n" "\t: let count = 0\n" "\t: while n <= a:lastline\n" "\t: let count = count + Wordcount(getline(n))\n" "\t: let n = n + 1\n" "\t: endwhile\n" "\t: echo \"found \" . count . \" words\"\n" "\t:endfunction\n" msgstr "" "\t:function Count_words() range\n" "\t: let n = a:firstline\n" "\t: let count = 0\n" "\t: while n <= a:lastline\n" "\t: let count = count + Wordcount(getline(n))\n" "\t: let n = n + 1\n" "\t: endwhile\n" "\t: echo \"found \" . count . \" words\"\n" "\t:endfunction\n" # type: Plain text #: usr_41.txt:960 msgid "You can call this function with: >" msgstr "Sie können diese Funktion aufrufen mit: >" # type: Plain text #: usr_41.txt:962 #, no-wrap msgid "\t:10,30call Count_words()\n" msgstr "\t:10,30call Count_words()\n" # type: Plain text #: usr_41.txt:967 #, no-wrap msgid "" "It will be executed once and echo the number of words.\n" " The other way to use a line range is by defining a function without the\n" "\"range\" keyword. The function will be called once for every line in the\n" "range, with the cursor in that line. Example: >\n" msgstr "" "Sie wird einmal ausgeführt und gibt die Anzahl an Worten aus.\n" " Die andere Möglichkeit einen Zeilenbereich zu benutzen ist, eine " "Funktion\n" "ohne das Schlüsselwort »range« zu definieren. Die Funktion wird einmal " "für\n" "jede Zeile in dem Bereich aufgerufen, mit dem Cursor in dieser Zeile.\n" "Beispiel: >\n" # type: Plain text #: usr_41.txt:971 #, no-wrap msgid "" "\t:function Number()\n" "\t: echo \"line \" . line(\".\") . \" contains: \" . getline(\".\")\n" "\t:endfunction\n" msgstr "" "\t:function Number()\n" "\t: echo \"line \" . line(\".\") . \" contains: \" . getline(\".\")\n" "\t:endfunction\n" # type: Plain text #: usr_41.txt:973 msgid "If you call this function with: >" msgstr "Falls Sie diese Funktion aufrufen mit: >" # type: Plain text #: usr_41.txt:975 #, no-wrap msgid "\t:10,15call Number()\n" msgstr "\t:10,15call Number()\n" # type: Plain text #: usr_41.txt:977 msgid "The function will be called six times." msgstr "wird die Funktion sechs Mal aufgerufen." # type: Plain text #: usr_41.txt:980 msgid "VARIABLE NUMBER OF ARGUMENTS" msgstr "VARIABLE ANZAHL VON ARGUMENTEN" # type: Plain text #: usr_41.txt:984 msgid "" "Vim enables you to define functions that have a variable number of " "arguments. The following command, for instance, defines a function that " "must have 1 argument (start) and can have up to 20 additional arguments: >" msgstr "" "Vim ermöglicht Ihnen, Funktionen zu definieren, die eine variable Anzahl " "von Argumenten haben. Der folgende Befehl zum Beispiel definiert eine " "Funktion, die ein Argument haben muss (start), und die bis zu 20 " "zusätzliche Argumente haben kann: >" # type: Plain text #: usr_41.txt:986 #, no-wrap msgid "\t:function Show(start, ...)\n" msgstr "\t:function Show(start, ...)\n" # type: Plain text #: usr_41.txt:990 #, no-wrap msgid "" "The variable \"a:1\" contains the first optional argument, \"a:2\" the " "second, and\n" "so on. The variable \"a:0\" contains the number of extra arguments.\n" " For example: >\n" msgstr "" "Die Variable »a:1« enthält das erste optionale Argument, »a:2« das zweite " "und\n" "so weiter. Die Variable »a:0« enthält die Anzahl von zusätzlichen " "Argumenten\n" " Zum Beispiel: >\n" # type: Plain text #: usr_41.txt:1002 #, no-wrap msgid "" "\t:function Show(start, ...)\n" "\t: echohl Title\n" "\t: echo \"Show is \" . a:start\n" "\t: echohl None\n" "\t: let index = 1\n" "\t: while index <= a:0\n" "\t: echo \" Arg \" . index . \" is \" . a:{index}\n" "\t: let index = index + 1\n" "\t: endwhile\n" "\t: echo \"\"\n" "\t:endfunction\n" msgstr "" "\t:function Show(start, ...)\n" "\t: echohl Title\n" "\t: echo \"Show is \" . a:start\n" "\t: echohl None\n" "\t: let index = 1\n" "\t: while index <= a:0\n" "\t: echo \" Arg \" . index . \" is \" . a:{index}\n" "\t: let index = index + 1\n" "\t: endwhile\n" "\t: echo \"\"\n" "\t:endfunction\n" # type: Plain text #: usr_41.txt:1006 msgid "" "This uses the \":echohl\" command to specify the highlighting used for the " "following \":echo\" command. \":echohl None\" stops it again. The \":echon" "\" command works like \":echo\", but doesn't output a line break." msgstr "" "Dies benutzt den Befehl »:echohl« um die für den nächsten »:echo«-Befehl " "benutzte Hervorhebung anzugeben. »:echohl None« deaktiviert dies. Der " "Befehl »:echon« funktioniert wie »:echo«, gibt aber keinen Zeilenumbruch " "aus." # type: Plain text #: usr_41.txt:1009 msgid "" "You can also use the a:000 variable, it is a List of all the \"...\" " "arguments. See |a:000|." msgstr "" "Sie können auch die Variable a:000 benutzen. Dies ist eine Liste aller " "optionalen Argumente. Siehe |a:000|." # type: Plain text #: usr_41.txt:1012 msgid "LISTING FUNCTIONS" msgstr "FUNKTIONEN AUFLISTEN" # type: Plain text #: usr_41.txt:1015 msgid "" "The \":function\" command lists the names and arguments of all user-defined " "functions: >" msgstr "" "Der Befehl »:function« listet die Namen und Argumente aller " "benutzerdefinierten Funktionen auf: >" # type: Plain text #: usr_41.txt:1020 #, no-wrap msgid "" "\t:function\n" "<\tfunction Show(start, ...) ~\n" "\tfunction GetVimIndent() ~\n" "\tfunction SetSyn(name) ~\n" msgstr "" "\t:function\n" "<\tfunction Show(start, ...) ~\n" "\tfunction GetVimIndent() ~\n" "\tfunction SetSyn(name) ~\n" # type: Plain text #: usr_41.txt:1022 msgid "" "To see what a function does, use its name as an argument for " "\":function\": >" msgstr "" "Um zu sehen, was eine Funktion tut, benutzen Sie ihren Namen als Argument " "für »:function«: >" # type: Plain text #: usr_41.txt:1028 #, no-wrap msgid "" "\t:function SetSyn\n" "<\t1 if &syntax == '' ~\n" "\t2 let &syntax = a:name ~\n" "\t3 endif ~\n" "\t endfunction ~\n" msgstr "" "\t:function SetSyn\n" "<\t1 if &syntax == '' ~\n" "\t2 let &syntax = a:name ~\n" "\t3 endif ~\n" "\t endfunction ~\n" # type: Plain text #: usr_41.txt:1031 msgid "DEBUGGING" msgstr "FEHLERSUCHE" # type: Plain text #: usr_41.txt:1036 #, no-wrap msgid "" "The line number is useful for when you get an error message or when " "debugging.\n" "See |debug-scripts| about debugging mode.\n" " You can also set the 'verbose' option to 12 or higher to see all " "function\n" "calls. Set it to 15 or higher to see every executed line.\n" msgstr "" "Die Zeilennummer ist nützlich, wenn Sie eine Fehlermeldung erhalten, oder " "bei\n" "der Fehlersuche. Siehe |debug-scripts| für den Fehlersuche-Modus.\n" " Sie können auch die Option 'verbose' auf 12 oder höher setzen, um alle\n" "Funktionsaufrufe zu sehen. Setzen Sie sie auf 15 oder höher um jede\n" "ausgeführte Zeile zu sehen.\n" # type: Plain text #: usr_41.txt:1039 msgid "DELETING A FUNCTION" msgstr "EINE FUNKTION LÖSCHEN" # type: Plain text #: usr_41.txt:1041 msgid "To delete the Show() function: >" msgstr "Um die Funktion Show() zu löschen: >" # type: Plain text #: usr_41.txt:1043 #, no-wrap msgid "\t:delfunction Show\n" msgstr "\t:delfunction Show\n" # type: Plain text #: usr_41.txt:1045 msgid "You get an error when the function doesn't exist." msgstr "Sie erhalten eine Fehlermeldung, wenn die Funktion nicht existiert." # type: Plain text #: usr_41.txt:1048 msgid "FUNCTION REFERENCES" msgstr "FUNKTIONSREFERENZEN" # type: Plain text #: usr_41.txt:1052 msgid "" "Sometimes it can be useful to have a variable point to one function or " "another. You can do it with the function() function. It turns the name of " "a function into a reference: >" msgstr "" "Manchmal kann es nützlich sein, eine Variable auf die eine oder andere " "Funktion zeigen zu lassen. Dies können Sie mit der Funktion function() " "machen. Sie verwandelt den Namen einer Funktion in eine Referenz: >" # type: Plain text #: usr_41.txt:1068 #, no-wrap msgid "" "\t:let result = 0\t\t\" or 1\n" "\t:function! Right()\n" "\t: return 'Right!'\n" "\t:endfunc\n" "\t:function! Wrong()\n" "\t: return 'Wrong!'\n" "\t:endfunc\n" "\t:\n" "\t:if result == 1\n" "\t: let Afunc = function('Right')\n" "\t:else\n" "\t: let Afunc = function('Wrong')\n" "\t:endif\n" "\t:echo call(Afunc, [])\n" "<\tWrong! ~\n" msgstr "" "\t:let result = 0\t\t\" or 1\n" "\t:function! Right()\n" "\t: return 'Right!'\n" "\t:endfunc\n" "\t:function! Wrong()\n" "\t: return 'Wrong!'\n" "\t:endfunc\n" "\t:\n" "\t:if result == 1\n" "\t: let Afunc = function('Right')\n" "\t:else\n" "\t: let Afunc = function('Wrong')\n" "\t:endif\n" "\t:echo call(Afunc, [])\n" "<\tWrong! ~\n" # type: Plain text #: usr_41.txt:1075 #, no-wrap msgid "" "Note that the name of a variable that holds a function reference must " "start\n" "with a capital. Otherwise it could be confused with the name of a builtin\n" "function.\n" " The way to invoke a function that a variable refers to is with the " "call()\n" "function. Its first argument is the function reference, the second " "argument\n" "is a List with arguments.\n" msgstr "" "Beachten Sie, dass der Name einer Variablen, die eine Funktionsreferenz\n" "enthält, mit einem Großbuchstaben beginnen muss. Andernfalls könnte er " "mit\n" "dem Namen einer eingebauten Funktion verwechselt werden.\n" " Der Weg, eine Funktion aufzurufen, die eine Variable referenziert, ist " "es,\n" "die Funktion call() zu benutzen. Ihr erstes Argument ist die\n" "Funktionsreferenz, das zweite Argument ist eine Liste von Argumenten.\n" # type: Plain text #: usr_41.txt:1078 msgid "" "Function references are most useful in combination with a Dictionary, as is " "explained in the next section." msgstr "" "Funktionsreferenzen sind am nützlichsten in Kombination mit einem " "Wörterbuch, was im nächsten Abschnitt erklärt wird." # type: Plain text #: usr_41.txt:1081 #, no-wrap msgid "*41.8*\tLists and Dictionaries\n" msgstr "*41.8*\tListen und Wörterbücher\n" # type: Plain text #: usr_41.txt:1084 msgid "" "So far we have used the basic types String and Number. Vim also supports " "two composite types: List and Dictionary." msgstr "" "Bis jetzt haben wir die Basistypen String (Zeichenkette) und Number (Zahl) " "benutzt. Vim unterstützt auch zwei zusammengesetzte Typen: Liste und " "Dictionary (Wörterbuch)." # type: Plain text #: usr_41.txt:1088 msgid "" "A List is an ordered sequence of things. The things can be any kind of " "value, thus you can make a List of numbers, a List of Lists and even a List " "of mixed items. To create a List with three strings: >" msgstr "" "Eine Liste ist eine geordnete Folge von Dinge. Die Dinge können jeglicher " "Art von Wert sein, also können Sie eine Liste von Zahlen machen, eine " "Liste von Listen, und sogar eine Liste von gemischten Elementen. Um eine " "Liste mit drei Zeichenketten zu erzeugen: >" # type: Plain text #: usr_41.txt:1090 #, no-wrap msgid "\t:let alist = ['aap', 'mies', 'noot']\n" msgstr "\t:let alist = ['aap', 'mies', 'noot']\n" # type: Plain textc #: usr_41.txt:1093 msgid "" "The List items are enclosed in square brackets and separated by commas. To " "create an empty List: >" msgstr "" "Die Listenelemente sind in eckige Klammern eingeschlossen und durch Kommata " "getrennt. Um eine leere Liste zu erzeugen: >" # type: Plain text #: usr_41.txt:1095 #, no-wrap msgid "\t:let alist = []\n" msgstr "\t:let alist = []\n" # type: Plain text #: usr_41.txt:1097 msgid "You can add items to a List with the add() function: >" msgstr "Mit der Funktion add() können Sie einer Liste Elemente hinzufügen: >" # type: Plain text #: usr_41.txt:1103 #, no-wrap msgid "" "\t:let alist = []\n" "\t:call add(alist, 'foo')\n" "\t:call add(alist, 'bar')\n" "\t:echo alist\n" "<\t['foo', 'bar'] ~\n" msgstr "" "\t:let alist = []\n" "\t:call add(alist, 'foo')\n" "\t:call add(alist, 'bar')\n" "\t:echo alist\n" "<\t['foo', 'bar'] ~\n" # type: Plain text #: usr_41.txt:1105 msgid "List concatenation is done with +: >" msgstr "Listen-Konkatenation wird mit + erledigt: >" # type: Plain text #: usr_41.txt:1108 #, no-wrap msgid "" "\t:echo alist + ['foo', 'bar']\n" "<\t['foo', 'bar', 'foo', 'bar'] ~\n" msgstr "" "\t:echo alist + ['foo', 'bar']\n" "<\t['foo', 'bar', 'foo', 'bar'] ~\n" # type: Plain text #: usr_41.txt:1110 msgid "Or, if you want to extend a List directly: >" msgstr "Oder falls Sie eine Liste direkt erweitern wollen: >" # type: Plain text #: usr_41.txt:1115 #, no-wrap msgid "" "\t:let alist = ['one']\n" "\t:call extend(alist, ['two', 'three'])\n" "\t:echo alist\n" "<\t['one', 'two', 'three'] ~\n" msgstr "" "\t:let alist = ['one']\n" "\t:call extend(alist, ['two', 'three'])\n" "\t:echo alist\n" "<\t['one', 'two', 'three'] ~\n" # type: Plain text #: usr_41.txt:1117 msgid "Notice that using add() will have a different effect: >" msgstr "Beachten Sie, dass das Benutzen von add() einen anderen Effekt hat: >" # type: Plain text #: usr_41.txt:1122 #, no-wrap msgid "" "\t:let alist = ['one']\n" "\t:call add(alist, ['two', 'three'])\n" "\t:echo alist\n" "<\t['one', ['two', 'three']] ~\n" msgstr "" "\t:let alist = ['one']\n" "\t:call add(alist, ['two', 'three'])\n" "\t:echo alist\n" "<\t['one', ['two', 'three']] ~\n" # type: Plain text #: usr_41.txt:1124 msgid "The second argument of add() is added as a single item." msgstr "Das zweite Argument von add() wird als einzelnes Element hinzugefügt." # type: Plain text #: usr_41.txt:1127 msgid "FOR LOOP" msgstr "FOR-SCHLEIFE" # type: Plain text #: usr_41.txt:1129 msgid "One of the nice things you can do with a List is iterate over it: >" msgstr "" "Eines der netten Dinge, die Sie mit einer Liste machen können, ist über " "sie zu iterieren: >" # type: Plain text #: usr_41.txt:1137 #, no-wrap msgid "" "\t:let alist = ['one', 'two', 'three']\n" "\t:for n in alist\n" "\t: echo n\n" "\t:endfor\n" "<\tone ~\n" "\ttwo ~\n" "\tthree ~\n" msgstr "" "\t:let alist = ['one', 'two', 'three']\n" "\t:for n in alist\n" "\t: echo n\n" "\t:endfor\n" "<\tone ~\n" "\ttwo ~\n" "\tthree ~\n" # type: Plain text #: usr_41.txt:1140 msgid "" "This will loop over each element in List \"alist\", assigning the value to " "variable \"n\". The generic form of a for loop is: >" msgstr "" "Dies läuft über jedes Element in der Liste »alist«, wobei es den Wert der " "Variablen »n« zuweist. Die generische Form einer For-Schleife ist: >" # type: Plain text #: usr_41.txt:1144 #, no-wrap msgid "" "\t:for {varname} in {listexpression}\n" "\t: {commands}\n" "\t:endfor\n" msgstr "" "\t:for {varname} in {listexpression}\n" "\t: {commands}\n" "\t:endfor\n" # type: Plain text #: usr_41.txt:1147 msgid "" "To loop a certain number of times you need a List of a specific length. " "The " "range() function creates one for you: >" msgstr "" "Um über eine bestimmte Anzahl von Malen zu laufen, brauchen Sie eine Liste " "einer bestimmten Länge. Die Funktion range() erzeugt einem eine: >" # type: Plain text #: usr_41.txt:1154 #, no-wrap msgid "" "\t:for a in range(3)\n" "\t: echo a\n" "\t:endfor\n" "<\t0 ~\n" "\t1 ~\n" "\t2 ~\n" msgstr "" "\t:for a in range(3)\n" "\t: echo a\n" "\t:endfor\n" "<\t0 ~\n" "\t1 ~\n" "\t2 ~\n" # type: Plain text #: usr_41.txt:1158 #, no-wrap msgid "" "Notice that the first item of the List that range() produces is zero, thus " "the\n" "last item is one less than the length of the list.\n" " You can also specify the maximum value, the stride and even go " "backwards: >\n" msgstr "" "Beachten Sie, dass das erste Element der Liste, die range() produziert, " "Null\n" "ist, also ist das letzte Element eins weniger als die Länge der Liste.\n" " Sie können auch den Maximalwert angeben, den Inkrement, und sogar " "rückwärts\n" "laufen: >\n" # type: Plain text #: usr_41.txt:1165 #, no-wrap msgid "" "\t:for a in range(8, 4, -2)\n" "\t: echo a\n" "\t:endfor\n" "<\t8 ~\n" "\t6 ~\n" "\t4 ~\n" msgstr "" "\t:for a in range(8, 4, -2)\n" "\t: echo a\n" "\t:endfor\n" "<\t8 ~\n" "\t6 ~\n" "\t4 ~\n" # type: Plain text #: usr_41.txt:1167 msgid "A more useful example, looping over lines in the buffer: >" msgstr "Ein nützlicheres Beispiel, das über Zeilen im Puffer läuft: >" # type: Plain text #: usr_41.txt:1173 #, no-wrap msgid "" "\t:for line in getline(1, 20)\n" "\t: if line =~ \"Date: \"\n" "\t: echo matchstr(line, 'Date: \\zs.*')\n" "\t: endif\n" "\t:endfor\n" msgstr "" "\t:for line in getline(1, 20)\n" "\t: if line =~ \"Date: \"\n" "\t: echo matchstr(line, 'Date: \\zs.*')\n" "\t: endif\n" "\t:endfor\n" # type: Plain text #: usr_41.txt:1175 msgid "" "This looks into lines 1 to 20 (inclusive) and echoes any date found in " "there." msgstr "" "Dies schaut sich Zeilen 1 bis 20 (einschließlich) an, und gibt jedes dort " "gefundene Datum aus." # type: Plain text #: usr_41.txt:1178 msgid "DICTIONARIES" msgstr "WÖRTERBÜCHER" # type: Plain text #: usr_41.txt:1181 msgid "" "A Dictionary stores key-value pairs. You can quickly lookup a value if you " "know the key. A Dictionary is created with curly braces: >" msgstr "" "Ein Wörterbuch speichert Schlüssel-Wert-Paare. Man kann schnell einen " "Wert nachschlagen, wenn man den Schlüssel kennt. Ein Wörterbuch wird mit " "geschwungenen Klammern erzeugt: >" # type: Plain text #: usr_41.txt:1183 #, no-wrap msgid "\t:let uk2nl = {'one': 'een', 'two': 'twee', 'three': 'drie'}\n" msgstr "\t:let uk2nl = {'one': 'een', 'two': 'twee', 'three': 'drie'}\n" # type: Plain text #: usr_41.txt:1185 msgid "Now you can lookup words by putting the key in square brackets: >" msgstr "" "Nun kann man Wörter nachschlagen, indem man den Schlüssel in eckige " "Klammern setzt: >" # type: Plain text #: usr_41.txt:1188 #, no-wrap msgid "" "\t:echo uk2nl['two']\n" "<\ttwee ~\n" msgstr "" "\t:echo uk2nl['two']\n" "<\ttwee ~\n" # type: Plain text #: usr_41.txt:1190 msgid "The generic form for defining a Dictionary is: >" msgstr "Die generische Form für das Definieren eines Wörterbuchs ist: >" # type: Plain text #: usr_41.txt:1192 #, no-wrap msgid "\t{ : , ...}\n" msgstr "\t{ : , ...}\n" # type: Plain text #: usr_41.txt:1194 msgid "An empty Dictionary is one without any keys: >" msgstr "Ein leeres Wörterbuch ist eines ohne Schlüssel: >" # type: Plain text #: usr_41.txt:1196 #, no-wrap msgid "\t{}\n" msgstr "\t{}\n" # type: Plain text #: usr_41.txt:1200 msgid "" "The possibilities with Dictionaries are numerous. There are various " "functions for them as well. For example, you can obtain a list of the keys " "and loop over them: >" msgstr "" "Die Möglichkeiten mit Wörterbüchern sind zahlreich. Ebenso gibt es für " "sie verschiedene Funktionen. Zum Beispiel kann man eine Liste der " "Schlüssel beziehen und sie durchlaufen: >" # type: Plain text #: usr_41.txt:1207 #, no-wrap msgid "" "\t:for key in keys(uk2nl)\n" "\t: echo key\n" "\t:endfor\n" "<\tthree ~\n" "\tone ~\n" "\ttwo ~\n" msgstr "" "\t:for key in keys(uk2nl)\n" "\t: echo key\n" "\t:endfor\n" "<\tthree ~\n" "\tone ~\n" "\ttwo ~\n" # type: Plain text #: usr_41.txt:1210 msgid "" "The will notice the keys are not ordered. You can sort the list to get a " "specific order: >" msgstr "" "Sie werden bemerken, dass die Schlüssel nicht geordnet sind. Man kann die " "Liste sortieren, um eine bestimmte Ordnung zu erhalten: >" # type: Plain text #: usr_41.txt:1217 #, no-wrap msgid "" "\t:for key in sort(keys(uk2nl))\n" "\t: echo key\n" "\t:endfor\n" "<\tone ~\n" "\tthree ~\n" "\ttwo ~\n" msgstr "" "\t:for key in sort(keys(uk2nl))\n" "\t: echo key\n" "\t:endfor\n" "<\tone ~\n" "\tthree ~\n" "\ttwo ~\n" # type: Plain text #: usr_41.txt:1220 msgid "" "But you can never get back the order in which items are defined. For that " "you need to use a List, it stores items in an ordered sequence." msgstr "" "Aber man kann nie die Reihenfolge zurückbekommen, in der die Elemente " "definiert wurden. Dafür muss man eine Liste benutzen, sie speichert " "Elemente in einer geordneten Reihenfolge." # type: Plain text #: usr_41.txt:1223 msgid "DICTIONARY FUNCTIONS" msgstr "WÖRTERBUCHFUNKTIONEN" # type: Plain text #: usr_41.txt:1226 msgid "" "The items in a Dictionary can normally be obtained with an index in square " "brackets: >" msgstr "" "Die Elemente in einem Wörterbuch können normalerweise mit einem Index in " "eckigen Klammern bezogen werden: >" # type: Plain text #: usr_41.txt:1229 #, no-wrap msgid "" "\t:echo uk2nl['one']\n" "<\teen ~\n" msgstr "" "\t:echo uk2nl['one']\n" "<\teen ~\n" # type: Plain text #: usr_41.txt:1231 msgid "" "A method that does the same, but without so many punctuation characters: >" msgstr "Eine Methode, die dasselbe tut, aber ohne so viele Zeichen: >" # type: Plain text #: usr_41.txt:1234 #, no-wrap msgid "" "\t:echo uk2nl.one\n" "<\teen ~\n" msgstr "" "\t:echo uk2nl.one\n" "<\teen ~\n" # type: Plain text #: usr_41.txt:1237 msgid "" "This only works for a key that is made of ASCII letters, digits and the " "underscore. You can also assign a new value this way: >" msgstr "" "Dies funktioniert nur für einen Schlüssel, der aus ASCII-Buchstaben, " "Ziffern und dem Unterstrich besteht. Auf diese Weise kann man auch einen " "neuen Wert zuweisen: >" # type: Plain text #: usr_41.txt:1241 #, no-wrap msgid "" "\t:let uk2nl.four = 'vier'\n" "\t:echo uk2nl\n" "<\t{'three': 'drie', 'four': 'vier', 'one': 'een', 'two': 'twee'} ~\n" msgstr "" "\t:let uk2nl.four = 'vier'\n" "\t:echo uk2nl\n" "<\t{'three': 'drie', 'four': 'vier', 'one': 'een', 'two': 'twee'} ~\n" # type: Plain text #: usr_41.txt:1244 msgid "" "And now for something special: you can directly define a function and store " "a reference to it in the dictionary: >" msgstr "" "Und nun zu etwas Besonderem: man kann direkt eine Funktion definieren und " "eine Referenz auf diese in dem Wörterbuch speichern: >" # type: Plain text #: usr_41.txt:1248 #, no-wrap msgid "" "\t:function uk2nl.translate(line) dict\n" "\t: return join(map(split(a:line), 'get(self, v:val, \"???\")'))\n" "\t:endfunction\n" msgstr "" "\t:function uk2nl.translate(line) dict\n" "\t: return join(map(split(a:line), 'get(self, v:val, \"???\")'))\n" "\t:endfunction\n" # type: Plain text #: usr_41.txt:1250 msgid "Let's first try it out: >" msgstr "Probieren wir dies zunächst einmal aus: >" # type: Plain text #: usr_41.txt:1253 #, no-wrap msgid "" "\t:echo uk2nl.translate('three two five one')\n" "<\tdrie twee ??? een ~\n" msgstr "" "\t:echo uk2nl.translate('three two five one')\n" "<\tdrie twee ??? een ~\n" # type: Plain text #: usr_41.txt:1258 #, no-wrap msgid "" "The first special thing you notice is the \"dict\" at the end of the " "\":function\"\n" "line. This marks the function as being used from a Dictionary. The " "\"self\"\n" "local variable will then refer to that Dictionary.\n" " Now let's break up the complicated return command: >\n" msgstr "" "Das erste Besondere, das Sie bemerken, ist das »dict« am Ende der Zeile\n" "mit\n" "»:function«. Dies markiert die Funktion als aus einem Wörterbuch zu " "benutzen.\n" "Die Variable »self« referenziert dann dieses Wörterbuch.\n" " Schauen wir uns den komplizierten Rückgabebefehl nun Stück für Stück " "an: >\n" # type: Plain text #: usr_41.txt:1260 #, no-wrap msgid "\tsplit(a:line)\n" msgstr "\tsplit(a:line)\n" # type: Plain text #: usr_41.txt:1263 msgid "" "The split() function takes a string, chops it into white separated words " "and " "returns a list with these words. Thus in the example it returns: >" msgstr "" "Die Funktion split() nimmt eine Zeichenkette, schneidet sie in " "leerzeichen-getrennte Wörter, und gibt eine Liste mit diesen Wörtern " "zurück. Im Beispiel also: >" # type: Plain text #: usr_41.txt:1266 #, no-wrap msgid "" "\t:echo split('three two five one')\n" "<\t['three', 'two', 'five', 'one'] ~\n" msgstr "" "\t:echo split('three two five one')\n" "<\t['three', 'two', 'five', 'one'] ~\n" # type: Plain text #: usr_41.txt:1270 msgid "" "This list is the first argument to the map() function. This will go " "through " "the list, evaluating its second argument with \"v:val\" set to the value of " "each item. This is a shortcut to using a for loop. This command: >" msgstr "" "Diese Liste ist das erste Argument an die Funktion map(). Diese geht " "durch die Liste, und wertet dabei ihr zweite Argument mit »v:val« auf den " "Wert jedes Elements gesetzt. Dies ist eine Abkürzung zum Benutzen einer " "For-Schleife. Dieser Befehl: >" # type: Plain text #: usr_41.txt:1272 #, no-wrap msgid "\t:let alist = map(split(a:line), 'get(self, v:val, \"???\")')\n" msgstr "\t:let alist = map(split(a:line), 'get(self, v:val, \"???\")')\n" # type: Plain text #: usr_41.txt:1274 msgid "Is equivalent to: >" msgstr "ist gleichbedeutend mit: >" # type: Plain text #: usr_41.txt:1279 #, no-wrap msgid "" "\t:let alist = split(a:line)\n" "\t:for idx in range(len(alist))\n" "\t: let alist[idx] = get(self, alist[idx], \"???\")\n" "\t:endfor\n" msgstr "" "\t:let alist = split(a:line)\n" "\t:for idx in range(len(alist))\n" "\t: let alist[idx] = get(self, alist[idx], \"???\")\n" "\t:endfor\n" # type: Plain text #: usr_41.txt:1284 msgid "" "The get() function checks if a key is present in a Dictionary. If it is, " "then the value is retrieved. If it isn't, then the default value is " "returned, in the example it's '???'. This is a convenient way to handle " "situations where a key may not be present and you don't want an error " "message." msgstr "" "Die Funktion get() prüft, ob ein Schlüssel in einem Wörterbuch vorhanden " "ist. Falls er es ist, wird der Wert zurückgegeben. Falls nicht, wird ein " "Standardwert zurückgegeben, im Beispiel '???'. Dies ist eine bequeme Art " "Situationen zu behandeln, in denen ein Schlüssel möglicherweise nicht " "vorhanden ist und man keine Fehlermeldung möchte." # type: Plain text #: usr_41.txt:1289 #, no-wrap msgid "" "The join() function does the opposite of split(): it joins together a list " "of\n" "words, putting a space in between.\n" " This combination of split(), map() and join() is a nice way to filter a " "line\n" "of words in a very compact way.\n" msgstr "" "Die Funktion join() tut das Gegenteil von split(): sie fügt eine Liste von\n" "Wörtern zusammen, wobei sie ein Leerzeichen zwischen sie setzt.\n" " Diese Kombination von split(), map() und join() ist eine schöne " "Möglichkeit,\n" "eine Zeile von Wörtern auf eine sehr kompakte Weise zu filtern.\n" # type: Plain text #: usr_41.txt:1292 msgid "OBJECT ORIENTED PROGRAMMING" msgstr "OBJEKT-ORIENTIERTE PROGRAMMIERUNG" # type: Plain text #: usr_41.txt:1298 #, no-wrap msgid "" "Now that you can put both values and functions in a Dictionary, you can\n" "actually use a Dictionary like an object.\n" " Above we used a Dictionary for translating Dutch to English. We might " "want\n" "to do the same for other languages. Let's first make an object (aka\n" "Dictionary) that has the translate function, but no words to translate: >\n" msgstr "" "Jetzt, da Sie sowohl Werte wie Funktionen in ein Wörterbuch stecken " "können,\n" "können Sie ein Wörterbuch tatsächlich wie ein Objekt benutzen.\n" " Oben haben wir ein Wörterbuch benutzt, um Holländisch in Englisch zu\n" "übersetzen. Wir könnten dasselbe für andere Sprachen tun wollen. Machen " "wir\n" "zunächst ein Objekt (aka Wörterbuch), das die Übersetzungsfunktion hat, " "aber\n" "keine Wörter zum Übersetzen: >\n" # type: Plain text #: usr_41.txt:1303 #, no-wrap msgid "" "\t:let transdict = {}\n" "\t:function transdict.translate(line) dict\n" "\t: return join(map(split(a:line), 'get(self.words, v:val, \"???\")'))\n" "\t:endfunction\n" msgstr "" "\t:let transdict = {}\n" "\t:function transdict.translate(line) dict\n" "\t: return join(map(split(a:line), 'get(self.words, v:val, \"???\")'))\n" "\t:endfunction\n" # type: Plain text #: usr_41.txt:1307 msgid "" "It's slightly different from the function above, using 'self.words' to " "lookup word translations. But we don't have a self.words. Thus you could " "call this an abstract class." msgstr "" "Es ist ein wenig verschieden von der Funktion oben, indem wir 'self.words' " "benutzen, um Wort-Übersetzungen nachzuschlagen. Aber wir haben keine " "self.words. Also könnte man dies eine abstrakte Klasse nennen." # type: Plain text #: usr_41.txt:1309 msgid "Now we can instantiate a Dutch translation object: >" msgstr "Nun können wir ein Übersetzungsobjekt für Holländisch " "instanziieren: >" # type: Plain text #: usr_41.txt:1314 #, no-wrap msgid "" "\t:let uk2nl = copy(transdict)\n" "\t:let uk2nl.words = {'one': 'een', 'two': 'twee', 'three': 'drie'}\n" "\t:echo uk2nl.translate('three one')\n" "<\tdrie een ~\n" msgstr "" "\t:let uk2nl = copy(transdict)\n" "\t:let uk2nl.words = {'one': 'een', 'two': 'twee', 'three': 'drie'}\n" "\t:echo uk2nl.translate('three one')\n" "<\tdrie een ~\n" # type: Plain text #: usr_41.txt:1316 msgid "And a German translator: >" msgstr "Und einen Übersetzer für Deutsch: >" # type: Plain text #: usr_41.txt:1321 #, no-wrap msgid "" "\t:let uk2de = copy(transdict)\n" "\t:let uk2de.words = {'one': 'ein', 'two': 'zwei', 'three': 'drei'}\n" "\t:echo uk2de.translate('three one')\n" "<\tdrei ein ~\n" msgstr "" "\t:let uk2de = copy(transdict)\n" "\t:let uk2de.words = {'one': 'ein', 'two': 'zwei', 'three': 'drei'}\n" "\t:echo uk2de.translate('three one')\n" "<\tdrei ein ~\n" # type: Plain text #: usr_41.txt:1325 msgid "" "You see that the copy() function is used to make a copy of the " "\"transdict\" " "Dictionary and then the copy is changed to add the words. The original " "remains the same, of course." msgstr "" "Sie sehen, dass die Funktion copy() benutzt wird, um eine Kopie des " "Wörterbuchs »transdict« zu machen, und dann diese Kopie verändert wird, um " "die Worte aufzunehmen. Das Original bleibt natürlich dasselbe." # type: Plain text #: usr_41.txt:1327 msgid "Now you can go one step further, and use your preferred translator: >" msgstr "" "Nun kann man einen Schritt weiter gehen, und den bevorzugten Übersetzer " "verwenden: >" # type: Plain text #: usr_41.txt:1335 #, no-wrap msgid "" "\t:if $LANG =~ \"de\"\n" "\t: let trans = uk2de\n" "\t:else\n" "\t: let trans = uk2nl\n" "\t:endif\n" "\t:echo trans.translate('one two three')\n" "<\teen twee drie ~\n" msgstr "" "\t:if $LANG =~ \"de\"\n" "\t: let trans = uk2de\n" "\t:else\n" "\t: let trans = uk2nl\n" "\t:endif\n" "\t:echo trans.translate('one two three')\n" "<\teen twee drie ~\n" # type: Plain text #: usr_41.txt:1339 msgid "" "Here \"trans\" refers to one of the two objects (Dictionaries). No copy is " "made. More about List and Dictionary identity can be found at |list-" "identity| and |dict-identity|." msgstr "" "Hier referenziert »trans« eines der beiden Objekte (Wörterbücher). Es " "wird keine Kopie gemacht. Mehr über Listen- und Wörterbuch-Identität kann " "unter |list-identity| und |dict-identity| gefunden werden." # type: Plain text #: usr_41.txt:1342 msgid "" "Now you might use a language that isn't supported. You can overrule the " "translate() function to do nothing: >" msgstr "" "Nun könnte man eine Sprache benutzen, die nicht unterstützt wird. Man " "kann die Funktion translate() überstimmen, nichts zu machen: >" # type: Plain text #: usr_41.txt:1349 #, no-wrap msgid "" "\t:let uk2uk = copy(transdict)\n" "\t:function! uk2uk.translate(line)\n" "\t: return a:line\n" "\t:endfunction\n" "\t:echo uk2uk.translate('three one wladiwostok')\n" "<\tthree one wladiwostok ~\n" msgstr "" "\t:let uk2uk = copy(transdict)\n" "\t:function! uk2uk.translate(line)\n" "\t: return a:line\n" "\t:endfunction\n" "\t:echo uk2uk.translate('three one wladiwostok')\n" "<\tthree one wladiwostok ~\n" # type: Plain text #: usr_41.txt:1352 msgid "" "Notice that a ! was used to overwrite the existing function reference. Now " "use \"uk2uk\" when no recognized language is found: >" msgstr "" "Beachten Sie, dass ein ! benutzt wurde, um die bestehende " "Funktionsreferenz zu überschreiben. Nun benutze »uk2uk«, falls keine " "erkannte Sprache gefunden wird: >" # type: Plain text #: usr_41.txt:1362 #, no-wrap msgid "" "\t:if $LANG =~ \"de\"\n" "\t: let trans = uk2de\n" "\t:elseif $LANG =~ \"nl\"\n" "\t: let trans = uk2nl\n" "\t:else\n" "\t: let trans = uk2uk\n" "\t:endif\n" "\t:echo trans.translate('one two three')\n" "<\tone two three ~\n" msgstr "" "\t:if $LANG =~ \"de\"\n" "\t: let trans = uk2de\n" "\t:elseif $LANG =~ \"nl\"\n" "\t: let trans = uk2nl\n" "\t:else\n" "\t: let trans = uk2uk\n" "\t:endif\n" "\t:echo trans.translate('one two three')\n" "<\tone two three ~\n" # type: Plain text #: usr_41.txt:1364 msgid "For further reading see |Lists| and |Dictionaries|." msgstr "Zum Weiterlesen siehe |Lists| und |Dictionaries|." # type: Plain text #: usr_41.txt:1367 #, no-wrap msgid "*41.9*\tExceptions\n" msgstr "*41.9*\tAusnahmen\n" # type: Plain text #: usr_41.txt:1369 msgid "Let's start with an example: >" msgstr "Beginnen wir mit einem Beispiel: >" # type: Plain text #: usr_41.txt:1375 #, no-wrap msgid "" "\t:try\n" "\t: read ~/templates/pascal.tmpl\n" "\t:catch /E484:/\n" "\t: echo \"Sorry, the Pascal template file cannot be found.\"\n" "\t:endtry\n" msgstr "" "\t:try\n" "\t: read ~/templates/pascal.tmpl\n" "\t:catch /E484:/\n" "\t: echo \"Sorry, the Pascal template file cannot be found.\"\n" "\t:endtry\n" # type: Plain text #: usr_41.txt:1379 msgid "" "The \":read\" command will fail if the file does not exist. Instead of " "generating an error message, this code catches the error and gives the user " "a nice message instead." msgstr "" "Der Befehl »:read« scheitert, falls die Datei nicht existiert. Statt eine " "Fehlermeldung zu generieren, fängt dieser Code den Fehler auf und gibt dem " "Benutzer stattdessen eine nette Meldung." # type: Plain text #: usr_41.txt:1385 msgid "" "For the commands in between \":try\" and \":endtry\" errors are turned into " "exceptions. An exception is a string. In the case of an error the string " "contains the error message. And every error message has a number. In this " "case, the error we catch contains \"E484:\". This number is guaranteed to " "stay the same (the text may change, e.g., it may be translated)." msgstr "" "Für die Befehle zwischen »:try« und »:endtry« werden Fehler in Ausnahmen " "verwandelt. Eine Ausnahme ist eine Zeichenkette. Im Falle eines Fehlers " "enthält die Zeichenkette die Fehlernummer. Und jede Fehlermeldung hat " "eine Nummer. In diesem Fall enthält der Fehler, den wir auffangen, " "»E484:«. Diese Nummer bleibt garantiert dieselbe (der Text kann sich " "ändern, z.B. übersetzt werden)." # type: Plain text #: usr_41.txt:1389 msgid "" "When the \":read\" command causes another error, the pattern \"E484:\" will " "not match in it. Thus this exception will not be caught and result in the " "usual error message." msgstr "" "Wenn der Befehl »:read« einen anderen Fehler verursacht, passt das Muster " "»E484:« nicht. Also wird diese Ausnahme nicht aufgefangen und resultiert " "in der üblichen Fehlermeldung." # type: Plain text #: usr_41.txt:1391 msgid "You might be tempted to do this: >" msgstr "Sie sind vielleicht versucht, dies zu tun: >" # type: Plain text #: usr_41.txt:1397 #, no-wrap msgid "" "\t:try\n" "\t: read ~/templates/pascal.tmpl\n" "\t:catch\n" "\t: echo \"Sorry, the Pascal template file cannot be found.\"\n" "\t:endtry\n" msgstr "" "\t:try\n" "\t: read ~/templates/pascal.tmpl\n" "\t:catch\n" "\t: echo \"Sorry, the Pascal template file cannot be found.\"\n" "\t:endtry\n" # type: Plain text #: usr_41.txt:1400 msgid "" "This means all errors are caught. But then you will not see errors that " "are " "useful, such as \"E21: Cannot make changes, 'modifiable' is off\"." msgstr "" "Dies bedeutet, dass alle Fehler aufgefangen werden. Dann aber sehen Sie " "keine nützlichen Fehler, so wie »E21: Kann keine Änderungen machen, " "'modifiable' ist aus«." # type: Plain text #: usr_41.txt:1402 msgid "Another useful mechanism is the \":finally\" command: >" msgstr "Ein weiterer nützlicher Mechanismus ist der Befehl »:finally«: >" # type: Plain text #: usr_41.txt:1412 #, no-wrap msgid "" "\t:let tmp = tempname()\n" "\t:try\n" "\t: exe \".,$write \" . tmp\n" "\t: exe \"!filter \" . tmp\n" "\t: .,$delete\n" "\t: exe \"$read \" . tmp\n" "\t:finally\n" "\t: call delete(tmp)\n" "\t:endtry\n" msgstr "" "\t:let tmp = tempname()\n" "\t:try\n" "\t: exe \".,$write \" . tmp\n" "\t: exe \"!filter \" . tmp\n" "\t: .,$delete\n" "\t: exe \"$read \" . tmp\n" "\t:finally\n" "\t: call delete(tmp)\n" "\t:endtry\n" # type: Plain text #: usr_41.txt:1418 msgid "" "This filters the lines from the cursor until the end of the file through " "the " "\"filter\" command, which takes a file name argument. No matter if the " "filtering works, something goes wrong in between \":try\" and \":finally\" " "or the user cancels the filtering by pressing CTRL-C, the \"call delete(tmp)" "\" is always executed. This makes sure you don't leave the temporary file " "behind." msgstr "" "Dies filtert die Zeilen vom Cursor bis zum Dateiende durch das Programm " "»filter«, das einen Dateinamen als Argument nimmt. Egal, ob das Filtern " "funktioniert, etwas geht zwischen »:try« und »:finally« schief, oder der " "Benutzer bricht das Filtern ab, indem er CTRL-C drückt, »call delete(tmp)« " "wird jederzeit ausgeführt. Dies stellt sicher, dass man nicht die " "temporäre Datei zurücklässt." # type: Plain text #: usr_41.txt:1421 msgid "" "More information about exception handling can be found in the reference " "manual: |exception-handling|." msgstr "" "Weiter Informationen über Ausnahme-Behandlung können im Referenzhandbuch " "gefunden werden: |exception-handling|." # type: Plain text #: usr_41.txt:1424 #, no-wrap msgid "*41.10*\tVarious remarks\n" msgstr "*41.10*\tVerschiedene Anmerkungen\n" # type: Plain text #: usr_41.txt:1427 msgid "" "Here is a summary of items that apply to Vim scripts. They are also " "mentioned elsewhere, but form a nice checklist." msgstr "" "Hier ist eine Sammlung von Elementen, die auf Vim-Skripte zutreffen. Sie " "werden auch anderswo erwähnt, aber formen eine nette Prüfliste." # type: Plain text #: usr_41.txt:1431 msgid "" "The end-of-line character depends on the system. For Unix a single " "character is used. For MS-DOS, Windows, OS/2 and the like, is " "used. This is important when using mappings that end in a . See |:" "source_crnl|." msgstr "" "Das Zeichen für das Zeilenende hängt vom System ab. Unix benutzt ein " "einzelnes -Zeichen. Unter MS-DOS, Windows, OS/2 und so wird " "benutzt. Dies ist wichtig, wenn Belegungen verwandt werden, die in einem " " enden. Siehe |:source_crnl|." # type: Plain text #: usr_41.txt:1434 msgid "WHITE SPACE" msgstr "WHITE SPACE" # type: Plain text #: usr_41.txt:1436 msgid "Blank lines are allowed and ignored." msgstr "Leere Zeilen sind erlaubt und werden ignoriert." # type: Plain text #: usr_41.txt:1442 msgid "" "Leading whitespace characters (blanks and TABs) are always ignored. The " "whitespaces between parameters (e.g. between the 'set' and the 'cpoptions' " "in the example below) are reduced to one blank character and plays the role " "of a separator, the whitespaces after the last (visible) character may or " "may not be ignored depending on the situation, see below." msgstr "" "Führende Leerzeichen und Tabulatoren werden immer ignoriert. Der " "Whitespace zwischen Parametern (z.B zwischen dem 'set' und dem 'cpoptions' " "im Beispiel unten) wird reduziert auf ein Leerzeichen und spielt die Rolle " "eines Trenners, der Whitespace nach dem letzten (sichtbaren) Zeichen kann " "situationsabhängig ignoriert werden oder auch nicht, siehe unten." # type: Plain text #: usr_41.txt:1444 msgid "For a \":set\" command involving the \"=\" (equal) sign, such as in: >" msgstr "" "Für einen »:set«-Befehl, der das Zeichen »=« (gleich) enthält, so wie in: >" # type: Plain text #: usr_41.txt:1446 #, no-wrap msgid "\t:set cpoptions =aABceFst\n" msgstr "\t:set cpoptions =aABceFst\n" # type: Plain text #: usr_41.txt:1449 msgid "" "the whitespace immediately before the \"=\" sign is ignored. But there can " "be no whitespace after the \"=\" sign!" msgstr "" "wird der Whitespace unmittelbar vor dem Zeichen »=« ignoriert. Aber es " "darf kein Whitespace nach dem »=«-Zeichen sein!" # type: Plain text #: usr_41.txt:1452 msgid "" "To include a whitespace character in the value of an option, it must be " "escaped by a \"\\\" (backslash) as in the following example: >" msgstr "" "Um ein Whitespace-Zeichen im Wert einer Option zu verwenden, muss es durch " "einen »\\« (Backslash) geschützt werden, wie in dem folgenden Beispiel: >" # type: Plain text #: usr_41.txt:1454 #, no-wrap msgid "\t:set tags=my\\ nice\\ file\n" msgstr "\t:set tags=my\\ nice\\ file\n" # type: Plain text #: usr_41.txt:1456 msgid "The same example written as >" msgstr "Dasselbe Bespiel geschrieben als >" # type: Plain text #: usr_41.txt:1458 #, no-wrap msgid "\t:set tags=my nice file\n" msgstr "\t:set tags=my nice file\n" # type: Plain text #: usr_41.txt:1460 msgid "will issue an error, because it is interpreted as: >" msgstr "resultiert in einem Fehler, weil es interpretiert wird als: >" # type: Plain text #: usr_41.txt:1464 #, no-wrap msgid "" "\t:set tags=my\n" "\t:set nice\n" "\t:set file\n" msgstr "" "\t:set tags=my\n" "\t:set nice\n" "\t:set file\n" # type: Plain text #: usr_41.txt:1467 msgid "COMMENTS" msgstr "KOMMENTARE" # type: Plain text #: usr_41.txt:1472 msgid "" "The character \" (the double quote mark) starts a comment. Everything " "after " "and including this character until the end-of-line is considered a comment " "and is ignored, except for commands that don't consider comments, as shown " "in examples below. A comment can start on any character position on the " "line." msgstr "" "Das Zeichen \" (das doppelte Anführungszeichen) leitet einen Kommentar " "ein. Alles nach und einschließlich dieses Zeichens bis zum Zeilenende " "wird als Kommentar betrachtet und ignoriert, außer bei Befehlen, die keine " "Kommentare beachten, wie in den Beispielen unten gezeigt. Ein Kommentar " "kann an jeder Zeichen-Position auf der Zeile beginnen." # type: Plain text #: usr_41.txt:1474 msgid "" "There is a little \"catch\" with comments for some commands. Examples: >" msgstr "Bei einigen Befehlen gibt es »Fallen« mit Kommentaren. Beispiele: >" # type: Plain text #: usr_41.txt:1479 #, no-wrap msgid "" "\t:abbrev dev development\t\t\" shorthand\n" "\t:map o#include\t\t\" insert include\n" "\t:execute cmd\t\t\t\" do it\n" "\t:!ls *.c\t\t\t\" list C files\n" msgstr "" "\t:abbrev dev development\t\t\" shorthand\n" "\t:map o#include\t\t\" insert include\n" "\t:execute cmd\t\t\t\" do it\n" "\t:!ls *.c\t\t\t\" list C files\n" # type: Plain text #: usr_41.txt:1488 #, no-wrap msgid "" "The abbreviation 'dev' will be expanded to 'development \" " "shorthand'. The\n" "mapping of will actually be the whole line after the 'o# ....' " "including\n" "the '\" insert include'. The \"execute\" command will give an error. The " "\"!\"\n" "command will send everything after it to the shell, causing an error for " "an\n" "unmatched '\"' character.\n" " There can be no comment after \":map\", \":abbreviate\", \":execute\" " "and \"!\"\n" "commands (there are a few more commands with this restriction). For the\n" "\":map\", \":abbreviate\" and \":execute\" commands there is a trick: >\n" msgstr "" "Die Abkürzung 'dev' wird expandiert zu 'development \" shorthand'. " "Die\n" "Belegung von ist tatsächlich die ganze Zeile nach dem 'o# ....',\n" "einschließlich dem '\" insert include'. Der »execute«-Befehl ergibt einen\n" "Fehler. Der »!«-Befehl schickt alles nach ihm an die Shell, was einen " "Fehler\n" "wegen eines unbalancierten '\"'-Zeichens verursacht.\n" " Nach den Befehlen »:map«, »:abbreviate«, »:execute« und »!« kann kein\n" "Kommentar stehen (es gibt ein paar Befehle mehr mit dieser Einschränkung).\n" "Für die Befehle »:map«, »:abbreviate« und »:execute« gibt es einen Trick: " ">\n" # type: Plain text #: usr_41.txt:1492 #, no-wrap msgid "" "\t:abbrev dev development|\" shorthand\n" "\t:map o#include|\" insert include\n" "\t:execute cmd\t\t\t|\" do it\n" msgstr "" "\t:abbrev dev development|\" shorthand\n" "\t:map o#include|\" insert include\n" "\t:execute cmd\t\t\t|\" do it\n" # type: Plain text #: usr_41.txt:1497 #, no-wrap msgid "" "With the '|' character the command is separated from the next one. And " "that\n" "next command is only a comment. For the last command you need to do two\n" "things: |:execute| and use '|': >\n" "\t:exe '!ls *.c'\t\t\t|\" list C files\n" msgstr "" "Mit dem Zeichen '|' wird ein Befehl vom nächsten getrennt. Und dieses " "nächste\n" "Zeichen ist nur ein Kommentar. Für den letzten Befehl müssen Sie zwei " "Dinge\n" "machen: |:execute| und '|' benutzen: >\n" "\n" "\t:exe '!ls *.c'\t\t\t|\" list C files\n" # type: Plain text #: usr_41.txt:1502 msgid "" "Notice that there is no white space before the '|' in the abbreviation and " "mapping. For these commands, any character until the end-of-line or '|' is " "included. As a consequence of this behavior, you don't always see that " "trailing whitespace is included: >" msgstr "" "Man beachte, das hier kein Leerzeichen vor dem '|' in der Abkürzung und " "der Belegung ist. Bei diesen Befehlen wird jedes Zeichen bis zum " "Zeilenende oder dem '|' einbezogen. Als Konsequenz dieses Verhaltens " "sieht man nicht immer, das nachstehende Leerzeichen einbezogen werden: >" # type: Plain text #: usr_41.txt:1504 #, no-wrap msgid "\t:map o#include \n" msgstr "\t:map o#include \n" # type: Plain text #: usr_41.txt:1507 msgid "" "To spot these problems, you can set the 'list' option when editing vimrc " "files." msgstr "" "Um diese Probleme zu erkennen, können Sie die Option 'list' setzen, wenn " "Sie vimrc-Dateien editieren." # type: Plain text #: usr_41.txt:1513 #, no-wrap msgid "" "For Unix there is one special way to comment a line, that allows making a " "Vim\n" "script executable: >\n" "\t#!/usr/bin/env vim -S\n" "\techo \"this is a Vim script\"\n" "\tquit\n" msgstr "" "Für Unix gibt es eine besondere Möglichkeit, eine Zeile zu kommentieren, " "die\n" "es erlaubt, ein Vim-Skript ausführbar zu machen: >\n" "\n" "\t#!/usr/bin/env vim -S\n" "\techo \"this is a Vim script\"\n" "\tquit\n" # type: Plain text #: usr_41.txt:1517 msgid "" "The \"#\" command by itself lists a line with the line number. Adding an " "exclamation mark changes it into doing nothing, so that you can add the " "shell command to execute the rest of the file. |:#!| |-S|" msgstr "" "Der Befehl »#« selbst listet eine Zeile mit der Zeilennummer. Das " "Hinzufügen eines Ausrufezeichen lässt ihn nichts machen, so dass Sie den " "Shell-Befehl hinzufügen können, um den Rest der Datei auszuführen. |:#!| " "|-S|" # type: Plain text #: usr_41.txt:1520 msgid "PITFALLS" msgstr "FALLEN" # type: Plain text #: usr_41.txt:1522 msgid "Even bigger problem arises in the following example: >" msgstr "Ein noch größeres Problem ensteht im folgenden Beispiel: >" # type: Plain text #: usr_41.txt:1525 #, no-wrap msgid "" "\t:map ,ab o#include\n" "\t:unmap ,ab \n" msgstr "" "\t:map ,ab o#include\n" "\t:unmap ,ab \n" # type: Plain text #: usr_41.txt:1530 msgid "" "Here the unmap command will not work, because it tries to unmap \",ab \". " "This does not exist as a mapped sequence. An error will be issued, which " "is " "very hard to identify, because the ending whitespace character in \":unmap ," "ab \" is not visible." msgstr "" "Hier funktioniert der unmap-Befehl nich, weil er versucht »,ab « " "freizugeben. Dies existiert nicht als Belegungsfolge. Ein Fehler wird " "ausgegeben, der sehr schwer zu identifizieren ist, weil das nachstehende " "Leerzeichen in »:unmap ,ab « nicht sichtbar ist." # type: Plain text #: usr_41.txt:1533 msgid "" "And this is the same as what happens when one uses a comment after an " "'unmap' command: >" msgstr "" "Und es ist dasselbe wie wenn man einen Kommentar nach einem »unmap«-Befehl " "benutzt: >" # type: Plain text #: usr_41.txt:1535 #, no-wrap msgid "\t:unmap ,ab \" comment\n" msgstr "\t:unmap ,ab \" comment\n" # type: Plain text #: usr_41.txt:1538 #, no-wrap msgid "" "Here the comment part will be ignored. However, Vim will try to unmap\n" "',ab ', which does not exist. Rewrite it as: >\n" msgstr "" "Hier wird der Teil, der Kommentar, ist ignoriert. Vim versucht dennoch\n" "»,ab «, freizugeben, was nicht existiert. Wir schreiben es um als: >\n" # type: Plain text #: usr_41.txt:1540 #, no-wrap msgid "\t:unmap ,ab| \" comment\n" msgstr "\t:unmap ,ab| \" comment\n" # type: Plain text #: usr_41.txt:1543 msgid "RESTORING THE VIEW" msgstr "DIE ANSICHT WIEDERHERSTELLEN" # type: Plain text #: usr_41.txt:1549 #, no-wrap msgid "" "Sometimes you want to make a change and go back to where cursor was.\n" "Restoring the relative position would also be nice, so that the same line\n" "appears at the top of the window.\n" " This example yanks the current line, puts it above the first line in " "the\n" "file and then restores the view: >\n" msgstr "" "Manchmal will man eine Änderung machen und dahin zurück gehen, wo der " "Cursor\n" "war. Die relative Position wiederherstellen wäre auch nett, so dass " "dieselbe\n" "Zeile die oberste im Fenster ist.\n" " Dieses Beispiel kopiert die aktuelle Zeile, setzt sie über die erste " "Zeile\n" "der Datei, und stellt dann die Ansicht wieder her: >\n" # type: Plain text #: usr_41.txt:1551 #, no-wrap msgid "\tmap ,p ma\"aYHmbgg\"aP`bzt`a\n" msgstr "\tmap ,p ma\"aYHmbgg\"aP`bzt`a\n" # type: Plain text #: usr_41.txt:1562 #, no-wrap msgid "" "What this does: >\n" "\tma\"aYHmbgg\"aP`bzt`a\n" "<\tma\t\t\tset mark a at cursor position\n" "\t \"aY\t\t\tyank current line into register a\n" "\t Hmb\t\tgo to top line in window and set mark b there\n" "\t\tgg\t\tgo to first line in file\n" "\t\t \"aP\t\tput the yanked line above it\n" "\t\t `b\t\tgo back to top line in display\n" "\t\t zt\tposition the text in the window as before\n" "\t\t\t `a\tgo back to saved cursor position\n" msgstr "" "Was dies tut: >\n" "\tma\"aYHmbgg\"aP`bzt`a\n" "<\tma\t\t\tsetze Markierung a bei Cursor-Position\n" "\t \"aY\t\t\tkopiere aktuelle Zeile in Register a\n" "\t Hmb\t\tgehe zur obersten Zeile im Fenster und setze\n" "\t\t\t\tdort Markierung b\n" "\t\tgg\t\tgehe zur ersten Zeile der Datei\n" "\t\t \"aP\t\tsetze kopierte Zeile über sie\n" "\t\t `b\t\tgehe zurück zur obersten Zeile der Anzeige\n" "\t\t zt\tpositioniere den Text im Fenster wie vorher\n" "\t\t\t `a\tgehe zurück zur gespeicherten Cursor-Position\n" # type: Plain text #: usr_41.txt:1565 msgid "PACKAGING" msgstr "PAKETIERUNG" # type: Plain text #: usr_41.txt:1574 #, no-wrap msgid "" "To avoid your function names to interfere with functions that you get from\n" "others, use this scheme:\n" "- Prepend a unique string before each function name. I often use an\n" " abbreviation. For example, \"OW_\" is used for the option window " "functions.\n" "- Put the definition of your functions together in a file. Set a global\n" " variable to indicate that the functions have been loaded. When sourcing " "the\n" " file again, first unload the functions.\n" "Example: >\n" msgstr "" "Um zu vermeiden, dass Ihre Funktionsnamen Funktionen beeinflussen, die Sie " "von\n" "anderen erhalten, benutzen Sie dieses Schema:\n" "\n" "- Stellen Sie jedem Funktionsnamen eine einzigartige Zeichenkette voran. " "Ich\n" " benutze oft eine Abkürzung. Zum Beispiel wird »OW_« für Funktionen des\n" "Optionsfensters verwandt.\n" "\n" "- Packen Sie die Definitionen Ihrer Funktionen in eine Datei. Setzen Sie " "eine\n" " globale Variable, die anzeigt, dass die Funktionen geladen wurden. Wenn " "die\n" " Datei erneut eingelesen wird, geben Sie erst die Funktionen frei.\n" "\n" "Beispiel: >\n" # type: Plain text #: usr_41.txt:1576 #, no-wrap msgid "\t\" This is the XXX package\n" msgstr "\t\" Dies ist das Paket XXX\n" # type: Plain text #: usr_41.txt:1581 #, no-wrap msgid "" "\tif exists(\"XXX_loaded\")\n" "\t delfun XXX_one\n" "\t delfun XXX_two\n" "\tendif\n" msgstr "" "\tif exists(\"XXX_loaded\")\n" "\t delfun XXX_one\n" "\t delfun XXX_two\n" "\tendif\n" # type: Plain text #: usr_41.txt:1585 #, no-wrap msgid "" "\tfunction XXX_one(a)\n" "\t\t... body of function ...\n" "\tendfun\n" msgstr "" "\tfunction XXX_one(a)\n" "\t\t... body of function ...\n" "\tendfun\n" # type: Plain text #: usr_41.txt:1589 #, no-wrap msgid "" "\tfunction XXX_two(b)\n" "\t\t... body of function ...\n" "\tendfun\n" msgstr "" "\tfunction XXX_two(b)\n" "\t\t... body of function ...\n" "\tendfun\n" # type: Plain text #: usr_41.txt:1591 #, no-wrap msgid "\tlet XXX_loaded = 1\n" msgstr "\tlet XXX_loaded = 1\n" # type: Plain text #: usr_41.txt:1594 #, no-wrap msgid "*41.11*\tWriting a plugin\t\t\t\t*write-plugin*\n" msgstr "*41.11*\tEin Plugin schreiben\t\t\t\t*write-plugin*\n" # type: Plain text #: usr_41.txt:1598 msgid "" "You can write a Vim script in such a way that many people can use it. This " "is called a plugin. Vim users can drop your script in their plugin " "directory and use its features right away |add-plugin|." msgstr "" "Sie können ein Vim-Skript so schreiben, dass viele Leute es benutzen " "können. Dies nennt sich Plugin. Vim-Benutzer können Ihr Skript in ihr " "Plugin-Verzeichnis legen und seine Features auf der Stelle nutzen " "|add-plugin|." # type: Plain text #: usr_41.txt:1600 msgid "There are actually two types of plugins:" msgstr "Tatsächlich gibt es zwei Typen von Plugins:" # type: Plain text #: usr_41.txt:1603 #, no-wrap msgid "" " global plugins: For all types of files.\n" "filetype plugins: Only for files of a specific type.\n" msgstr "" " globale Plugins: Für alle Typen von Dateien.\n" "Dateityp-Plugins: Nur für Dateien eines bestimmten Typs.\n" # type: Plain text #: usr_41.txt:1607 msgid "" "In this section the first type is explained. Most items are also relevant " "for writing filetype plugins. The specifics for filetype plugins are in " "the " "next section |write-filetype-plugin|." msgstr "" "In diesem Abschnitt wird der erste Typ erklärt. Die meisten Elemente sind " "auch relevant für das Schreiben von Dateityp-Plugins. Die Spezifika für " "Dateityp-Plugins folgen im nächsten Abschnitt |write-filetype-plugin|." # type: Plain text #: usr_41.txt:1610 msgid "NAME" msgstr "NAME" # type: Plain text #: usr_41.txt:1616 msgid "" "First of all you must choose a name for your plugin. The features provided " "by the plugin should be clear from its name. And it should be unlikely " "that " "someone else writes a plugin with the same name but which does something " "different. And please limit the name to 8 characters, to avoid problems on " "old Windows systems." msgstr "" "Zuallererst müssen Sie einen Namen für Ihr Plugin wählen. Die Features, " "die von dem Plugin bereitgestellt werden werden, sollten anhand seines " "Namens klar sein. Und es sollte unwahrscheinlich sein, dass jemand " "anderes ein Plugin mit demselben Namen schreibt, das etwas anderes tut. " "Und bitte begrenzen Sie den Namen auf acht Zeichen, um Probleme auf alten " "Windows-Systemen zu vermeiden." # type: Plain text #: usr_41.txt:1619 msgid "" "A script that corrects typing mistakes could be called \"typecorr.vim\". " "We " "will use it here as an example." msgstr "" "Ein Skript, welches Tipp-Fehler korrigiert, könnte »typecorr.vim« genannt " "werden. Wir benutzen es hier als Beispiel." # type: Plain text #: usr_41.txt:1622 msgid "" "For the plugin to work for everybody, it should follow a few guidelines. " "This will be explained step-by-step. The complete example plugin is at the " "end." msgstr "" "Damit das Plugin für jeden funktioniert, sollte es einigen wenigen " "Richtlinien folgen. Diese werden Schritt-für-Schritt erklärt. Das " "komplette Beispiel-Plugin steht am Ende." # type: Plain text #: usr_41.txt:1625 msgid "BODY" msgstr "KÖRPER" # type: Plain text #: usr_41.txt:1627 msgid "" "Let's start with the body of the plugin, the lines that do the actual " "work: >" msgstr "" "Lassen Sie uns mit dem Körper des Plugins beginnen, den Zeilen, die " "tatsächlich die Arbeit erledigen: >" # type: Plain text #: usr_41.txt:1634 #, no-wrap msgid "" " 14\tiabbrev teh the\n" " 15\tiabbrev otehr other\n" " 16\tiabbrev wnat want\n" " 17\tiabbrev synchronisation\n" " 18\t\t\\ synchronization\n" " 19\tlet s:count = 4\n" msgstr "" " 14\tiabbrev teh the\n" " 15\tiabbrev otehr other\n" " 16\tiabbrev wnat want\n" " 17\tiabbrev synchronisation\n" " 18\t\t\\ synchronization\n" " 19\tlet s:count = 4\n" # type: Plain text #: usr_41.txt:1636 msgid "The actual list should be much longer, of course." msgstr "Die tatsächliche Liste sollte selbstverständlich viel länger sein." # type: Plain text #: usr_41.txt:1639 msgid "" "The line numbers have only been added to explain a few things, don't put " "them in your plugin file!" msgstr "" "Die Zeilennummern wurden nur hinzugefügt, um ein Paar Dinge zu erläutern, " "übernehmen Sie sie nicht in Ihre Plugin-Datei!" # type: Plain text #: usr_41.txt:1642 msgid "HEADER" msgstr "KOPF" # type: Plain text #: usr_41.txt:1647 msgid "" "You will probably add new corrections to the plugin and soon have several " "versions laying around. And when distributing this file, people will want " "to know who wrote this wonderful plugin and where they can send remarks. " "Therefore, put a header at the top of your plugin: >" msgstr "" "Sie werden dem Plugin vermutlich neue Korrekturen hinzufügen, und bald " "haben Sie mehrere Versionen herumliegen. Und wenn Sie die Datei " "verteilen, werden die Leute wissen wollen, wer dieses wundervolle Plugin " "schrieb und wohin sie Anmerkungen schicken können. Deshalb stellen Sie " "Kopfzeilen an den Beginn Ihres Plugins: >" # type: Plain text #: usr_41.txt:1651 #, no-wrap msgid "" " 1\t\" Vim global plugin for correcting typing mistakes\n" " 2\t\" Last Change:\t2000 Oct 15\n" " 3\t\" Maintainer:\tBram Moolenaar \n" msgstr "" " 1\t\" Vim global plugin for correcting typing mistakes\n" " 2\t\" Last Change:\t2000 Oct 15\n" " 3\t\" Maintainer:\tBram Moolenaar \n" # type: Plain text #: usr_41.txt:1656 msgid "" "About copyright and licensing: Since plugins are very useful and it's " "hardly " "worth restricting their distribution, please consider making your plugin " "either public domain or use the Vim |license|. A short note about this " "near " "the top of the plugin should be sufficient. Example: >" msgstr "" "Über Copyright und Lizensierung: Da Plugins sehr nützlich sind, und es " "kaum wert ist, ihre Verteilung zu begrenzen, erwägen Sie bitte, Ihr Plugin " "entweder in die Public-Domain oder unter die Vim-Lizenz |license| zu " "stellen. Eine kurze Zeile hierüber nahe des Beginn des Plugins sollte " "ausreichend sein. Beispiel: >" # type: Plain text #: usr_41.txt:1658 #, no-wrap msgid " 4\t\" License:\tThis file is placed in the public domain.\n" msgstr " 4\t\" License:\tThis file is placed in the public domain.\n" # type: Plain text #: usr_41.txt:1661 msgid "LINE CONTINUATION, AVOIDING SIDE EFFECTS\t\t*use-cpo-save*" msgstr "ZEILENFORTSETZUNG, SEITENEFFEKTE VERMEIDEN\t\t*use-cpo-save*" # type: Plain text #: usr_41.txt:1668 msgid "" "In line 18 above, the line-continuation mechanism is used |line-" "continuation|. Users with 'compatible' set will run into trouble here, " "they " "will get an error message. We can't just reset 'compatible', because that " "has a lot of side effects. To avoid this, we will set the 'cpoptions' " "option to its Vim default value and restore it later. That will allow the " "use of line-continuation and make the script work for most people. It is " "done like this: >" msgstr "" "Oben in Zeile 18 wird der Mechanismus der Zeilen-Fortsetzung benutzt " "|line-continuation|. Benutzer, bei denen 'compatible' gesetzt ist, werden " "hier Probleme, eine Fehlermeldung bekommen. Wir können nicht einfach " "'compatible' neu setzen, weil dies viele Seiteneffekte hat. Um dies zu " "vermeiden, setzen wir die Option 'cpoptions' auf ihren Vim-Standardwert " "und stellen sie später wieder her. Das erlaubt die Benutzung von " "Zeilen-Fortsetzung und lässt das Skript für die meisten Leute " "funktionieren. Es wird so gemacht: >" # type: Plain text #: usr_41.txt:1673 #, no-wrap msgid "" " 11\tlet s:save_cpo = &cpo\n" " 12\tset cpo&vim\n" " ..\n" " 42\tlet &cpo = s:save_cpo\n" msgstr "" " 11\tlet s:save_cpo = &cpo\n" " 12\tset cpo&vim\n" " ..\n" " 42\tlet &cpo = s:save_cpo\n" # type: Plain text #: usr_41.txt:1676 msgid "" "We first store the old value of 'cpoptions' in the s:save_cpo variable. At " "the end of the plugin this value is restored." msgstr "" "Wir speichern zunächst den alten Wert von 'cpoptions' in der Variablen " "s:save_cpo. Am Ende des Plugins wird dieser Wert wiederhergestellt." # type: Plain text #: usr_41.txt:1680 msgid "" "Notice that a script-local variable is used |s:var|. A global variable " "could already be in use for something else. Always use script-local " "variables for things that are only used in the script." msgstr "" "Beachten Sie, dass eine skript-lokale Variable benutzt wird |s:var|. Eine " "globale Variable könnte bereits für etwas anderes in Gebrauch sein. " "Benutzen Sie immer skript-lokale Variablen für Dinge, die nur in dem " "Skript benutzt werden." # type: Plain text #: usr_41.txt:1683 msgid "NOT LOADING" msgstr "NICHT LADEN" # type: Plain text #: usr_41.txt:1688 msgid "" "It's possible that a user doesn't always want to load this plugin. Or the " "system administrator has dropped it in the system-wide plugin directory, " "but " "a user has his own plugin he wants to use. Then the user must have a " "chance " "to disable loading this specific plugin. This will make it possible: >" msgstr "" "Es ist möglich, dass ein Nutzer nicht immer dieses Plugin laden möchte. " "Oder der System-Administrator hat es in das system-weite " "Plugin-Verzeichnis gelegt, aber ein Nutzer hat sein eigenes Plugin, das er " "nutzen möchte. Dann muss der Nutzer eine Möglichkeit haben, das Laden " "dieses bestimmten Plugins zu deaktivieren. Dies macht es möglich: >" # type: Plain text #: usr_41.txt:1693 #, no-wrap msgid "" " 6\tif exists(\"loaded_typecorr\")\n" " 7\t finish\n" " 8\tendif\n" " 9\tlet loaded_typecorr = 1\n" msgstr "" " 6\tif exists(\"loaded_typecorr\")\n" " 7\t finish\n" " 8\tendif\n" " 9\tlet loaded_typecorr = 1\n" # type: Plain text #: usr_41.txt:1697 msgid "" "This also avoids that when the script is loaded twice it would cause error " "messages for redefining functions and cause trouble for autocommands that " "are added twice." msgstr "" "Dies vermeidet es auch, dass wenn das Skript zweimal geladen wird, dass es " "Fehlermeldungen für das Neudefinieren von Funktionen und Schwierigkeiten " "bei automatischen Befehlen, die zweimal hinzugefügt werden, verursacht." # type: Plain text #: usr_41.txt:1700 msgid "MAPPING" msgstr "BELEGUNGEN" # type: Plain text #: usr_41.txt:1706 msgid "" "Now let's make the plugin more interesting: We will add a mapping that adds " "a correction for the word under the cursor. We could just pick a key " "sequence for this mapping, but the user might already use it for something " "else. To allow the user to define which keys a mapping in a plugin uses, " "the item can be used: >" msgstr "" "Nun lassen Sie uns das Plugin interessanter machen: Wir fügen eine " "Belegung hinzu, die eine Korrektur für das Wort unter dem Cursor " "hinzufügt. Um dem Nutzer zu erlauben, zu definieren, welche Tasten eine " "Belegung in einem Plugin benutzt, kann das Element benutzt " "werden: >" # type: Plain text #: usr_41.txt:1708 #, no-wrap msgid " 22\t map a TypecorrAdd\n" msgstr " 22\t map a TypecorrAdd\n" # type: Plain text #: usr_41.txt:1710 msgid "" "The \"TypecorrAdd\" thing will do the work, more about that further " "on." msgstr "Das »TypecorrAdd« macht die Arbeit, mehr darüber weiter unten." # type: Plain text #: usr_41.txt:1713 msgid "" "The user can set the \"mapleader\" variable to the key sequence that he " "wants this mapping to start with. Thus if the user has done: >" msgstr "" "Der Nutzer kann die Variable »mapleader« auf die Tastenfolge setzen, mit " "der er diese Belegung starten lassen möchte. Falls der Nutzer also dies " "macht: >" # type: Plain text #: usr_41.txt:1715 #, no-wrap msgid "\tlet mapleader = \"_\"\n" msgstr "\tlet mapleader = \"_\"\n" # type: Plain text #: usr_41.txt:1718 msgid "" "the mapping will define \"_a\". If the user didn't do this, the default " "value will be used, which is a backslash. Then a map for \"\\a\" will be " "defined." msgstr "" "definiert die Belegung »_a«. Falls der Nutzer dies nicht tat, wird der " "Standardwert benutzt, was ein Backslash ist. Dann wird eine Belegung für " "»\\a« definiert." # type: Plain text #: usr_41.txt:1721 msgid "" "Note that is used, this will cause an error message if the mapping " "already happened to exist. |:map-|" msgstr "" "Beachten Sie, dass benutzt wird, dies verursacht eine " "Fehlermeldung, falls die Belegung der Tastenfolge bereits existiert. |:map-" "|" # type: Plain text #: usr_41.txt:1724 msgid "" "But what if the user wants to define his own key sequence? We can allow " "that " "with this mechanism: >" msgstr "" "Aber was, falls der Nutzer seine eigene Tastenfolge definieren möchte? Wir " "können dies mit folgendem Mechanismus erlauben: >" # type: Plain text #: usr_41.txt:1728 #, no-wrap msgid "" " 21\tif !hasmapto('TypecorrAdd')\n" " 22\t map a TypecorrAdd\n" " 23\tendif\n" msgstr "" " 21\tif !hasmapto('TypecorrAdd')\n" " 22\t map a TypecorrAdd\n" " 23\tendif\n" # type: Plain text #: usr_41.txt:1732 msgid "" "This checks if a mapping to \"TypecorrAdd\" already exists, and only " "defines the mapping from \"a\" if it doesn't. The user then has a " "chance of putting this in his vimrc file: >" msgstr "" "Dies prüft, ob eine Belegung von »TypecorrAdd« bereits existiert, " "und definiert die Belegung von »a« nur dann, falls nicht. Der " "Nutzer hat nun die Möglichkeit, dies in seine vimrc zu packen: >" # type: Plain text #: usr_41.txt:1734 #, no-wrap msgid "\tmap ,c TypecorrAdd\n" msgstr "\tmap ,c TypecorrAdd\n" # type: Plain text #: usr_41.txt:1736 msgid "" "Then the mapped key sequence will be \",c\" instead of \"_a\" or \"\\a\"." msgstr "Dann ist die belegte Tastenfolge »,c« statt »_a« oder »\\a«." # type: Plain text #: usr_41.txt:1739 msgid "PIECES" msgstr "STÜCKE" # type: Plain text #: usr_41.txt:1746 msgid "" "If a script gets longer, you often want to break up the work in pieces. " "You " "can use functions or mappings for this. But you don't want these functions " "and mappings to interfere with the ones from other scripts. For example, " "you could define a function Add(), but another script could try to define " "the same function. To avoid this, we define the function local to the " "script by prepending it with \"s:\"." msgstr "" "Wenn ein Skript länger wird, möchte man oft die Arbeit in Portionen " "aufteilen. Man kann hierfür Funktionen oder Belegungen benutzen. Aber " "man will nicht, dass diese Funktionen oder Belegungen andere Skripte " "beeinflussen. Man könnte zum Beispiel eine Funktion Add() definieren, " "aber ein anderes Skript könnte versuchen, dieselbe Funktion zu " "definieren. Um dies zu vermeiden, definieren wir die Funktion lokal zum " "Skript, indem wir ihr »s:« voranstellen." # type: Plain text #: usr_41.txt:1748 msgid "We will define a function that adds a new typing correction: >" msgstr "" "Wir definieren eine Funktion, die eine neue Tipp-Korrektur hinzufügt: >" # type: Plain text #: usr_41.txt:1754 #, no-wrap msgid "" " 30\tfunction s:Add(from, correct)\n" " 31\t let to = input(\"type the correction for \" . a:from . \": \")\n" " 32\t exe \":iabbrev \" . a:from . \" \" . to\n" " ..\n" " 36\tendfunction\n" msgstr "" " 30\tfunction s:Add(from, correct)\n" " 31\t let to = input(\"type the correction for \" . a:from . \": \")\n" " 32\t exe \":iabbrev \" . a:from . \" \" . to\n" " ..\n" " 36\tendfunction\n" # type: Plain text #: usr_41.txt:1759 msgid "" "Now we can call the function s:Add() from within this script. If another " "script also defines s:Add(), it will be local to that script and can only " "be " "called from the script it was defined in. There can also be a global " "Add() " "function (without the \"s:\"), which is again another function." msgstr "" "Jetzt können wir innerhalb des Skripts die Funktion s:Add() aufrufen. " "Falls ein anderes Skript ebenfalls s:Add() definiert, ist sie lokal zu " "jenem Skript und kann nur von dem Skript aufgerufen werden, in dem sie " "definiert wurde. Es kann auch eine globale Funktion Add() geben (ohne " "»s:«, die wieder eine andere Funktion ist." # type: Plain text #: usr_41.txt:1762 msgid "" " can be used with mappings. It generates a script ID, which " "identifies " "the current script. In our typing correction plugin we use it like this: >" msgstr "" " kann mit Belegungen verwandt werden. Es generiert eine Skript-ID, " "die das aktuelle Skript identifiziert. In unserem Tipp-Korrektur-Plugin " "verwenden wir es folgendermaßen: >" # type: Plain text #: usr_41.txt:1766 #, no-wrap msgid "" " 24\tnoremap