--------------------------------Linux Guide---------------------------------- by Ingo Blechschmidt (c) 2002 ----------------------------------------------------------------------------- ------------------------- VIM als HTML-Editor ------------------------- Sam Jun 30 09:49:43 MEST 2001 ------------------------- VIM Editor HTML imap map ----------------------------------------------------------------------------- Sie wollen VIM, den Standard-Unix-Editor, auch als HTML-Editor nutzen. Dieser Artikel zeigt, wie man sich schnell ein VIM-Skript mit den genannten Anforderungen bauen kann. ----------------------------------------------------------------------------- siehe <"down/htmlvim.vim">Herunterladen, oder kopieren: --------CODE--------: htmlvim.vim " htmlvim.vim - erweitert VIM um HTML-FUnktionen " Copyright (C) 2001 by Ingo Blechschmidt, " Sam Jun 30 10:00:50 MEST 2001 " " This program is free software; you can redistribute it and/or modify " it under the terms of the GNU General Public License as published by " the Free Software Foundation; either version 2 of the License, or " (at your option) any later version. " " This program is distributed in the hope that it will be useful, " but WITHOUT ANY WARRANTY; without even the implied warranty of " MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the " GNU General Public License for more details. " " You should have received a copy of the GNU General Public License " along with this program; if not, write to the Free Software " Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. " " Ingo Blechschmidt " Arberstraße 5 " 86179 Augsburg " E-Mail: iblech@web.de, http://www.way.to/uselinux/ " Tel.: +49 / 821 882955 " " " Syntax Highlighting :syntax on :so /usr/share/vim/syntax/html.vim " Umlaute :imap ä ä :imap ü ü :imap ö ö :imap Ä Ä :imap Ö Ö :imap Ü Ü :imap ß ß " Tags :inoremap #h1

XXX

?XXXcw :inoremap #h2

XXX

?XXXcw :inoremap #h3

XXX

?XXXcw :inoremap #h4

XXX

?XXXcw :inoremap #h5
XXX
?XXXcw :inoremap #h6
XXX
?XXXcw :inoremap #img ?XXXcw :inoremap #red XXX?XXXcw :inoremap #blue XXX?XXXcw :inoremap #yellow XXX?XXXcw :inoremap #green XXX?XXXcw :inoremap #href ?XXXcw :inoremap #dl
XXX
?XXXcw :inoremap #dt
XXX
?XXXcw :inoremap #dd
XXX
?XXXcw :inoremap #ol
    XXX
?XXXcw :inoremap #li
  • XXX
  • ?XXXcw :inoremap #ul
      XXX
    ?XXXcw --------/CODE-------- Wenn Sie nun das Makro abspeichern und mit :so htmlvim.vim aufrufen, stehen Ihnen folgende Kommandos zur Verfügung: # Umlaute # ä, ü, ö, Ä, Ö, Ü und ß werden automatisch beim Tippen in die entsprechenden HTML-Entities umgewandelt. # Tags # # #h1 bis #h6 # Beim Tippen wird aus #h1 der entsprechende HTML-Tag, gleich mit dem Cursor in der Mitte. # Diese maps ermöglichen das schnellere Tabellengestalten. # #img # Fügt den Tag für Bilder ein, mit automatischer Cursorsetzung. # #red, #blue, #yellow, #green # Setzt den font-Tag. # #href # Automatische Link-Setzung # #dl, #ol, #ul und #dt, #dd, #li # Automatische Listengestaltung. Natürlich können Sie diese Sammlung noch erweitern. Falls Sie autoindent gesetzt haben, kann es Probleme mit der Einrückung geben. Dies können Sie aber beheben, indem Sie die entfernen. ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- This document is distributed under the terms of the GNU Free Documentation License.