Vim Tips Wiki
(Added to Compiler category + minor reformating.)
No edit summary
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
{{review}}
 
{{review}}
  +
{{TipImported
{{Tip
 
 
|id=458
 
|id=458
  +
|previous=457
|title=How to use quickfix mode to see all errors in one window (:cwindow).
 
  +
|next=459
|created=April 20, 2003 3:30
+
|created=2003
 
|complexity=intermediate
 
|complexity=intermediate
 
|author=Omanakuttan
 
|author=Omanakuttan
 
|version=6.0
 
|version=6.0
 
|rating=46/15
 
|rating=46/15
  +
|category1=Compiler
|text=
 
  +
|category2=
Uptil vim 5.8, I was using the cfile, clist...etc for quickfix mode.
 
 
}}
 
Until vim 5.8, I was using the cfile, clist etc for quickfix mode.
   
In vim6.x, I found out that <tt>:cw</tt> will boost my productivity as a programmer.
+
In vim6.x, I found out that <code>:cw</code> will boost my productivity as a programmer.
   
To make, type <tt>:make</tt> as we do in older versions of vim (&lt;6.0).
+
To make, type <code>:make</code> as we do in older versions of vim (<6.0).
   
Instead of <tt>clist</tt>, <tt>cfile</tt>, ''etc.'', type
+
Instead of <code>clist</code>, <code>cfile</code>, ''etc.'', type
  +
<pre>
:cw&lt;enter&gt;
+
:cw<enter>
  +
</pre>
   
you get one split window, in which errors are listsed. Current error line will be highlighted and cursor will move to the corresponding source file line.
+
you get one split window, in which errors are listed. Current error line will be highlighted and cursor will move to the corresponding source file line.
   
Doing an &lt;enter&gt; on any error line in the error window will take the cursor to the corresponding source line.
+
Pressing Enter on any error line in the error window will take the cursor to the corresponding source line.
   
This eliminates the need for the process described in [[VimTip345]].(Now you can get rid of Visual studio altogether !)
+
This eliminates the need for the process described in [[VimTip345]].(Now you can get rid of Visual studio altogether !)
   
  +
==References==
 
*{{help|:cw}}
   
== References ==
+
==Comments==
 
I guess I should say what works for me for compiling Java programs on MS Windows. It can be improved, but I am not sure how. I put the following in _vimrc.
* {{help|:cw}}
 
 
}}
 
 
== Comments ==
 
I guess I should say what works for me for compiling Java programs on MS Windows. It can be improved, but I am not sure how. I put the following in _vimrc.
 
 
<pre>
 
<pre>
set makeprg=javac
+
set makeprg=javac
set makeef=c:\dev\src\errors.txt
+
set makeef=c:\dev\src\errors.txt
set shellpipe=2&gt;
+
set shellpipe=2>
set errorformat=%A%f:%l:\ %m,%C%m
+
set errorformat=%A%f:%l:\ %m,%C%m
noremap &lt;M-1&gt; :w&lt;Enter&gt;:set ch=5&lt;Enter&gt;:make -d C:\\dev\\classes %:p&lt;Enter&gt;
+
noremap <M-1> :w<CR>:set ch=5<CR>:make -d C:\\dev\\classes %:p<CR>
noremap &lt;M-2&gt; :cp&lt;Enter&gt;
+
noremap <M-2> :cp<CR>
noremap &lt;M-3&gt; :cn&lt;Enter&gt;
+
noremap <M-3> :cn<CR>
noremap &lt;M-4&gt; :cl&lt;Enter&gt;
+
noremap <M-4> :cl<CR>
 
</pre>
 
</pre>
Press Alt-1 to compile the current file. Alt-2 and Alt-3 move the cursor in the source code to previous and next errors. (I have another command to reset the command line height when I'm done looking at errors.)
 
   
 
Press Alt-1 to compile the current file. Alt-2 and Alt-3 move the cursor in the source code to previous and next errors. (I have another command to reset the command line height when I'm done looking at errors.)
Problem: it removes spaces so the caret that javac uses to point to the error location is wrong. I have tried all kinds of different formats. If someone does not know a better error format for javac, I just discoved that :set shellpipe= will open DOS window with all the spaces preserved.
 
   
 
Problem: it removes spaces so the caret that javac uses to point to the error location is wrong. I have tried all kinds of different formats. If someone does not know a better error format for javac, I just discoved that :set shellpipe= will open DOS window with all the spaces preserved.
   
 
jallen--AT--cashsystemsinc.com
 
, April 30, 2003 8:20
 
 
----
 
----
<!-- parsed by vimtips.py in 0.731672 seconds-->
 
 
[[Category:Compiler]]
 

Latest revision as of 09:36, 1 March 2013

Tip 458 Printable Monobook Previous Next

created 2003 · complexity intermediate · author Omanakuttan · version 6.0


Until vim 5.8, I was using the cfile, clist etc for quickfix mode.

In vim6.x, I found out that :cw will boost my productivity as a programmer.

To make, type :make as we do in older versions of vim (<6.0).

Instead of clist, cfile, etc., type

:cw<enter>

you get one split window, in which errors are listed. Current error line will be highlighted and cursor will move to the corresponding source file line.

Pressing Enter on any error line in the error window will take the cursor to the corresponding source line.

This eliminates the need for the process described in VimTip345.(Now you can get rid of Visual studio altogether !)

References[]

Comments[]

I guess I should say what works for me for compiling Java programs on MS Windows. It can be improved, but I am not sure how. I put the following in _vimrc.

set makeprg=javac
set makeef=c:\dev\src\errors.txt
set shellpipe=2>
set errorformat=%A%f:%l:\ %m,%C%m
noremap <M-1> :w<CR>:set ch=5<CR>:make -d C:\\dev\\classes %:p<CR>
noremap <M-2> :cp<CR>
noremap <M-3> :cn<CR>
noremap <M-4> :cl<CR>

Press Alt-1 to compile the current file. Alt-2 and Alt-3 move the cursor in the source code to previous and next errors. (I have another command to reset the command line height when I'm done looking at errors.)

Problem: it removes spaces so the caret that javac uses to point to the error location is wrong. I have tried all kinds of different formats. If someone does not know a better error format for javac, I just discoved that :set shellpipe= will open DOS window with all the spaces preserved.