sponsor Vim development Vim logo Vim Book Ad

mlint.vim : Matlab code checker (mlint) compiler file

 script karma  Rating 11/4, Downloaded by 760  Comments, bugs, improvements  Vim wiki

created by
Sameer Sheorey
 
script type
ftplugin
 
description
This is the compiler file for the Matlab code checker - mlint. I've tested this with Matlab R2006a and vim 7.0, but this should work with other versions too.

Matlab's editor automatically checks the code you type in it for warnings and errors. To do this in vim, install this script, and type :make whenever you want to check your code. There is a button for this in gvim. Note that you need to have Matlab's bin directory in your system path.

mlint's messages are of 3 types :
Type 1: Suggestions and simple warnings
Type 2: Warnings about performance penalties
Type 3: Errors
The type number is displayed next to the column number in the error window. Use :copen to open the error window, and :cn and :cp  (or Alt-n and Alt-p) to go to the next and previous message respectively.
 
install details
Copy mlint.vim to your $HOME/vimfiles/compiler/ directory.  Add this to your vimrc :

autocmd BufEnter *.m    compiler mlint
autocmd BufEnter *.m    map <M-n> :cnext<CR>
autocmd BufEnter *.m    map <M-p> :cprevious<CR>

autocmd BufLeave *.m    unmap <M-n>
autocmd BufLeave *.m    unmap <M-p>

Restart vim
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
mlint.vim 20070126 2007-01-26 5.7 Sameer Sheorey Initial upload
ip used for rating: 3.144.96.159

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github