Scratchbook

Das Leben ist immer anders als die Realität.

Text editieren.

Claude, 2. Oktober 2007, 21:08 Uhr

Warning: Use of undefined constant ri_rand_compare - assumed 'ri_rand_compare' (this will throw an Error in a future version of PHP) in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/random-image-widget/random_image.php on line 129 Warning: Use of undefined constant ri_rand_compare - assumed 'ri_rand_compare' (this will throw an Error in a future version of PHP) in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/random-image-widget/random_image.php on line 130 Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384 Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384 Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384 Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384 Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384 Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384 Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384 Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384 Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384 Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384 Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384 Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384 Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384 Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384 Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384 Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384 Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384 Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384 Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384 Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384 Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384 Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384 Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384 Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384 Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384 Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384 Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384 Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384 Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384 Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384 Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384 Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384 Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384 Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384 Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384 Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384 Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384 Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384 Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384 Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384 Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384 Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384 Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384 Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384 Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384 Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384 Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384 Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384 Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384 Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384 Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384 Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384 Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384 Warning: preg_match(): Compilation failed: invalid range in character class at offset 4 in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 1384 Warning: preg_match_all(): Compilation failed: invalid range in character class at offset 4 in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 700 Warning: Invalid argument supplied for foreach() in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 707 Warning: preg_match_all(): Compilation failed: invalid range in character class at offset 4 in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 700 Warning: Invalid argument supplied for foreach() in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/plugins/lightbox-plus/classes/shd.class.php on line 707

vim120.png

In der Informatik gibt es nichts grundlegenderes als Text editieren. Sei es nun HTML, Konfigurationsdateien, Programmcode, E-Mails (ok, für letzteres braucht man keinen speziellen Texteditor).

Ja, Notepad ist ein Texteditor. Zumindest speichert es Textdateien als Textdateien… Aber schon bei verschiedenen Zeichenkodierungen und Zeilenumbrüchen streckt es die Waffen.

Denn Text ist nicht einfach Text. Ein kurzer Abriss über Codierungen:

Die Amis haben sich gedacht, wir machen eine Tabelle, in der jedes Zeichen eine Nummer bekommt, damit Computer damit arbeiten können. Heraus kam ASCII – American Standard Code for Information Interchange.

Dummerweise bietet diese Tabelle nur Platz für 128 Zeichen. Die Chinesen dürften arg Schwierigkeiten bekommen, wenn sie ihres ca. 5’000 Zeichen grosses Alphabet damit codieren wollten. Deshalb stellen sie ihre Zeichen mit einer Kombination aus zwei oder mehr Nummern der ASCII-Tabelle dar. Jede Sprache hat sozusagen ihre eigene Tabelle; ihr eigener Zeichensatz. Das ist insofern dann unpraktisch, wenn Programmierer länderübergreifend zusammenarbeiten.

Warum also nicht eine einheitliche Tabelle machen, in der alle Zeichen auf diesem Planeten eine Nummer bekommen? Gesagt, getan. Unicode ward geboren. Alle 1’114’112 Zeichen dieser Welt finden in dieser Tabelle Platz. Und UTF-8 ist die am weitesten verbreitete Kodierung, um diese Zeichen darzustellen.

Hier sind ganz viele Zeichen vertreten.

Und was hat es mit den Zeilenumbrüchen auf sich?

Ganz einfach: Jedes Betriebssystem kocht sein eigenes Süppchen. Wie war es denn bei der Schreibmaschine?

royal-typewriter.gif

Man schreibt und schreibt auf der Zeile, und irgendwann – *bing* – genau, ist die Zeile zuende. Dann muss man den Wagen zurückschieben, dabei wird auch die Zeile gewechselt.

Bei den Computern ist es ein bisschen anders: Unix wechselt nur die Zeile, der Mac schiebt nur den Wagen zurück; einzig und allein – man glaubt es kaum – Windows macht beides.

Nichtsdestotrotz: Notepad kommt nur mit Windows-Textdateien zurecht. Alternativen?

Als die glorreiche AutoIt-Ära eingeläutet wurde, war der Crimson Editor lange mein Lieblingswerkzeug. Bis er von SciTE abgelöst wurde, welches schon fast eine IDE für AutoIt ist…

UltraEdit ist sehr verbreitet. Kostet aber. Und der ist mir einfach unsympathisch – jeder benutzt ihn, weil er angeblich „alles“ kann. Ausserdem protzen die Hersteller mit 2’000’000 Benutzern und dass dieser DER Standard sei, Microsoft-Zertifiziert, von jedem Glunggi-Heftli getestet und mit vielen Sternli ausgezeichnet… Bäh! Kein Wunder kriegen IT-Manager davon feuchte Träume…

Es muss doch irgendwie Editoren geben, welche das gleiche können, aber gratis sind.

