[TriLUG] vi(m) #1 of the top ten linux tools admins should know/have

Wing D Lizard wingedlizard at nc.rr.com
Wed Nov 2 16:15:39 EST 2005


Owen Berry wrote:

>
>You can compile and go to errors in your source code in Vim. Within the
>editor type one of these:
>
>  :help quickfix
>  :help make
>  :help errorformat
>
>Thanks to: http://www.vim.org/tips/tip.php?tip_id=3
>
>After being forced to use vi on a Sun box for about 6 months, vi became
>quite natural to me. Vim is even better, and I choose to use it to do my
>coding, especially as it runs well under screen. Vim-speak has become
>second hand to me, and I rarely have to think, except when adding new
>words or phrases to my "vocabulary".
>
>Never underestimate the depth of something you can't see the bottom of.
>You could probably say the same about Emacs, but I prefer Vim.
>
>Owen
>
>

This is very interesting ( and helpful). I'll have to
point it out to my vi co-workers.  Everybody I've asked
says 'Oh, I do that in another window'.

Depth IS the problem in emacs.  It is hopeless to
'get' all of it.  Fortunately, we don't have to.

 From one of the included emacs lisp files:

(defvar compilation-error-regexp-alist '(("\\([a-zA-Z][-a-zA-Z._0-9]+: 
?\\)?\\([a-zA-Z]?:?[^:(  \n]*[^:(
 \n0-9][^:(      \n]*\\)[:(][    ]*\\([0-9]+\\)\\([)     
]\\|:\\(\\([0-9]+:\\)\\|[0-9]*[^:0-9]\\)\\)" 2 3 6) ("
\\(\\([a-zA-Z]:\\)?[^:(   \n]+\\)(\\([0-9]+\\)) : \\(error\\|warning\\) 
C[0-9]+:" 1 3) ("\\(Error\\|Warning\\)
\\(\\([FEW][0-9]+\\) \\)?\\([a-zA-Z]?:?[^:(        \n]+\\) 
\\([0-9]+\\)\\([)       ]\\|:[^0-9\n]\\)" 4 5) (".*[
    :]\\([a-zA-Z]?:?[^:(    \n]+\\)[:(](+[  ]*\\([0-9]+\\))[:)      ]*$" 
1 2) (".*([        ]*\\([a-zA-Z]?:?[^:
(    \n]+\\)[:(][    ]*\\([0-9]+\\))" 1 2) ("[^\n ]+ (\\([0-9]+\\)) in 
\\([^ \n]+\\)" 2 1) (".*in \\([^(\n]+\\)
(\\([0-9]+\\))$" 1 2) ("\\(cfe\\|fort\\): [^:\n]*: \\([^ \n]*\\), line 
\\([0-9]+\\):" 2 3) ("\\(.* on \\)?[Ll]i
ne[    ]+\\([0-9]+\\)[         ]+of[   
]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2) (".*\"\\([^,\" \n     ]+\\)\",
 lines? \\([0-9]+\\)\\([(.]\\([0-9]+\\))?\\)?[:., (-]" 1 2 4) ("^File 
\"\\([^,\" \n     ]+\\)\", lines? \\([0-9
]+\\)[-0-9]*, characters? \\([0-9]+\\)" 1 2 3) ("[a-z0-9/]+: 
\\([eE]rror\\|[wW]arning\\): \\([^,\" \n    ]+\\)[
,:] \\(line \\)?\\([0-9]+\\):" 2 4) (".*in line \\([0-9]+\\) of file 
\\([^ \n]+[^. \n]\\)\\.? " 2 1) (" +\\([0-
9]+\\) +.*\n[ew] [0-9]+-+" nil 1) ("[Ew] +[0-9]+ line \\([0-9]+\\) -  " 
nil 1) ("[EW], \\([^(\n]*\\)(\\([0-9]+\
\),[        ]*\\([0-9]+\\)" 1 2 3) ("\\(cc\\| cft\\)-[0-9]+ 
c\\(c\\|f77\\): ERROR \\([^,\n]+, \\)* File = \\([^
,\n]+\\), Line = \\([0-9]+\\)" 4 5) ("\\([^( \n      
]+\\)(\\([0-9]+\\):\\([0-9]+\\)) : " 1 2 3) ("\"\\(.*\\)\"
,\\([0-9]+\\)\\s-+\\(Error\\|Warning\\)\\[[0-9]+\\]:" 1 2) ("\\([^, 
\n        ]+\\), line \\([0-9]+\\), char \\
([0-9]+\\)[:., (-]" 1 2 3) (".* at \\([^ \n]+\\) line 
\\([0-9]+\\)[,.\n]" 1 2) ("Semantic error at line \\([0-9
]+\\), column \\([0-9]+\\), file \\(.*\\):" 3 1 2) ("Error [0-9]+ at 
(\\([0-9]*\\):\\([^)\n]+\\))" 2 1) (".*: E
RROR File = \\(.+\\), Line = \\([0-9]+\\)" 1 2) (".*: WARNING File = 
\\(.+\\), Line = \\([0-9]+\\)" 1 2) (".* E
RROR [a-zA-Z0-9 ]+, File = \\(.+\\), Line = \\([0-9]+\\), Column = 
\\([0-9]+\\)" 1 2 3)) (#$ . 6343))

this looks like the 'vi errorformat' that you have to figure out in vi ( or
is it vim).

I'm not understimating vi ( or vim), I use it daily.  For development,
I'm way more productive using emacs.

Brett "Emacs IS my OS" Bolen
aka b²


PS: this is my last "emacs uber vi" post ( for today anyway).





-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.362 / Virus Database: 267.12.7/155 - Release Date: 11/1/2005




More information about the TriLUG mailing list