File Exchange

image thumbnail

Highlighting Matlab files in Vim

version 1.5 (27.3 KB) by

Highlighting Matlab m-files in Vim editor --- light- and dark colour-schemes.

8 Downloads

Updated

View License

   Two colour scheme that resemble MATLAB's default with several additions (including light and dark background versions)

   These colour schemes are based on Ian Langworth's "tolerable.vim", and modified to resemble MATLAB's default colours on a light and dark backgrounds. The colours are easily distinguishable and best suited for MATLAB's purposes (see "group-name" for help, or Syntax/Highlight-test menu ":runtime syntax/hitest.vim").

   Included also an enhanced syntax files (based on Fabrice Guy's matlab-vim submission) to have the best experience with Matlab and Vim. Most of these files are slightly changed, so I have added all of them to the package. It is recommended to watch the original files as well.

   The files are best suited for the newest Matlab releases (2008a and later), but may be used with any Matlab 7.x release.

Install:
    Put this file in the users colors directory (default unix "~/.vim" or "$vim\vimfiles" on Windows systems), unzip and load with ":colorscheme matlablight" or ":colorscheme matlabdark"

Comments and Ratings (7)

Evan

Evan (view profile)

I tried using this (vim on Ubuntu), and it made vim impossibly slow. The auto-indenting also added more white space then it should have (or at least more than the Matlab IDE does).

zhen liu

I don't know how to download it

chen xinfeng

chen xinfeng (view profile)

great work! :)
-----------------------------------------------
but,

In my case, after copied form ZIP, m-file will auto folding all the codes when opened. So I advice users to modify this before copy from ZIP.
******this ZIP/syntax/matlab.vim*****
" --- Add Folding Method ---
if has("folding")
   setlocal foldmethod=syntax
endif

***********modify**************
 --- Add Folding Method ---
"if has("folding")
" setlocal foldmethod=syntax
"endif

Yuan Wang

Pretty Beautiful! :)

Joe Hays

Would you please consider making this a 'file type' plugin? That way the color scheme can be configured to only apply to .m files?

Peter

Peter (view profile)

Great work! I have been using it on SSH client for a long time. Thanks!

Marc Sean

How to you apply this to vim in cygwin?

Updates

1.5

* Added the MLint file for consistency
* A new screen-shot
* Additional minor changes

1.4

- Refined Colours
- Added cterm colours
- Syntax file to visualize colours
- Added folding & spelling
- New mappings (see help file)
- Consistent colouring of blocks (try/end)
- Full list of MATLAB keywords
- Renewed colouring syntax

MATLAB Release
MATLAB 7.6 (R2008a)
Acknowledgements

Inspired by: Editing Matlab files in Vim

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video