Eigentlich haben alle Editoren das gleiche Problem: Manche Dinge gehen mit der Maus schneller…

Ganz anders Vi bzw. Vim. Den startet man, und kann zuerst einmal – gar keinen Text eingeben. Dazu muss man zuerst in den Einfüge-Modus. Daneben gibt es den Kommando-Modus. Text in die Datei tippen kann man dann zwar nicht – dafür liegen einem aber sämtliche intergalaktischen Textbearbeitungstricks unter den Fingerspitzen. Das Universum der Textdateien erobern und dabei die Pfoten gemütlich auf der Tastatur lassen – das ist praktisch!

Warum mit Notepad laufen, warum mit UltraEdit fahren, wenn man mit Vim fliegen kann? Er erinnert wirklich ein wenig an ein Raumschiff. Die Bedienung ist zwar nicht ganz einfach zu erlernen, aber welches Raumschiff lässt sich schon auf Anhieb bedienen? Klar: Notepad ist einfach. Laufen ist einfach. Aber fliegen ist schneller als laufen…

Nebenbei bietet er alles, was man so erwarten kann:

  • Code Folding (einzelne Zeilen einfach einklappen)
  • Syntax Highlighting (farbige Schrift, das muss sein)
  • Autocomplete (jaa, CTRL+N, und ein Wort, welches schon im Text vorkommt, wird automatisch ergänzt)
  • Split View
  • Makros
  • Schnell
  • Betriebssystemunabhängig
  • Erweiterbar durch Plugins…
  • und, und, und…

Es gibt sehr viele Features. Man kann gar nicht alles lernen. Stattdessen soll man sich während dem Editieren immer wieder fragen: Geht das auch effizienter? Dann kurz in der Doku nachschlagen und immer wieder anwenden. Dann kommt Routine auf und die Finger tippen plötzlich von alleine. Ich habe meine Abschlussarbeit mit Vim erstellt und mich so daran gewöhnt, dass ich diesen Komfort nicht mehr missen möchte. Und täglich lernt man neues. Alles, was ich mit der Zeit lerne, trage ich hier zusammen:

mindpad.ch/page/vim

Die Hürde ist anfangs hoch – aber es lohnt sich. Irgendwann… Irgendwann sieht Text editieren dann so aus:


YouTube Direkt

foxie

hmm, das mussimr scho moll no übrlege…vA jetzt woni mi mit c++ beschäftige, wirds langsam rar mit guete editore…abr ebbe…dr aafang

Longneck

WAAAS, du fohsch mit C++ a??
jää schuelisch oder freiwillig?

Do muesi denn aber mol zu dir in kurs cho… 🙂

foxie

freiwillig 😀
mir isch z langwiilig
und mit php witterzmache hani kei luscht.

jo, i musses jetzt au zersch lerne

foxie

ah, nice ufflischtig…das hilft schomol…i glaub i mach extremforderig: vim und c++ zämme lerne 😀 denn hani wenigschtens öbbis z tue (näbe dr matur…;-))

Freidenker

vim isch ok. solang i ufme terminal schaff, bevorzug ich auch vi clones. andersch verhaltet sichs aber im GUI: unter Mac OS X benutz i fasch usschliesslich nur no textmate.

Freidenker

@foxie: hehe… du wirsch C++ hasse 😉 aber da ja an dr ETH bisch, wirsch di eh gli mol mit Eiffel döfe beschäftige.

foxie

wär het gseit, dass i gang go inf studiere? 😛

Longneck

oja, textmate isch notürlich unschlagbar. halt nur ufem mac… vim gits ebbe überall.

rakudave

[quote comment=“55837″]@foxie: hehe… du wirsch C++ hasse 😉 aber da ja an dr ETH bisch, wirsch di eh gli mol mit Eiffel döfe beschäftige.[/quote]

ich dörf mi mit Eiffel befasse *blargh* naja, besser als C++ isches allemals

Longneck

so geil: bi grad mit em vim im php sourcecode go stöbere. hmm, wurum isch ächt alles so schön gfoldet? mit {{{ machsch nämlich manuelli folds. somit isch klar: php isch im vim programmiert worde!

Freidenker

@foxie: was gosch denn go studiere?!? physe?
@dave: aber du machs inf demfall?!

foxie

bis jetzt hani vor ITET

Freidenker

aha, aso e mischig.

foxie

jaa…nochli meh, zumer d zähn dra ussbisse..

Warning: count(): Parameter must be an array or an object that implements Countable in /home/httpd/vhosts/scratchbook.ch/httpdocs/wp-content/themes/scratchbook/navigation_bar_bottom.php on line 1