Editing Matlab files in Vim

Edit Matlab M-files in Vim editor (indentation, syntax highlighting, tags , mlint support)

You are now following this Submission

Contains a set of files useful to edit Matlab files.

Included is :
1) Syntax highlighting
2) Correct indentation
3) Integration in vim of the mlint Matlab code checker with the :make command
4) Correct setting to use the matchit.vim script (extension of the % command to match if/end, for/end,... blocks)
5) Tag support
6) Help file

Cite As

Fabrice (2026). Editing Matlab files in Vim (https://uk.mathworks.com/matlabcentral/fileexchange/21798-editing-matlab-files-in-vim), MATLAB Central File Exchange. Retrieved .

Acknowledgements

Inspired: Highlighting Matlab files in Vim

Categories

Find more on Environment and Settings in Help Center and MATLAB Answers

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.4.0.0

Updated support for the matchit script (to use % to jump between try/end, if/end, switch/end,... blocks) , to deal with expressions like a(1+end) where 'end' is not the end of a block command but the length of a vector.

1.3.0.0

- Added support for indentation of if/end blocks on the same line
- Changed the function indentation behavior (now based on the 'indent all functions' option in the Matlab Editor)

1.2.0.0

Enhanced syntax highligting for Matlab m-files : most Matlab builtin functions are now highlighted

1.1.0.0

- added a help file (matlab.txt)
- wrong indentation for subfunctions without matching 'end' has been fixed

1.0.0.0