 |
about-linux.com Forum Linux Video Tutorials
|
| Vorheriges Thema anzeigen :: Nächstes Thema anzeigen |
| Autor |
Nachricht |
0815 Gast
|
|
Verfasst am: Mi Nov 09, 2005 3:02 pm Titel: Der Vim |
|
|
Grüßt euch,
ich hoffe mal ihr könnt mir weiterhelfen, selbst nach langwieriger Onlinesuche konnte ich keine rechte Antwort auf mein Problem finden, obwohl das nicht allzu schwer sein sollte. Und zwar gehts darum: kann ich einen bereits existierenden Sourcecode in PHP mit dem Vim formattieren lassen, sodass die von mir gewünschten indents für Funktionen, Schleifen ect. eingehalten werden? Ich habe mir auf vim.org einen PHP Indent Plugin geholt, aber scheinbar macht er die indents nur während der Eingabe. |
|
| Nach oben |
|
 |
Holger_S Website Team


Anmeldungsdatum: 16.10.2004 Beiträge: 161 Wohnort: Furtwangen
|
|
Verfasst am: Mi Nov 09, 2005 7:08 pm Titel: |
|
|
Also ich weiß es vom c++ Programmieren, einfach die .vimrc in deinem home bearbeiten und zb. diese config einfügen (ohne beschreibung natürlich)
| http://jmcpherson.org/vimrc.html hat folgendes geschrieben: |
vim is extremely customizable. It will read the file .vimrc in your home directory before it starts. This file can contain settings and even scripts. The below settings are ones I've found helpful -- give them a try!
set nocompatible
This setting prevents vim from emulating the original vi's bugs and limitations.
set autoindent
set smartindent
The first setting tells vim to use "autoindent" (that is, use the current line's indent level to set the indent level of new lines). The second makes vim attempt to intelligently guess the indent level of any new line based on the previous line, assuming the source file is in a C-like language. Combined, they are very useful in writing well-formatted source code.
set tabstop=4
set shiftwidth=4
I prefer 4-space tabs to 8-space tabs. The first setting sets up 4-space tabs, and the second tells vi to use 4 spaces when text is indented (auto or with the manual indent adjustmenters.)
set showmatch
This setting will cause the cursor to very briefly jump to a brace/parenthese/bracket's "match" whenever you type a closing or opening brace/parenthese/bracket. I've had almost no mismatched-punctuation errors since I started using this setting.
set guioptions-=T
I find the toolbar in the GUI version of vim (gvim) to be somewhat useless visual clutter. This option gets rid of the toolbar.
set vb t_vb=
This setting prevents vi from making its annoying beeps when a command doesn't work. Instead, it briefly flashes the screen -- much less annoying.
set ruler
This setting ensures that each window contains a statusline that displays the current cursor position.
set nohls
By default, search matches are highlighted. I find this annoying most of the time. This option turns off search highlighting. You can always turn it back on with :set hls.
set incsearch
With this nifty option, vim will search for text as you enter it. For instance, if you type /bob to search for bob, vi will go to the first "b" after you type the "b," to the first "bo" after you type the "o," and so on. It makes searching much faster, since if you pay attention you never have to enter more than the minimum number of characters to find your target location. Make sure that you press Enter to accept the match after vim finds the location you want.
set virtualedit=all
By default, vim doesn't let the cursor stray beyond the defined text. This setting allows the cursor to freely roam anywhere it likes in command mode. It feels weird at first but is quite useful.
|
Gruß Holger _________________ AMD Athlon 3000+ with Ubutnu Breezy
Intel Centrino 1,6Ghz with Open SuSE 10.0
 |
|
| Nach oben |
|
 |
|
|
Du kannst keine Beiträge in dieses Forum schreiben. Du kannst auf Beiträge in diesem Forum nicht antworten. Du kannst deine Beiträge in diesem Forum nicht bearbeiten. Du kannst deine Beiträge in diesem Forum nicht löschen. Du kannst an Umfragen in diesem Forum nicht mitmachen.
|
|